diff --git a/sdk/compute/azure-mgmt-compute/CHANGELOG.md b/sdk/compute/azure-mgmt-compute/CHANGELOG.md index 197a7c9e874c..86c97529e1b1 100644 --- a/sdk/compute/azure-mgmt-compute/CHANGELOG.md +++ b/sdk/compute/azure-mgmt-compute/CHANGELOG.md @@ -1,5 +1,58 @@ # Release History +## 17.0.0 (2020-09-16) + +**Features** + + - Model VirtualMachineExtensionUpdate has a new parameter enable_automatic_upgrade + - Model VirtualMachineScaleSetExtensionUpdate has a new parameter enable_automatic_upgrade + - Model DedicatedHostGroup has a new parameter instance_view + - Model DedicatedHostGroup has a new parameter support_automatic_placement + - Model VirtualMachineScaleSetExtension has a new parameter enable_automatic_upgrade + - Model VirtualMachineScaleSetVM has a new parameter security_profile + - Model VirtualMachineImage has a new parameter disallowed + - Model VirtualMachine has a new parameter security_profile + - Model VirtualMachine has a new parameter extensions_time_budget + - Model VirtualMachine has a new parameter host_group + - Model VirtualMachineInstanceView has a new parameter vm_health + - Model VirtualMachineInstanceView has a new parameter patch_status + - Model VirtualMachineInstanceView has a new parameter assigned_host + - Model DiskEncryptionSet has a new parameter encryption_type + - Model Snapshot has a new parameter disk_state + - Model Snapshot has a new parameter disk_access_id + - Model Snapshot has a new parameter network_access_policy + - Model CreationData has a new parameter logical_sector_size + - Model DiskEncryptionSetUpdate has a new parameter encryption_type + - Model VirtualMachineScaleSetVMInstanceView has a new parameter assigned_host + - Model WindowsConfiguration has a new parameter patch_settings + - Model DiskUpdate has a new parameter disk_access_id + - Model DiskUpdate has a new parameter network_access_policy + - Model DiskUpdate has a new parameter tier + - Model VirtualMachineScaleSetUpdateVMProfile has a new parameter security_profile + - Model VirtualMachineScaleSetVMProfile has a new parameter security_profile + - Model VirtualMachineUpdate has a new parameter security_profile + - Model VirtualMachineUpdate has a new parameter extensions_time_budget + - Model VirtualMachineUpdate has a new parameter host_group + - Model Disk has a new parameter disk_access_id + - Model Disk has a new parameter network_access_policy + - Model Disk has a new parameter tier + - Model VirtualMachineExtension has a new parameter enable_automatic_upgrade + - Model VirtualMachineScaleSet has a new parameter host_group + - Model DedicatedHostGroupUpdate has a new parameter instance_view + - Model DedicatedHostGroupUpdate has a new parameter support_automatic_placement + - Model SnapshotUpdate has a new parameter disk_access_id + - Model SnapshotUpdate has a new parameter network_access_policy + - Model VirtualMachineScaleSetExtensionProfile has a new parameter extensions_time_budget + - Added operation VirtualMachineScaleSetVMsOperations.retrieve_boot_diagnostics_data + - Added operation VirtualMachinesOperations.retrieve_boot_diagnostics_data + - Added operation VirtualMachinesOperations.begin_assess_patches + - Added operation DiskEncryptionSetsOperations.list_associated_resources + - Added operation group DiskAccessesOperations + +**Breaking changes** + + - Operation DedicatedHostGroupsOperations.get has a new signature + ## 17.0.0b1 (2020-06-17) This is beta preview version. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/__init__.py index 20a4019e9c23..cdc7f7a1709a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/__init__.py @@ -10,7 +10,7 @@ __all__ = ['ComputeManagementClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass 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 b2b9cc9383a4..fee8b630091a 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 @@ -46,15 +46,37 @@ class ComputeManagementClient(MultiApiClientMixin, _SDKClient): :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ - DEFAULT_API_VERSION = '2019-12-01' + DEFAULT_API_VERSION = '2020-06-30' _PROFILE_TAG = "azure.mgmt.compute.ComputeManagementClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { None: DEFAULT_API_VERSION, - 'disk_encryption_sets': '2019-11-01', - 'disks': '2019-11-01', + 'availability_sets': '2020-06-01', + 'dedicated_host_groups': '2020-06-01', + 'dedicated_hosts': '2020-06-01', + 'galleries': '2019-12-01', + 'gallery_application_versions': '2019-12-01', + 'gallery_applications': '2019-12-01', + 'gallery_image_versions': '2019-12-01', + 'gallery_images': '2019-12-01', + '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': '2019-11-01', + 'ssh_public_keys': '2020-06-01', + 'usage': '2020-06-01', + 'virtual_machine_extension_images': '2020-06-01', + 'virtual_machine_extensions': '2020-06-01', + 'virtual_machine_images': '2020-06-01', + 'virtual_machine_run_commands': '2020-06-01', + 'virtual_machine_scale_set_extensions': '2020-06-01', + 'virtual_machine_scale_set_rolling_upgrades': '2020-06-01', + 'virtual_machine_scale_set_vm_extensions': '2020-06-01', + 'virtual_machine_scale_set_vms': '2020-06-01', + 'virtual_machine_scale_sets': '2020-06-01', + 'virtual_machine_sizes': '2020-06-01', + 'virtual_machines': '2020-06-01', }}, _PROFILE_TAG + " latest" ) @@ -73,8 +95,6 @@ def __init__( self._config = ComputeManagementClientConfiguration(credential, subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) super(ComputeManagementClient, self).__init__( - credential, - self._config, api_version=api_version, profile=profile ) @@ -102,6 +122,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2019-07-01: :mod:`v2019_07_01.models` * 2019-11-01: :mod:`v2019_11_01.models` * 2019-12-01: :mod:`v2019_12_01.models` + * 2020-05-01: :mod:`v2020_05_01.models` + * 2020-06-01: :mod:`v2020_06_01.models` + * 2020-06-30: :mod:`v2020_06_30.models` """ if api_version == '2015-06-15': from .v2015_06_15 import models @@ -148,7 +171,16 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2019-12-01': from .v2019_12_01 import models return models - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + elif api_version == '2020-05-01': + from .v2020_05_01 import models + return models + elif api_version == '2020-06-01': + from .v2020_06_01 import models + return models + elif api_version == '2020-06-30': + from .v2020_06_30 import models + return models + raise ValueError("API version {} is not available".format(api_version)) @property def availability_sets(self): @@ -165,6 +197,7 @@ def availability_sets(self): * 2019-03-01: :class:`AvailabilitySetsOperations` * 2019-07-01: :class:`AvailabilitySetsOperations` * 2019-12-01: :class:`AvailabilitySetsOperations` + * 2020-06-01: :class:`AvailabilitySetsOperations` """ api_version = self._get_api_version('availability_sets') if api_version == '2015-06-15': @@ -189,8 +222,10 @@ def availability_sets(self): from .v2019_07_01.operations import AvailabilitySetsOperations as OperationClass elif api_version == '2019-12-01': from .v2019_12_01.operations import AvailabilitySetsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import AvailabilitySetsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'availability_sets'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -200,6 +235,7 @@ def dedicated_host_groups(self): * 2019-03-01: :class:`DedicatedHostGroupsOperations` * 2019-07-01: :class:`DedicatedHostGroupsOperations` * 2019-12-01: :class:`DedicatedHostGroupsOperations` + * 2020-06-01: :class:`DedicatedHostGroupsOperations` """ api_version = self._get_api_version('dedicated_host_groups') if api_version == '2019-03-01': @@ -208,8 +244,10 @@ def dedicated_host_groups(self): from .v2019_07_01.operations import DedicatedHostGroupsOperations as OperationClass elif api_version == '2019-12-01': from .v2019_12_01.operations import DedicatedHostGroupsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import DedicatedHostGroupsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'dedicated_host_groups'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -219,6 +257,7 @@ def dedicated_hosts(self): * 2019-03-01: :class:`DedicatedHostsOperations` * 2019-07-01: :class:`DedicatedHostsOperations` * 2019-12-01: :class:`DedicatedHostsOperations` + * 2020-06-01: :class:`DedicatedHostsOperations` """ api_version = self._get_api_version('dedicated_hosts') if api_version == '2019-03-01': @@ -227,8 +266,26 @@ def dedicated_hosts(self): from .v2019_07_01.operations import DedicatedHostsOperations as OperationClass elif api_version == '2019-12-01': from .v2019_12_01.operations import DedicatedHostsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import DedicatedHostsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'dedicated_hosts'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def disk_accesses(self): + """Instance depends on the API version: + + * 2020-05-01: :class:`DiskAccessesOperations` + * 2020-06-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 else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + 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))) @property @@ -237,14 +294,20 @@ def disk_encryption_sets(self): * 2019-07-01: :class:`DiskEncryptionSetsOperations` * 2019-11-01: :class:`DiskEncryptionSetsOperations` + * 2020-05-01: :class:`DiskEncryptionSetsOperations` + * 2020-06-30: :class:`DiskEncryptionSetsOperations` """ api_version = self._get_api_version('disk_encryption_sets') if api_version == '2019-07-01': from .v2019_07_01.operations import DiskEncryptionSetsOperations as OperationClass elif api_version == '2019-11-01': from .v2019_11_01.operations import DiskEncryptionSetsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import DiskEncryptionSetsOperations as OperationClass + elif api_version == '2020-06-30': + from .v2020_06_30.operations import DiskEncryptionSetsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + 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 @@ -259,6 +322,8 @@ def disks(self): * 2019-03-01: :class:`DisksOperations` * 2019-07-01: :class:`DisksOperations` * 2019-11-01: :class:`DisksOperations` + * 2020-05-01: :class:`DisksOperations` + * 2020-06-30: :class:`DisksOperations` """ api_version = self._get_api_version('disks') if api_version == '2016-04-30-preview': @@ -277,8 +342,12 @@ def disks(self): from .v2019_07_01.operations import DisksOperations as OperationClass elif api_version == '2019-11-01': from .v2019_11_01.operations import DisksOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import DisksOperations as OperationClass + elif api_version == '2020-06-30': + from .v2020_06_30.operations import DisksOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + 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))) @property @@ -300,7 +369,7 @@ def galleries(self): elif api_version == '2019-12-01': from .v2019_12_01.operations import GalleriesOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'galleries'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -319,7 +388,7 @@ def gallery_application_versions(self): elif api_version == '2019-12-01': from .v2019_12_01.operations import GalleryApplicationVersionsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'gallery_application_versions'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -338,7 +407,7 @@ def gallery_applications(self): elif api_version == '2019-12-01': from .v2019_12_01.operations import GalleryApplicationsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'gallery_applications'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -360,7 +429,7 @@ def gallery_image_versions(self): elif api_version == '2019-12-01': from .v2019_12_01.operations import GalleryImageVersionsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'gallery_image_versions'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -382,7 +451,7 @@ def gallery_images(self): elif api_version == '2019-12-01': from .v2019_12_01.operations import GalleryImagesOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'gallery_images'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -398,6 +467,7 @@ def images(self): * 2019-03-01: :class:`ImagesOperations` * 2019-07-01: :class:`ImagesOperations` * 2019-12-01: :class:`ImagesOperations` + * 2020-06-01: :class:`ImagesOperations` """ api_version = self._get_api_version('images') if api_version == '2016-04-30-preview': @@ -418,8 +488,10 @@ def images(self): from .v2019_07_01.operations import ImagesOperations as OperationClass elif api_version == '2019-12-01': from .v2019_12_01.operations import ImagesOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import ImagesOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'images'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -433,6 +505,7 @@ def log_analytics(self): * 2019-03-01: :class:`LogAnalyticsOperations` * 2019-07-01: :class:`LogAnalyticsOperations` * 2019-12-01: :class:`LogAnalyticsOperations` + * 2020-06-01: :class:`LogAnalyticsOperations` """ api_version = self._get_api_version('log_analytics') if api_version == '2017-12-01': @@ -449,8 +522,10 @@ def log_analytics(self): from .v2019_07_01.operations import LogAnalyticsOperations as OperationClass elif api_version == '2019-12-01': from .v2019_12_01.operations import LogAnalyticsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import LogAnalyticsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'log_analytics'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -464,6 +539,7 @@ def operations(self): * 2019-03-01: :class:`Operations` * 2019-07-01: :class:`Operations` * 2019-12-01: :class:`Operations` + * 2020-06-01: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2017-12-01': @@ -480,8 +556,10 @@ def operations(self): from .v2019_07_01.operations import Operations as OperationClass elif api_version == '2019-12-01': from .v2019_12_01.operations import Operations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import Operations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -494,6 +572,7 @@ def proximity_placement_groups(self): * 2019-03-01: :class:`ProximityPlacementGroupsOperations` * 2019-07-01: :class:`ProximityPlacementGroupsOperations` * 2019-12-01: :class:`ProximityPlacementGroupsOperations` + * 2020-06-01: :class:`ProximityPlacementGroupsOperations` """ api_version = self._get_api_version('proximity_placement_groups') if api_version == '2018-04-01': @@ -508,8 +587,10 @@ def proximity_placement_groups(self): from .v2019_07_01.operations import ProximityPlacementGroupsOperations as OperationClass elif api_version == '2019-12-01': from .v2019_12_01.operations import ProximityPlacementGroupsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import ProximityPlacementGroupsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'proximity_placement_groups'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -528,7 +609,7 @@ def resource_skus(self): elif api_version == '2019-04-01': from .v2019_04_01.operations import ResourceSkusOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'resource_skus'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -543,6 +624,8 @@ def snapshots(self): * 2019-03-01: :class:`SnapshotsOperations` * 2019-07-01: :class:`SnapshotsOperations` * 2019-11-01: :class:`SnapshotsOperations` + * 2020-05-01: :class:`SnapshotsOperations` + * 2020-06-30: :class:`SnapshotsOperations` """ api_version = self._get_api_version('snapshots') if api_version == '2016-04-30-preview': @@ -561,8 +644,12 @@ def snapshots(self): from .v2019_07_01.operations import SnapshotsOperations as OperationClass elif api_version == '2019-11-01': from .v2019_11_01.operations import SnapshotsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import SnapshotsOperations as OperationClass + elif api_version == '2020-06-30': + from .v2020_06_30.operations import SnapshotsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + 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))) @property @@ -570,12 +657,15 @@ def ssh_public_keys(self): """Instance depends on the API version: * 2019-12-01: :class:`SshPublicKeysOperations` + * 2020-06-01: :class:`SshPublicKeysOperations` """ api_version = self._get_api_version('ssh_public_keys') if api_version == '2019-12-01': from .v2019_12_01.operations import SshPublicKeysOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import SshPublicKeysOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'ssh_public_keys'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -593,6 +683,7 @@ def usage(self): * 2019-03-01: :class:`UsageOperations` * 2019-07-01: :class:`UsageOperations` * 2019-12-01: :class:`UsageOperations` + * 2020-06-01: :class:`UsageOperations` """ api_version = self._get_api_version('usage') if api_version == '2015-06-15': @@ -617,8 +708,10 @@ def usage(self): from .v2019_07_01.operations import UsageOperations as OperationClass elif api_version == '2019-12-01': from .v2019_12_01.operations import UsageOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import UsageOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'usage'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -636,6 +729,7 @@ def virtual_machine_extension_images(self): * 2019-03-01: :class:`VirtualMachineExtensionImagesOperations` * 2019-07-01: :class:`VirtualMachineExtensionImagesOperations` * 2019-12-01: :class:`VirtualMachineExtensionImagesOperations` + * 2020-06-01: :class:`VirtualMachineExtensionImagesOperations` """ api_version = self._get_api_version('virtual_machine_extension_images') if api_version == '2015-06-15': @@ -660,8 +754,10 @@ def virtual_machine_extension_images(self): from .v2019_07_01.operations import VirtualMachineExtensionImagesOperations as OperationClass elif api_version == '2019-12-01': from .v2019_12_01.operations import VirtualMachineExtensionImagesOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import VirtualMachineExtensionImagesOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'virtual_machine_extension_images'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -679,6 +775,7 @@ def virtual_machine_extensions(self): * 2019-03-01: :class:`VirtualMachineExtensionsOperations` * 2019-07-01: :class:`VirtualMachineExtensionsOperations` * 2019-12-01: :class:`VirtualMachineExtensionsOperations` + * 2020-06-01: :class:`VirtualMachineExtensionsOperations` """ api_version = self._get_api_version('virtual_machine_extensions') if api_version == '2015-06-15': @@ -703,8 +800,10 @@ def virtual_machine_extensions(self): from .v2019_07_01.operations import VirtualMachineExtensionsOperations as OperationClass elif api_version == '2019-12-01': from .v2019_12_01.operations import VirtualMachineExtensionsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import VirtualMachineExtensionsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'virtual_machine_extensions'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -722,6 +821,7 @@ def virtual_machine_images(self): * 2019-03-01: :class:`VirtualMachineImagesOperations` * 2019-07-01: :class:`VirtualMachineImagesOperations` * 2019-12-01: :class:`VirtualMachineImagesOperations` + * 2020-06-01: :class:`VirtualMachineImagesOperations` """ api_version = self._get_api_version('virtual_machine_images') if api_version == '2015-06-15': @@ -746,8 +846,10 @@ def virtual_machine_images(self): from .v2019_07_01.operations import VirtualMachineImagesOperations as OperationClass elif api_version == '2019-12-01': from .v2019_12_01.operations import VirtualMachineImagesOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import VirtualMachineImagesOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'virtual_machine_images'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -762,6 +864,7 @@ def virtual_machine_run_commands(self): * 2019-03-01: :class:`VirtualMachineRunCommandsOperations` * 2019-07-01: :class:`VirtualMachineRunCommandsOperations` * 2019-12-01: :class:`VirtualMachineRunCommandsOperations` + * 2020-06-01: :class:`VirtualMachineRunCommandsOperations` """ api_version = self._get_api_version('virtual_machine_run_commands') if api_version == '2017-03-30': @@ -780,8 +883,10 @@ def virtual_machine_run_commands(self): from .v2019_07_01.operations import VirtualMachineRunCommandsOperations as OperationClass elif api_version == '2019-12-01': from .v2019_12_01.operations import VirtualMachineRunCommandsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import VirtualMachineRunCommandsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'virtual_machine_run_commands'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -796,6 +901,7 @@ def virtual_machine_scale_set_extensions(self): * 2019-03-01: :class:`VirtualMachineScaleSetExtensionsOperations` * 2019-07-01: :class:`VirtualMachineScaleSetExtensionsOperations` * 2019-12-01: :class:`VirtualMachineScaleSetExtensionsOperations` + * 2020-06-01: :class:`VirtualMachineScaleSetExtensionsOperations` """ api_version = self._get_api_version('virtual_machine_scale_set_extensions') if api_version == '2017-03-30': @@ -814,8 +920,10 @@ def virtual_machine_scale_set_extensions(self): from .v2019_07_01.operations import VirtualMachineScaleSetExtensionsOperations as OperationClass elif api_version == '2019-12-01': from .v2019_12_01.operations import VirtualMachineScaleSetExtensionsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import VirtualMachineScaleSetExtensionsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'virtual_machine_scale_set_extensions'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -830,6 +938,7 @@ def virtual_machine_scale_set_rolling_upgrades(self): * 2019-03-01: :class:`VirtualMachineScaleSetRollingUpgradesOperations` * 2019-07-01: :class:`VirtualMachineScaleSetRollingUpgradesOperations` * 2019-12-01: :class:`VirtualMachineScaleSetRollingUpgradesOperations` + * 2020-06-01: :class:`VirtualMachineScaleSetRollingUpgradesOperations` """ api_version = self._get_api_version('virtual_machine_scale_set_rolling_upgrades') if api_version == '2017-03-30': @@ -848,8 +957,10 @@ def virtual_machine_scale_set_rolling_upgrades(self): from .v2019_07_01.operations import VirtualMachineScaleSetRollingUpgradesOperations as OperationClass elif api_version == '2019-12-01': from .v2019_12_01.operations import VirtualMachineScaleSetRollingUpgradesOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import VirtualMachineScaleSetRollingUpgradesOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'virtual_machine_scale_set_rolling_upgrades'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -858,14 +969,17 @@ def virtual_machine_scale_set_vm_extensions(self): * 2019-07-01: :class:`VirtualMachineScaleSetVMExtensionsOperations` * 2019-12-01: :class:`VirtualMachineScaleSetVMExtensionsOperations` + * 2020-06-01: :class:`VirtualMachineScaleSetVMExtensionsOperations` """ api_version = self._get_api_version('virtual_machine_scale_set_vm_extensions') if api_version == '2019-07-01': from .v2019_07_01.operations import VirtualMachineScaleSetVMExtensionsOperations as OperationClass elif api_version == '2019-12-01': from .v2019_12_01.operations import VirtualMachineScaleSetVMExtensionsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import VirtualMachineScaleSetVMExtensionsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'virtual_machine_scale_set_vm_extensions'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -883,6 +997,7 @@ def virtual_machine_scale_set_vms(self): * 2019-03-01: :class:`VirtualMachineScaleSetVMsOperations` * 2019-07-01: :class:`VirtualMachineScaleSetVMsOperations` * 2019-12-01: :class:`VirtualMachineScaleSetVMsOperations` + * 2020-06-01: :class:`VirtualMachineScaleSetVMsOperations` """ api_version = self._get_api_version('virtual_machine_scale_set_vms') if api_version == '2015-06-15': @@ -907,8 +1022,10 @@ def virtual_machine_scale_set_vms(self): from .v2019_07_01.operations import VirtualMachineScaleSetVMsOperations as OperationClass elif api_version == '2019-12-01': from .v2019_12_01.operations import VirtualMachineScaleSetVMsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import VirtualMachineScaleSetVMsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'virtual_machine_scale_set_vms'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -926,6 +1043,7 @@ def virtual_machine_scale_sets(self): * 2019-03-01: :class:`VirtualMachineScaleSetsOperations` * 2019-07-01: :class:`VirtualMachineScaleSetsOperations` * 2019-12-01: :class:`VirtualMachineScaleSetsOperations` + * 2020-06-01: :class:`VirtualMachineScaleSetsOperations` """ api_version = self._get_api_version('virtual_machine_scale_sets') if api_version == '2015-06-15': @@ -950,8 +1068,10 @@ def virtual_machine_scale_sets(self): from .v2019_07_01.operations import VirtualMachineScaleSetsOperations as OperationClass elif api_version == '2019-12-01': from .v2019_12_01.operations import VirtualMachineScaleSetsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import VirtualMachineScaleSetsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'virtual_machine_scale_sets'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -969,6 +1089,7 @@ def virtual_machine_sizes(self): * 2019-03-01: :class:`VirtualMachineSizesOperations` * 2019-07-01: :class:`VirtualMachineSizesOperations` * 2019-12-01: :class:`VirtualMachineSizesOperations` + * 2020-06-01: :class:`VirtualMachineSizesOperations` """ api_version = self._get_api_version('virtual_machine_sizes') if api_version == '2015-06-15': @@ -993,8 +1114,10 @@ def virtual_machine_sizes(self): from .v2019_07_01.operations import VirtualMachineSizesOperations as OperationClass elif api_version == '2019-12-01': from .v2019_12_01.operations import VirtualMachineSizesOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import VirtualMachineSizesOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'virtual_machine_sizes'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -1012,6 +1135,7 @@ def virtual_machines(self): * 2019-03-01: :class:`VirtualMachinesOperations` * 2019-07-01: :class:`VirtualMachinesOperations` * 2019-12-01: :class:`VirtualMachinesOperations` + * 2020-06-01: :class:`VirtualMachinesOperations` """ api_version = self._get_api_version('virtual_machines') if api_version == '2015-06-15': @@ -1036,8 +1160,10 @@ def virtual_machines(self): from .v2019_07_01.operations import VirtualMachinesOperations as OperationClass elif api_version == '2019-12-01': from .v2019_12_01.operations import VirtualMachinesOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import VirtualMachinesOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'virtual_machines'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) def close(self): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_configuration.py index 486ef89ea33d..34181f32183e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_configuration.py @@ -12,6 +12,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy from ._version import VERSION @@ -43,8 +44,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'azure-mgmt-compute/{}'.format(VERSION)) self._configure(**kwargs) @@ -57,6 +57,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_version.py index 38de083f35b3..b039214e161b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_version.py @@ -5,4 +5,4 @@ # license information. # -------------------------------------------------------------------------- -VERSION = "17.0.0b1" \ No newline at end of file +VERSION = "17.0.0" \ No newline at end of file diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/aio/__init__.py index c8a8b4817269..9e9459635989 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._compute_management_client_async import ComputeManagementClient +from ._compute_management_client import ComputeManagementClient __all__ = ['ComputeManagementClient'] 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 new file mode 100644 index 000000000000..92bed291f49f --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/aio/_compute_management_client.py @@ -0,0 +1,1175 @@ +# 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 azure.mgmt.core import AsyncARMPipelineClient +from msrest import Serializer, Deserializer + +from azure.profiles import KnownProfiles, ProfileDefinition +from azure.profiles.multiapiclient import MultiApiClientMixin +from ._configuration import ComputeManagementClientConfiguration + +class _SDKClient(object): + def __init__(self, *args, **kwargs): + """This is a fake class to support current implemetation of MultiApiClientMixin." + Will be removed in final version of multiapi azure-core based client + """ + pass + +class ComputeManagementClient(MultiApiClientMixin, _SDKClient): + """Compute Client. + + This ready contains multiple API versions, to help you deal with all of the Azure clouds + (Azure Stack, Azure Government, Azure China, etc.). + By default, it uses the latest API version available on public Azure. + For production, you should stick to a particular api-version and/or profile. + The profile sets a mapping between an operation group and its API version. + The api-version parameter sets the default API version if the operation + group is not described in the profile. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + :param str api_version: API version to use if no profile is provided, or if + missing in profile. + :param str base_url: Service URL + :param profile: A profile definition, from KnownProfiles to dict. + :type profile: azure.profiles.KnownProfiles + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + DEFAULT_API_VERSION = '2020-06-30' + _PROFILE_TAG = "azure.mgmt.compute.ComputeManagementClient" + LATEST_PROFILE = ProfileDefinition({ + _PROFILE_TAG: { + None: DEFAULT_API_VERSION, + 'availability_sets': '2020-06-01', + 'dedicated_host_groups': '2020-06-01', + 'dedicated_hosts': '2020-06-01', + 'galleries': '2019-12-01', + 'gallery_application_versions': '2019-12-01', + 'gallery_applications': '2019-12-01', + 'gallery_image_versions': '2019-12-01', + 'gallery_images': '2019-12-01', + 'images': '2020-06-01', + 'log_analytics': '2020-06-01', + 'operations': '2020-06-01', + 'proximity_placement_groups': '2020-06-01', + 'resource_skus': '2019-04-01', + 'ssh_public_keys': '2020-06-01', + 'usage': '2020-06-01', + 'virtual_machine_extension_images': '2020-06-01', + 'virtual_machine_extensions': '2020-06-01', + 'virtual_machine_images': '2020-06-01', + 'virtual_machine_run_commands': '2020-06-01', + 'virtual_machine_scale_set_extensions': '2020-06-01', + 'virtual_machine_scale_set_rolling_upgrades': '2020-06-01', + 'virtual_machine_scale_set_vm_extensions': '2020-06-01', + 'virtual_machine_scale_set_vms': '2020-06-01', + 'virtual_machine_scale_sets': '2020-06-01', + 'virtual_machine_sizes': '2020-06-01', + 'virtual_machines': '2020-06-01', + }}, + _PROFILE_TAG + " latest" + ) + + def __init__( + self, + credential, # type: "AsyncTokenCredential" + subscription_id, # type: str + api_version=None, + base_url=None, + profile=KnownProfiles.default, + **kwargs # type: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = ComputeManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + super(ComputeManagementClient, self).__init__( + api_version=api_version, + profile=profile + ) + + @classmethod + def _models_dict(cls, api_version): + return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)} + + @classmethod + def models(cls, api_version=DEFAULT_API_VERSION): + """Module depends on the API version: + + * 2015-06-15: :mod:`v2015_06_15.models` + * 2016-03-30: :mod:`v2016_03_30.models` + * 2016-04-30-preview: :mod:`v2016_04_30_preview.models` + * 2017-03-30: :mod:`v2017_03_30.models` + * 2017-09-01: :mod:`v2017_09_01.models` + * 2017-12-01: :mod:`v2017_12_01.models` + * 2018-04-01: :mod:`v2018_04_01.models` + * 2018-06-01: :mod:`v2018_06_01.models` + * 2018-09-30: :mod:`v2018_09_30.models` + * 2018-10-01: :mod:`v2018_10_01.models` + * 2019-03-01: :mod:`v2019_03_01.models` + * 2019-04-01: :mod:`v2019_04_01.models` + * 2019-07-01: :mod:`v2019_07_01.models` + * 2019-11-01: :mod:`v2019_11_01.models` + * 2019-12-01: :mod:`v2019_12_01.models` + * 2020-05-01: :mod:`v2020_05_01.models` + * 2020-06-01: :mod:`v2020_06_01.models` + * 2020-06-30: :mod:`v2020_06_30.models` + """ + if api_version == '2015-06-15': + from ..v2015_06_15 import models + return models + elif api_version == '2016-03-30': + from ..v2016_03_30 import models + return models + elif api_version == '2016-04-30-preview': + from ..v2016_04_30_preview import models + return models + elif api_version == '2017-03-30': + from ..v2017_03_30 import models + return models + elif api_version == '2017-09-01': + from ..v2017_09_01 import models + return models + elif api_version == '2017-12-01': + from ..v2017_12_01 import models + return models + elif api_version == '2018-04-01': + from ..v2018_04_01 import models + return models + elif api_version == '2018-06-01': + from ..v2018_06_01 import models + return models + elif api_version == '2018-09-30': + from ..v2018_09_30 import models + return models + elif api_version == '2018-10-01': + from ..v2018_10_01 import models + return models + elif api_version == '2019-03-01': + from ..v2019_03_01 import models + return models + elif api_version == '2019-04-01': + from ..v2019_04_01 import models + return models + elif api_version == '2019-07-01': + from ..v2019_07_01 import models + return models + elif api_version == '2019-11-01': + from ..v2019_11_01 import models + return models + elif api_version == '2019-12-01': + from ..v2019_12_01 import models + return models + elif api_version == '2020-05-01': + from ..v2020_05_01 import models + return models + elif api_version == '2020-06-01': + from ..v2020_06_01 import models + return models + elif api_version == '2020-06-30': + from ..v2020_06_30 import models + return models + raise ValueError("API version {} is not available".format(api_version)) + + @property + def availability_sets(self): + """Instance depends on the API version: + + * 2015-06-15: :class:`AvailabilitySetsOperations` + * 2016-03-30: :class:`AvailabilitySetsOperations` + * 2016-04-30-preview: :class:`AvailabilitySetsOperations` + * 2017-03-30: :class:`AvailabilitySetsOperations` + * 2017-12-01: :class:`AvailabilitySetsOperations` + * 2018-04-01: :class:`AvailabilitySetsOperations` + * 2018-06-01: :class:`AvailabilitySetsOperations` + * 2018-10-01: :class:`AvailabilitySetsOperations` + * 2019-03-01: :class:`AvailabilitySetsOperations` + * 2019-07-01: :class:`AvailabilitySetsOperations` + * 2019-12-01: :class:`AvailabilitySetsOperations` + * 2020-06-01: :class:`AvailabilitySetsOperations` + """ + api_version = self._get_api_version('availability_sets') + if api_version == '2015-06-15': + from ..v2015_06_15.aio.operations import AvailabilitySetsOperations as OperationClass + elif api_version == '2016-03-30': + from ..v2016_03_30.aio.operations import AvailabilitySetsOperations as OperationClass + elif api_version == '2016-04-30-preview': + from ..v2016_04_30_preview.aio.operations import AvailabilitySetsOperations as OperationClass + elif api_version == '2017-03-30': + from ..v2017_03_30.aio.operations import AvailabilitySetsOperations as OperationClass + elif api_version == '2017-12-01': + from ..v2017_12_01.aio.operations import AvailabilitySetsOperations as OperationClass + elif api_version == '2018-04-01': + from ..v2018_04_01.aio.operations import AvailabilitySetsOperations as OperationClass + elif api_version == '2018-06-01': + from ..v2018_06_01.aio.operations import AvailabilitySetsOperations as OperationClass + elif api_version == '2018-10-01': + from ..v2018_10_01.aio.operations import AvailabilitySetsOperations as OperationClass + elif api_version == '2019-03-01': + from ..v2019_03_01.aio.operations import AvailabilitySetsOperations as OperationClass + elif api_version == '2019-07-01': + from ..v2019_07_01.aio.operations import AvailabilitySetsOperations as OperationClass + elif api_version == '2019-12-01': + from ..v2019_12_01.aio.operations import AvailabilitySetsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import AvailabilitySetsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'availability_sets'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def dedicated_host_groups(self): + """Instance depends on the API version: + + * 2019-03-01: :class:`DedicatedHostGroupsOperations` + * 2019-07-01: :class:`DedicatedHostGroupsOperations` + * 2019-12-01: :class:`DedicatedHostGroupsOperations` + * 2020-06-01: :class:`DedicatedHostGroupsOperations` + """ + api_version = self._get_api_version('dedicated_host_groups') + if api_version == '2019-03-01': + from ..v2019_03_01.aio.operations import DedicatedHostGroupsOperations as OperationClass + elif api_version == '2019-07-01': + from ..v2019_07_01.aio.operations import DedicatedHostGroupsOperations as OperationClass + elif api_version == '2019-12-01': + from ..v2019_12_01.aio.operations import DedicatedHostGroupsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import DedicatedHostGroupsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'dedicated_host_groups'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def dedicated_hosts(self): + """Instance depends on the API version: + + * 2019-03-01: :class:`DedicatedHostsOperations` + * 2019-07-01: :class:`DedicatedHostsOperations` + * 2019-12-01: :class:`DedicatedHostsOperations` + * 2020-06-01: :class:`DedicatedHostsOperations` + """ + api_version = self._get_api_version('dedicated_hosts') + if api_version == '2019-03-01': + from ..v2019_03_01.aio.operations import DedicatedHostsOperations as OperationClass + elif api_version == '2019-07-01': + from ..v2019_07_01.aio.operations import DedicatedHostsOperations as OperationClass + elif api_version == '2019-12-01': + from ..v2019_12_01.aio.operations import DedicatedHostsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import DedicatedHostsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'dedicated_hosts'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def disk_accesses(self): + """Instance depends on the API version: + + * 2020-05-01: :class:`DiskAccessesOperations` + * 2020-06-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 + 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))) + + @property + def disk_encryption_sets(self): + """Instance depends on the API version: + + * 2019-07-01: :class:`DiskEncryptionSetsOperations` + * 2019-11-01: :class:`DiskEncryptionSetsOperations` + * 2020-05-01: :class:`DiskEncryptionSetsOperations` + * 2020-06-30: :class:`DiskEncryptionSetsOperations` + """ + api_version = self._get_api_version('disk_encryption_sets') + if api_version == '2019-07-01': + from ..v2019_07_01.aio.operations import DiskEncryptionSetsOperations as OperationClass + elif api_version == '2019-11-01': + from ..v2019_11_01.aio.operations import DiskEncryptionSetsOperations as OperationClass + elif api_version == '2020-05-01': + 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 + 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 disks(self): + """Instance depends on the API version: + + * 2016-04-30-preview: :class:`DisksOperations` + * 2017-03-30: :class:`DisksOperations` + * 2018-04-01: :class:`DisksOperations` + * 2018-06-01: :class:`DisksOperations` + * 2018-09-30: :class:`DisksOperations` + * 2019-03-01: :class:`DisksOperations` + * 2019-07-01: :class:`DisksOperations` + * 2019-11-01: :class:`DisksOperations` + * 2020-05-01: :class:`DisksOperations` + * 2020-06-30: :class:`DisksOperations` + """ + api_version = self._get_api_version('disks') + if api_version == '2016-04-30-preview': + from ..v2016_04_30_preview.aio.operations import DisksOperations as OperationClass + elif api_version == '2017-03-30': + from ..v2017_03_30.aio.operations import DisksOperations as OperationClass + elif api_version == '2018-04-01': + from ..v2018_04_01.aio.operations import DisksOperations as OperationClass + elif api_version == '2018-06-01': + from ..v2018_06_01.aio.operations import DisksOperations as OperationClass + elif api_version == '2018-09-30': + from ..v2018_09_30.aio.operations import DisksOperations as OperationClass + elif api_version == '2019-03-01': + from ..v2019_03_01.aio.operations import DisksOperations as OperationClass + elif api_version == '2019-07-01': + from ..v2019_07_01.aio.operations import DisksOperations as OperationClass + elif api_version == '2019-11-01': + from ..v2019_11_01.aio.operations import DisksOperations as OperationClass + elif api_version == '2020-05-01': + 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 + 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))) + + @property + def galleries(self): + """Instance depends on the API version: + + * 2018-06-01: :class:`GalleriesOperations` + * 2019-03-01: :class:`GalleriesOperations` + * 2019-07-01: :class:`GalleriesOperations` + * 2019-12-01: :class:`GalleriesOperations` + """ + api_version = self._get_api_version('galleries') + if api_version == '2018-06-01': + from ..v2018_06_01.aio.operations import GalleriesOperations as OperationClass + elif api_version == '2019-03-01': + from ..v2019_03_01.aio.operations import GalleriesOperations as OperationClass + elif api_version == '2019-07-01': + from ..v2019_07_01.aio.operations import GalleriesOperations as OperationClass + elif api_version == '2019-12-01': + from ..v2019_12_01.aio.operations import GalleriesOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'galleries'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def gallery_application_versions(self): + """Instance depends on the API version: + + * 2019-03-01: :class:`GalleryApplicationVersionsOperations` + * 2019-07-01: :class:`GalleryApplicationVersionsOperations` + * 2019-12-01: :class:`GalleryApplicationVersionsOperations` + """ + api_version = self._get_api_version('gallery_application_versions') + if api_version == '2019-03-01': + from ..v2019_03_01.aio.operations import GalleryApplicationVersionsOperations as OperationClass + elif api_version == '2019-07-01': + from ..v2019_07_01.aio.operations import GalleryApplicationVersionsOperations as OperationClass + elif api_version == '2019-12-01': + from ..v2019_12_01.aio.operations import GalleryApplicationVersionsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'gallery_application_versions'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def gallery_applications(self): + """Instance depends on the API version: + + * 2019-03-01: :class:`GalleryApplicationsOperations` + * 2019-07-01: :class:`GalleryApplicationsOperations` + * 2019-12-01: :class:`GalleryApplicationsOperations` + """ + api_version = self._get_api_version('gallery_applications') + if api_version == '2019-03-01': + from ..v2019_03_01.aio.operations import GalleryApplicationsOperations as OperationClass + elif api_version == '2019-07-01': + from ..v2019_07_01.aio.operations import GalleryApplicationsOperations as OperationClass + elif api_version == '2019-12-01': + from ..v2019_12_01.aio.operations import GalleryApplicationsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'gallery_applications'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def gallery_image_versions(self): + """Instance depends on the API version: + + * 2018-06-01: :class:`GalleryImageVersionsOperations` + * 2019-03-01: :class:`GalleryImageVersionsOperations` + * 2019-07-01: :class:`GalleryImageVersionsOperations` + * 2019-12-01: :class:`GalleryImageVersionsOperations` + """ + api_version = self._get_api_version('gallery_image_versions') + if api_version == '2018-06-01': + from ..v2018_06_01.aio.operations import GalleryImageVersionsOperations as OperationClass + elif api_version == '2019-03-01': + from ..v2019_03_01.aio.operations import GalleryImageVersionsOperations as OperationClass + elif api_version == '2019-07-01': + from ..v2019_07_01.aio.operations import GalleryImageVersionsOperations as OperationClass + elif api_version == '2019-12-01': + from ..v2019_12_01.aio.operations import GalleryImageVersionsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'gallery_image_versions'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def gallery_images(self): + """Instance depends on the API version: + + * 2018-06-01: :class:`GalleryImagesOperations` + * 2019-03-01: :class:`GalleryImagesOperations` + * 2019-07-01: :class:`GalleryImagesOperations` + * 2019-12-01: :class:`GalleryImagesOperations` + """ + api_version = self._get_api_version('gallery_images') + if api_version == '2018-06-01': + from ..v2018_06_01.aio.operations import GalleryImagesOperations as OperationClass + elif api_version == '2019-03-01': + from ..v2019_03_01.aio.operations import GalleryImagesOperations as OperationClass + elif api_version == '2019-07-01': + from ..v2019_07_01.aio.operations import GalleryImagesOperations as OperationClass + elif api_version == '2019-12-01': + from ..v2019_12_01.aio.operations import GalleryImagesOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'gallery_images'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def images(self): + """Instance depends on the API version: + + * 2016-04-30-preview: :class:`ImagesOperations` + * 2017-03-30: :class:`ImagesOperations` + * 2017-12-01: :class:`ImagesOperations` + * 2018-04-01: :class:`ImagesOperations` + * 2018-06-01: :class:`ImagesOperations` + * 2018-10-01: :class:`ImagesOperations` + * 2019-03-01: :class:`ImagesOperations` + * 2019-07-01: :class:`ImagesOperations` + * 2019-12-01: :class:`ImagesOperations` + * 2020-06-01: :class:`ImagesOperations` + """ + api_version = self._get_api_version('images') + if api_version == '2016-04-30-preview': + from ..v2016_04_30_preview.aio.operations import ImagesOperations as OperationClass + elif api_version == '2017-03-30': + from ..v2017_03_30.aio.operations import ImagesOperations as OperationClass + elif api_version == '2017-12-01': + from ..v2017_12_01.aio.operations import ImagesOperations as OperationClass + elif api_version == '2018-04-01': + from ..v2018_04_01.aio.operations import ImagesOperations as OperationClass + elif api_version == '2018-06-01': + from ..v2018_06_01.aio.operations import ImagesOperations as OperationClass + elif api_version == '2018-10-01': + from ..v2018_10_01.aio.operations import ImagesOperations as OperationClass + elif api_version == '2019-03-01': + from ..v2019_03_01.aio.operations import ImagesOperations as OperationClass + elif api_version == '2019-07-01': + from ..v2019_07_01.aio.operations import ImagesOperations as OperationClass + elif api_version == '2019-12-01': + from ..v2019_12_01.aio.operations import ImagesOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import ImagesOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'images'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def log_analytics(self): + """Instance depends on the API version: + + * 2017-12-01: :class:`LogAnalyticsOperations` + * 2018-04-01: :class:`LogAnalyticsOperations` + * 2018-06-01: :class:`LogAnalyticsOperations` + * 2018-10-01: :class:`LogAnalyticsOperations` + * 2019-03-01: :class:`LogAnalyticsOperations` + * 2019-07-01: :class:`LogAnalyticsOperations` + * 2019-12-01: :class:`LogAnalyticsOperations` + * 2020-06-01: :class:`LogAnalyticsOperations` + """ + api_version = self._get_api_version('log_analytics') + if api_version == '2017-12-01': + from ..v2017_12_01.aio.operations import LogAnalyticsOperations as OperationClass + elif api_version == '2018-04-01': + from ..v2018_04_01.aio.operations import LogAnalyticsOperations as OperationClass + elif api_version == '2018-06-01': + from ..v2018_06_01.aio.operations import LogAnalyticsOperations as OperationClass + elif api_version == '2018-10-01': + from ..v2018_10_01.aio.operations import LogAnalyticsOperations as OperationClass + elif api_version == '2019-03-01': + from ..v2019_03_01.aio.operations import LogAnalyticsOperations as OperationClass + elif api_version == '2019-07-01': + from ..v2019_07_01.aio.operations import LogAnalyticsOperations as OperationClass + elif api_version == '2019-12-01': + from ..v2019_12_01.aio.operations import LogAnalyticsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import LogAnalyticsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'log_analytics'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def operations(self): + """Instance depends on the API version: + + * 2017-12-01: :class:`Operations` + * 2018-04-01: :class:`Operations` + * 2018-06-01: :class:`Operations` + * 2018-10-01: :class:`Operations` + * 2019-03-01: :class:`Operations` + * 2019-07-01: :class:`Operations` + * 2019-12-01: :class:`Operations` + * 2020-06-01: :class:`Operations` + """ + api_version = self._get_api_version('operations') + if api_version == '2017-12-01': + from ..v2017_12_01.aio.operations import Operations as OperationClass + elif api_version == '2018-04-01': + from ..v2018_04_01.aio.operations import Operations as OperationClass + elif api_version == '2018-06-01': + from ..v2018_06_01.aio.operations import Operations as OperationClass + elif api_version == '2018-10-01': + from ..v2018_10_01.aio.operations import Operations as OperationClass + elif api_version == '2019-03-01': + from ..v2019_03_01.aio.operations import Operations as OperationClass + elif api_version == '2019-07-01': + from ..v2019_07_01.aio.operations import Operations as OperationClass + elif api_version == '2019-12-01': + from ..v2019_12_01.aio.operations import Operations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import Operations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def proximity_placement_groups(self): + """Instance depends on the API version: + + * 2018-04-01: :class:`ProximityPlacementGroupsOperations` + * 2018-06-01: :class:`ProximityPlacementGroupsOperations` + * 2018-10-01: :class:`ProximityPlacementGroupsOperations` + * 2019-03-01: :class:`ProximityPlacementGroupsOperations` + * 2019-07-01: :class:`ProximityPlacementGroupsOperations` + * 2019-12-01: :class:`ProximityPlacementGroupsOperations` + * 2020-06-01: :class:`ProximityPlacementGroupsOperations` + """ + api_version = self._get_api_version('proximity_placement_groups') + if api_version == '2018-04-01': + from ..v2018_04_01.aio.operations import ProximityPlacementGroupsOperations as OperationClass + elif api_version == '2018-06-01': + from ..v2018_06_01.aio.operations import ProximityPlacementGroupsOperations as OperationClass + elif api_version == '2018-10-01': + from ..v2018_10_01.aio.operations import ProximityPlacementGroupsOperations as OperationClass + elif api_version == '2019-03-01': + from ..v2019_03_01.aio.operations import ProximityPlacementGroupsOperations as OperationClass + elif api_version == '2019-07-01': + from ..v2019_07_01.aio.operations import ProximityPlacementGroupsOperations as OperationClass + elif api_version == '2019-12-01': + from ..v2019_12_01.aio.operations import ProximityPlacementGroupsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import ProximityPlacementGroupsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'proximity_placement_groups'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def resource_skus(self): + """Instance depends on the API version: + + * 2017-03-30: :class:`ResourceSkusOperations` + * 2017-09-01: :class:`ResourceSkusOperations` + * 2019-04-01: :class:`ResourceSkusOperations` + """ + api_version = self._get_api_version('resource_skus') + if api_version == '2017-03-30': + from ..v2017_03_30.aio.operations import ResourceSkusOperations as OperationClass + elif api_version == '2017-09-01': + from ..v2017_09_01.aio.operations import ResourceSkusOperations as OperationClass + elif api_version == '2019-04-01': + from ..v2019_04_01.aio.operations import ResourceSkusOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'resource_skus'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def snapshots(self): + """Instance depends on the API version: + + * 2016-04-30-preview: :class:`SnapshotsOperations` + * 2017-03-30: :class:`SnapshotsOperations` + * 2018-04-01: :class:`SnapshotsOperations` + * 2018-06-01: :class:`SnapshotsOperations` + * 2018-09-30: :class:`SnapshotsOperations` + * 2019-03-01: :class:`SnapshotsOperations` + * 2019-07-01: :class:`SnapshotsOperations` + * 2019-11-01: :class:`SnapshotsOperations` + * 2020-05-01: :class:`SnapshotsOperations` + * 2020-06-30: :class:`SnapshotsOperations` + """ + api_version = self._get_api_version('snapshots') + if api_version == '2016-04-30-preview': + from ..v2016_04_30_preview.aio.operations import SnapshotsOperations as OperationClass + elif api_version == '2017-03-30': + from ..v2017_03_30.aio.operations import SnapshotsOperations as OperationClass + elif api_version == '2018-04-01': + from ..v2018_04_01.aio.operations import SnapshotsOperations as OperationClass + elif api_version == '2018-06-01': + from ..v2018_06_01.aio.operations import SnapshotsOperations as OperationClass + elif api_version == '2018-09-30': + from ..v2018_09_30.aio.operations import SnapshotsOperations as OperationClass + elif api_version == '2019-03-01': + from ..v2019_03_01.aio.operations import SnapshotsOperations as OperationClass + elif api_version == '2019-07-01': + from ..v2019_07_01.aio.operations import SnapshotsOperations as OperationClass + elif api_version == '2019-11-01': + from ..v2019_11_01.aio.operations import SnapshotsOperations as OperationClass + elif api_version == '2020-05-01': + 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 + 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))) + + @property + def ssh_public_keys(self): + """Instance depends on the API version: + + * 2019-12-01: :class:`SshPublicKeysOperations` + * 2020-06-01: :class:`SshPublicKeysOperations` + """ + api_version = self._get_api_version('ssh_public_keys') + if api_version == '2019-12-01': + from ..v2019_12_01.aio.operations import SshPublicKeysOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import SshPublicKeysOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'ssh_public_keys'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def usage(self): + """Instance depends on the API version: + + * 2015-06-15: :class:`UsageOperations` + * 2016-03-30: :class:`UsageOperations` + * 2016-04-30-preview: :class:`UsageOperations` + * 2017-03-30: :class:`UsageOperations` + * 2017-12-01: :class:`UsageOperations` + * 2018-04-01: :class:`UsageOperations` + * 2018-06-01: :class:`UsageOperations` + * 2018-10-01: :class:`UsageOperations` + * 2019-03-01: :class:`UsageOperations` + * 2019-07-01: :class:`UsageOperations` + * 2019-12-01: :class:`UsageOperations` + * 2020-06-01: :class:`UsageOperations` + """ + api_version = self._get_api_version('usage') + if api_version == '2015-06-15': + from ..v2015_06_15.aio.operations import UsageOperations as OperationClass + elif api_version == '2016-03-30': + from ..v2016_03_30.aio.operations import UsageOperations as OperationClass + elif api_version == '2016-04-30-preview': + from ..v2016_04_30_preview.aio.operations import UsageOperations as OperationClass + elif api_version == '2017-03-30': + from ..v2017_03_30.aio.operations import UsageOperations as OperationClass + elif api_version == '2017-12-01': + from ..v2017_12_01.aio.operations import UsageOperations as OperationClass + elif api_version == '2018-04-01': + from ..v2018_04_01.aio.operations import UsageOperations as OperationClass + elif api_version == '2018-06-01': + from ..v2018_06_01.aio.operations import UsageOperations as OperationClass + elif api_version == '2018-10-01': + from ..v2018_10_01.aio.operations import UsageOperations as OperationClass + elif api_version == '2019-03-01': + from ..v2019_03_01.aio.operations import UsageOperations as OperationClass + elif api_version == '2019-07-01': + from ..v2019_07_01.aio.operations import UsageOperations as OperationClass + elif api_version == '2019-12-01': + from ..v2019_12_01.aio.operations import UsageOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import UsageOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'usage'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def virtual_machine_extension_images(self): + """Instance depends on the API version: + + * 2015-06-15: :class:`VirtualMachineExtensionImagesOperations` + * 2016-03-30: :class:`VirtualMachineExtensionImagesOperations` + * 2016-04-30-preview: :class:`VirtualMachineExtensionImagesOperations` + * 2017-03-30: :class:`VirtualMachineExtensionImagesOperations` + * 2017-12-01: :class:`VirtualMachineExtensionImagesOperations` + * 2018-04-01: :class:`VirtualMachineExtensionImagesOperations` + * 2018-06-01: :class:`VirtualMachineExtensionImagesOperations` + * 2018-10-01: :class:`VirtualMachineExtensionImagesOperations` + * 2019-03-01: :class:`VirtualMachineExtensionImagesOperations` + * 2019-07-01: :class:`VirtualMachineExtensionImagesOperations` + * 2019-12-01: :class:`VirtualMachineExtensionImagesOperations` + * 2020-06-01: :class:`VirtualMachineExtensionImagesOperations` + """ + api_version = self._get_api_version('virtual_machine_extension_images') + if api_version == '2015-06-15': + from ..v2015_06_15.aio.operations import VirtualMachineExtensionImagesOperations as OperationClass + elif api_version == '2016-03-30': + from ..v2016_03_30.aio.operations import VirtualMachineExtensionImagesOperations as OperationClass + elif api_version == '2016-04-30-preview': + from ..v2016_04_30_preview.aio.operations import VirtualMachineExtensionImagesOperations as OperationClass + elif api_version == '2017-03-30': + from ..v2017_03_30.aio.operations import VirtualMachineExtensionImagesOperations as OperationClass + elif api_version == '2017-12-01': + from ..v2017_12_01.aio.operations import VirtualMachineExtensionImagesOperations as OperationClass + elif api_version == '2018-04-01': + from ..v2018_04_01.aio.operations import VirtualMachineExtensionImagesOperations as OperationClass + elif api_version == '2018-06-01': + from ..v2018_06_01.aio.operations import VirtualMachineExtensionImagesOperations as OperationClass + elif api_version == '2018-10-01': + from ..v2018_10_01.aio.operations import VirtualMachineExtensionImagesOperations as OperationClass + elif api_version == '2019-03-01': + from ..v2019_03_01.aio.operations import VirtualMachineExtensionImagesOperations as OperationClass + elif api_version == '2019-07-01': + from ..v2019_07_01.aio.operations import VirtualMachineExtensionImagesOperations as OperationClass + elif api_version == '2019-12-01': + from ..v2019_12_01.aio.operations import VirtualMachineExtensionImagesOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import VirtualMachineExtensionImagesOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'virtual_machine_extension_images'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def virtual_machine_extensions(self): + """Instance depends on the API version: + + * 2015-06-15: :class:`VirtualMachineExtensionsOperations` + * 2016-03-30: :class:`VirtualMachineExtensionsOperations` + * 2016-04-30-preview: :class:`VirtualMachineExtensionsOperations` + * 2017-03-30: :class:`VirtualMachineExtensionsOperations` + * 2017-12-01: :class:`VirtualMachineExtensionsOperations` + * 2018-04-01: :class:`VirtualMachineExtensionsOperations` + * 2018-06-01: :class:`VirtualMachineExtensionsOperations` + * 2018-10-01: :class:`VirtualMachineExtensionsOperations` + * 2019-03-01: :class:`VirtualMachineExtensionsOperations` + * 2019-07-01: :class:`VirtualMachineExtensionsOperations` + * 2019-12-01: :class:`VirtualMachineExtensionsOperations` + * 2020-06-01: :class:`VirtualMachineExtensionsOperations` + """ + api_version = self._get_api_version('virtual_machine_extensions') + if api_version == '2015-06-15': + from ..v2015_06_15.aio.operations import VirtualMachineExtensionsOperations as OperationClass + elif api_version == '2016-03-30': + from ..v2016_03_30.aio.operations import VirtualMachineExtensionsOperations as OperationClass + elif api_version == '2016-04-30-preview': + from ..v2016_04_30_preview.aio.operations import VirtualMachineExtensionsOperations as OperationClass + elif api_version == '2017-03-30': + from ..v2017_03_30.aio.operations import VirtualMachineExtensionsOperations as OperationClass + elif api_version == '2017-12-01': + from ..v2017_12_01.aio.operations import VirtualMachineExtensionsOperations as OperationClass + elif api_version == '2018-04-01': + from ..v2018_04_01.aio.operations import VirtualMachineExtensionsOperations as OperationClass + elif api_version == '2018-06-01': + from ..v2018_06_01.aio.operations import VirtualMachineExtensionsOperations as OperationClass + elif api_version == '2018-10-01': + from ..v2018_10_01.aio.operations import VirtualMachineExtensionsOperations as OperationClass + elif api_version == '2019-03-01': + from ..v2019_03_01.aio.operations import VirtualMachineExtensionsOperations as OperationClass + elif api_version == '2019-07-01': + from ..v2019_07_01.aio.operations import VirtualMachineExtensionsOperations as OperationClass + elif api_version == '2019-12-01': + from ..v2019_12_01.aio.operations import VirtualMachineExtensionsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import VirtualMachineExtensionsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'virtual_machine_extensions'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def virtual_machine_images(self): + """Instance depends on the API version: + + * 2015-06-15: :class:`VirtualMachineImagesOperations` + * 2016-03-30: :class:`VirtualMachineImagesOperations` + * 2016-04-30-preview: :class:`VirtualMachineImagesOperations` + * 2017-03-30: :class:`VirtualMachineImagesOperations` + * 2017-12-01: :class:`VirtualMachineImagesOperations` + * 2018-04-01: :class:`VirtualMachineImagesOperations` + * 2018-06-01: :class:`VirtualMachineImagesOperations` + * 2018-10-01: :class:`VirtualMachineImagesOperations` + * 2019-03-01: :class:`VirtualMachineImagesOperations` + * 2019-07-01: :class:`VirtualMachineImagesOperations` + * 2019-12-01: :class:`VirtualMachineImagesOperations` + * 2020-06-01: :class:`VirtualMachineImagesOperations` + """ + api_version = self._get_api_version('virtual_machine_images') + if api_version == '2015-06-15': + from ..v2015_06_15.aio.operations import VirtualMachineImagesOperations as OperationClass + elif api_version == '2016-03-30': + from ..v2016_03_30.aio.operations import VirtualMachineImagesOperations as OperationClass + elif api_version == '2016-04-30-preview': + from ..v2016_04_30_preview.aio.operations import VirtualMachineImagesOperations as OperationClass + elif api_version == '2017-03-30': + from ..v2017_03_30.aio.operations import VirtualMachineImagesOperations as OperationClass + elif api_version == '2017-12-01': + from ..v2017_12_01.aio.operations import VirtualMachineImagesOperations as OperationClass + elif api_version == '2018-04-01': + from ..v2018_04_01.aio.operations import VirtualMachineImagesOperations as OperationClass + elif api_version == '2018-06-01': + from ..v2018_06_01.aio.operations import VirtualMachineImagesOperations as OperationClass + elif api_version == '2018-10-01': + from ..v2018_10_01.aio.operations import VirtualMachineImagesOperations as OperationClass + elif api_version == '2019-03-01': + from ..v2019_03_01.aio.operations import VirtualMachineImagesOperations as OperationClass + elif api_version == '2019-07-01': + from ..v2019_07_01.aio.operations import VirtualMachineImagesOperations as OperationClass + elif api_version == '2019-12-01': + from ..v2019_12_01.aio.operations import VirtualMachineImagesOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import VirtualMachineImagesOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'virtual_machine_images'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def virtual_machine_run_commands(self): + """Instance depends on the API version: + + * 2017-03-30: :class:`VirtualMachineRunCommandsOperations` + * 2017-12-01: :class:`VirtualMachineRunCommandsOperations` + * 2018-04-01: :class:`VirtualMachineRunCommandsOperations` + * 2018-06-01: :class:`VirtualMachineRunCommandsOperations` + * 2018-10-01: :class:`VirtualMachineRunCommandsOperations` + * 2019-03-01: :class:`VirtualMachineRunCommandsOperations` + * 2019-07-01: :class:`VirtualMachineRunCommandsOperations` + * 2019-12-01: :class:`VirtualMachineRunCommandsOperations` + * 2020-06-01: :class:`VirtualMachineRunCommandsOperations` + """ + api_version = self._get_api_version('virtual_machine_run_commands') + if api_version == '2017-03-30': + from ..v2017_03_30.aio.operations import VirtualMachineRunCommandsOperations as OperationClass + elif api_version == '2017-12-01': + from ..v2017_12_01.aio.operations import VirtualMachineRunCommandsOperations as OperationClass + elif api_version == '2018-04-01': + from ..v2018_04_01.aio.operations import VirtualMachineRunCommandsOperations as OperationClass + elif api_version == '2018-06-01': + from ..v2018_06_01.aio.operations import VirtualMachineRunCommandsOperations as OperationClass + elif api_version == '2018-10-01': + from ..v2018_10_01.aio.operations import VirtualMachineRunCommandsOperations as OperationClass + elif api_version == '2019-03-01': + from ..v2019_03_01.aio.operations import VirtualMachineRunCommandsOperations as OperationClass + elif api_version == '2019-07-01': + from ..v2019_07_01.aio.operations import VirtualMachineRunCommandsOperations as OperationClass + elif api_version == '2019-12-01': + from ..v2019_12_01.aio.operations import VirtualMachineRunCommandsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import VirtualMachineRunCommandsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'virtual_machine_run_commands'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def virtual_machine_scale_set_extensions(self): + """Instance depends on the API version: + + * 2017-03-30: :class:`VirtualMachineScaleSetExtensionsOperations` + * 2017-12-01: :class:`VirtualMachineScaleSetExtensionsOperations` + * 2018-04-01: :class:`VirtualMachineScaleSetExtensionsOperations` + * 2018-06-01: :class:`VirtualMachineScaleSetExtensionsOperations` + * 2018-10-01: :class:`VirtualMachineScaleSetExtensionsOperations` + * 2019-03-01: :class:`VirtualMachineScaleSetExtensionsOperations` + * 2019-07-01: :class:`VirtualMachineScaleSetExtensionsOperations` + * 2019-12-01: :class:`VirtualMachineScaleSetExtensionsOperations` + * 2020-06-01: :class:`VirtualMachineScaleSetExtensionsOperations` + """ + api_version = self._get_api_version('virtual_machine_scale_set_extensions') + if api_version == '2017-03-30': + from ..v2017_03_30.aio.operations import VirtualMachineScaleSetExtensionsOperations as OperationClass + elif api_version == '2017-12-01': + from ..v2017_12_01.aio.operations import VirtualMachineScaleSetExtensionsOperations as OperationClass + elif api_version == '2018-04-01': + from ..v2018_04_01.aio.operations import VirtualMachineScaleSetExtensionsOperations as OperationClass + elif api_version == '2018-06-01': + from ..v2018_06_01.aio.operations import VirtualMachineScaleSetExtensionsOperations as OperationClass + elif api_version == '2018-10-01': + from ..v2018_10_01.aio.operations import VirtualMachineScaleSetExtensionsOperations as OperationClass + elif api_version == '2019-03-01': + from ..v2019_03_01.aio.operations import VirtualMachineScaleSetExtensionsOperations as OperationClass + elif api_version == '2019-07-01': + from ..v2019_07_01.aio.operations import VirtualMachineScaleSetExtensionsOperations as OperationClass + elif api_version == '2019-12-01': + from ..v2019_12_01.aio.operations import VirtualMachineScaleSetExtensionsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import VirtualMachineScaleSetExtensionsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'virtual_machine_scale_set_extensions'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def virtual_machine_scale_set_rolling_upgrades(self): + """Instance depends on the API version: + + * 2017-03-30: :class:`VirtualMachineScaleSetRollingUpgradesOperations` + * 2017-12-01: :class:`VirtualMachineScaleSetRollingUpgradesOperations` + * 2018-04-01: :class:`VirtualMachineScaleSetRollingUpgradesOperations` + * 2018-06-01: :class:`VirtualMachineScaleSetRollingUpgradesOperations` + * 2018-10-01: :class:`VirtualMachineScaleSetRollingUpgradesOperations` + * 2019-03-01: :class:`VirtualMachineScaleSetRollingUpgradesOperations` + * 2019-07-01: :class:`VirtualMachineScaleSetRollingUpgradesOperations` + * 2019-12-01: :class:`VirtualMachineScaleSetRollingUpgradesOperations` + * 2020-06-01: :class:`VirtualMachineScaleSetRollingUpgradesOperations` + """ + api_version = self._get_api_version('virtual_machine_scale_set_rolling_upgrades') + if api_version == '2017-03-30': + from ..v2017_03_30.aio.operations import VirtualMachineScaleSetRollingUpgradesOperations as OperationClass + elif api_version == '2017-12-01': + from ..v2017_12_01.aio.operations import VirtualMachineScaleSetRollingUpgradesOperations as OperationClass + elif api_version == '2018-04-01': + from ..v2018_04_01.aio.operations import VirtualMachineScaleSetRollingUpgradesOperations as OperationClass + elif api_version == '2018-06-01': + from ..v2018_06_01.aio.operations import VirtualMachineScaleSetRollingUpgradesOperations as OperationClass + elif api_version == '2018-10-01': + from ..v2018_10_01.aio.operations import VirtualMachineScaleSetRollingUpgradesOperations as OperationClass + elif api_version == '2019-03-01': + from ..v2019_03_01.aio.operations import VirtualMachineScaleSetRollingUpgradesOperations as OperationClass + elif api_version == '2019-07-01': + from ..v2019_07_01.aio.operations import VirtualMachineScaleSetRollingUpgradesOperations as OperationClass + elif api_version == '2019-12-01': + from ..v2019_12_01.aio.operations import VirtualMachineScaleSetRollingUpgradesOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import VirtualMachineScaleSetRollingUpgradesOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'virtual_machine_scale_set_rolling_upgrades'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def virtual_machine_scale_set_vm_extensions(self): + """Instance depends on the API version: + + * 2019-07-01: :class:`VirtualMachineScaleSetVMExtensionsOperations` + * 2019-12-01: :class:`VirtualMachineScaleSetVMExtensionsOperations` + * 2020-06-01: :class:`VirtualMachineScaleSetVMExtensionsOperations` + """ + api_version = self._get_api_version('virtual_machine_scale_set_vm_extensions') + if api_version == '2019-07-01': + from ..v2019_07_01.aio.operations import VirtualMachineScaleSetVMExtensionsOperations as OperationClass + elif api_version == '2019-12-01': + from ..v2019_12_01.aio.operations import VirtualMachineScaleSetVMExtensionsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import VirtualMachineScaleSetVMExtensionsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'virtual_machine_scale_set_vm_extensions'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def virtual_machine_scale_set_vms(self): + """Instance depends on the API version: + + * 2015-06-15: :class:`VirtualMachineScaleSetVMsOperations` + * 2016-03-30: :class:`VirtualMachineScaleSetVMsOperations` + * 2016-04-30-preview: :class:`VirtualMachineScaleSetVMsOperations` + * 2017-03-30: :class:`VirtualMachineScaleSetVMsOperations` + * 2017-12-01: :class:`VirtualMachineScaleSetVMsOperations` + * 2018-04-01: :class:`VirtualMachineScaleSetVMsOperations` + * 2018-06-01: :class:`VirtualMachineScaleSetVMsOperations` + * 2018-10-01: :class:`VirtualMachineScaleSetVMsOperations` + * 2019-03-01: :class:`VirtualMachineScaleSetVMsOperations` + * 2019-07-01: :class:`VirtualMachineScaleSetVMsOperations` + * 2019-12-01: :class:`VirtualMachineScaleSetVMsOperations` + * 2020-06-01: :class:`VirtualMachineScaleSetVMsOperations` + """ + api_version = self._get_api_version('virtual_machine_scale_set_vms') + if api_version == '2015-06-15': + from ..v2015_06_15.aio.operations import VirtualMachineScaleSetVMsOperations as OperationClass + elif api_version == '2016-03-30': + from ..v2016_03_30.aio.operations import VirtualMachineScaleSetVMsOperations as OperationClass + elif api_version == '2016-04-30-preview': + from ..v2016_04_30_preview.aio.operations import VirtualMachineScaleSetVMsOperations as OperationClass + elif api_version == '2017-03-30': + from ..v2017_03_30.aio.operations import VirtualMachineScaleSetVMsOperations as OperationClass + elif api_version == '2017-12-01': + from ..v2017_12_01.aio.operations import VirtualMachineScaleSetVMsOperations as OperationClass + elif api_version == '2018-04-01': + from ..v2018_04_01.aio.operations import VirtualMachineScaleSetVMsOperations as OperationClass + elif api_version == '2018-06-01': + from ..v2018_06_01.aio.operations import VirtualMachineScaleSetVMsOperations as OperationClass + elif api_version == '2018-10-01': + from ..v2018_10_01.aio.operations import VirtualMachineScaleSetVMsOperations as OperationClass + elif api_version == '2019-03-01': + from ..v2019_03_01.aio.operations import VirtualMachineScaleSetVMsOperations as OperationClass + elif api_version == '2019-07-01': + from ..v2019_07_01.aio.operations import VirtualMachineScaleSetVMsOperations as OperationClass + elif api_version == '2019-12-01': + from ..v2019_12_01.aio.operations import VirtualMachineScaleSetVMsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import VirtualMachineScaleSetVMsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'virtual_machine_scale_set_vms'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def virtual_machine_scale_sets(self): + """Instance depends on the API version: + + * 2015-06-15: :class:`VirtualMachineScaleSetsOperations` + * 2016-03-30: :class:`VirtualMachineScaleSetsOperations` + * 2016-04-30-preview: :class:`VirtualMachineScaleSetsOperations` + * 2017-03-30: :class:`VirtualMachineScaleSetsOperations` + * 2017-12-01: :class:`VirtualMachineScaleSetsOperations` + * 2018-04-01: :class:`VirtualMachineScaleSetsOperations` + * 2018-06-01: :class:`VirtualMachineScaleSetsOperations` + * 2018-10-01: :class:`VirtualMachineScaleSetsOperations` + * 2019-03-01: :class:`VirtualMachineScaleSetsOperations` + * 2019-07-01: :class:`VirtualMachineScaleSetsOperations` + * 2019-12-01: :class:`VirtualMachineScaleSetsOperations` + * 2020-06-01: :class:`VirtualMachineScaleSetsOperations` + """ + api_version = self._get_api_version('virtual_machine_scale_sets') + if api_version == '2015-06-15': + from ..v2015_06_15.aio.operations import VirtualMachineScaleSetsOperations as OperationClass + elif api_version == '2016-03-30': + from ..v2016_03_30.aio.operations import VirtualMachineScaleSetsOperations as OperationClass + elif api_version == '2016-04-30-preview': + from ..v2016_04_30_preview.aio.operations import VirtualMachineScaleSetsOperations as OperationClass + elif api_version == '2017-03-30': + from ..v2017_03_30.aio.operations import VirtualMachineScaleSetsOperations as OperationClass + elif api_version == '2017-12-01': + from ..v2017_12_01.aio.operations import VirtualMachineScaleSetsOperations as OperationClass + elif api_version == '2018-04-01': + from ..v2018_04_01.aio.operations import VirtualMachineScaleSetsOperations as OperationClass + elif api_version == '2018-06-01': + from ..v2018_06_01.aio.operations import VirtualMachineScaleSetsOperations as OperationClass + elif api_version == '2018-10-01': + from ..v2018_10_01.aio.operations import VirtualMachineScaleSetsOperations as OperationClass + elif api_version == '2019-03-01': + from ..v2019_03_01.aio.operations import VirtualMachineScaleSetsOperations as OperationClass + elif api_version == '2019-07-01': + from ..v2019_07_01.aio.operations import VirtualMachineScaleSetsOperations as OperationClass + elif api_version == '2019-12-01': + from ..v2019_12_01.aio.operations import VirtualMachineScaleSetsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import VirtualMachineScaleSetsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'virtual_machine_scale_sets'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def virtual_machine_sizes(self): + """Instance depends on the API version: + + * 2015-06-15: :class:`VirtualMachineSizesOperations` + * 2016-03-30: :class:`VirtualMachineSizesOperations` + * 2016-04-30-preview: :class:`VirtualMachineSizesOperations` + * 2017-03-30: :class:`VirtualMachineSizesOperations` + * 2017-12-01: :class:`VirtualMachineSizesOperations` + * 2018-04-01: :class:`VirtualMachineSizesOperations` + * 2018-06-01: :class:`VirtualMachineSizesOperations` + * 2018-10-01: :class:`VirtualMachineSizesOperations` + * 2019-03-01: :class:`VirtualMachineSizesOperations` + * 2019-07-01: :class:`VirtualMachineSizesOperations` + * 2019-12-01: :class:`VirtualMachineSizesOperations` + * 2020-06-01: :class:`VirtualMachineSizesOperations` + """ + api_version = self._get_api_version('virtual_machine_sizes') + if api_version == '2015-06-15': + from ..v2015_06_15.aio.operations import VirtualMachineSizesOperations as OperationClass + elif api_version == '2016-03-30': + from ..v2016_03_30.aio.operations import VirtualMachineSizesOperations as OperationClass + elif api_version == '2016-04-30-preview': + from ..v2016_04_30_preview.aio.operations import VirtualMachineSizesOperations as OperationClass + elif api_version == '2017-03-30': + from ..v2017_03_30.aio.operations import VirtualMachineSizesOperations as OperationClass + elif api_version == '2017-12-01': + from ..v2017_12_01.aio.operations import VirtualMachineSizesOperations as OperationClass + elif api_version == '2018-04-01': + from ..v2018_04_01.aio.operations import VirtualMachineSizesOperations as OperationClass + elif api_version == '2018-06-01': + from ..v2018_06_01.aio.operations import VirtualMachineSizesOperations as OperationClass + elif api_version == '2018-10-01': + from ..v2018_10_01.aio.operations import VirtualMachineSizesOperations as OperationClass + elif api_version == '2019-03-01': + from ..v2019_03_01.aio.operations import VirtualMachineSizesOperations as OperationClass + elif api_version == '2019-07-01': + from ..v2019_07_01.aio.operations import VirtualMachineSizesOperations as OperationClass + elif api_version == '2019-12-01': + from ..v2019_12_01.aio.operations import VirtualMachineSizesOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import VirtualMachineSizesOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'virtual_machine_sizes'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def virtual_machines(self): + """Instance depends on the API version: + + * 2015-06-15: :class:`VirtualMachinesOperations` + * 2016-03-30: :class:`VirtualMachinesOperations` + * 2016-04-30-preview: :class:`VirtualMachinesOperations` + * 2017-03-30: :class:`VirtualMachinesOperations` + * 2017-12-01: :class:`VirtualMachinesOperations` + * 2018-04-01: :class:`VirtualMachinesOperations` + * 2018-06-01: :class:`VirtualMachinesOperations` + * 2018-10-01: :class:`VirtualMachinesOperations` + * 2019-03-01: :class:`VirtualMachinesOperations` + * 2019-07-01: :class:`VirtualMachinesOperations` + * 2019-12-01: :class:`VirtualMachinesOperations` + * 2020-06-01: :class:`VirtualMachinesOperations` + """ + api_version = self._get_api_version('virtual_machines') + if api_version == '2015-06-15': + from ..v2015_06_15.aio.operations import VirtualMachinesOperations as OperationClass + elif api_version == '2016-03-30': + from ..v2016_03_30.aio.operations import VirtualMachinesOperations as OperationClass + elif api_version == '2016-04-30-preview': + from ..v2016_04_30_preview.aio.operations import VirtualMachinesOperations as OperationClass + elif api_version == '2017-03-30': + from ..v2017_03_30.aio.operations import VirtualMachinesOperations as OperationClass + elif api_version == '2017-12-01': + from ..v2017_12_01.aio.operations import VirtualMachinesOperations as OperationClass + elif api_version == '2018-04-01': + from ..v2018_04_01.aio.operations import VirtualMachinesOperations as OperationClass + elif api_version == '2018-06-01': + from ..v2018_06_01.aio.operations import VirtualMachinesOperations as OperationClass + elif api_version == '2018-10-01': + from ..v2018_10_01.aio.operations import VirtualMachinesOperations as OperationClass + elif api_version == '2019-03-01': + from ..v2019_03_01.aio.operations import VirtualMachinesOperations as OperationClass + elif api_version == '2019-07-01': + from ..v2019_07_01.aio.operations import VirtualMachinesOperations as OperationClass + elif api_version == '2019-12-01': + from ..v2019_12_01.aio.operations import VirtualMachinesOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import VirtualMachinesOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'virtual_machines'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + async def close(self): + await self._client.close() + async def __aenter__(self): + await self._client.__aenter__() + return self + async def __aexit__(self, *exc_details): + await self._client.__aexit__(*exc_details) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/aio/_compute_management_client_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/aio/_compute_management_client_async.py deleted file mode 100644 index f03b01330257..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/aio/_compute_management_client_async.py +++ /dev/null @@ -1,1049 +0,0 @@ -# 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 azure.mgmt.core import AsyncARMPipelineClient -from msrest import Serializer, Deserializer - -from azure.profiles import KnownProfiles, ProfileDefinition -from azure.profiles.multiapiclient import MultiApiClientMixin -from ._configuration_async import ComputeManagementClientConfiguration - -class _SDKClient(object): - def __init__(self, *args, **kwargs): - """This is a fake class to support current implemetation of MultiApiClientMixin." - Will be removed in final version of multiapi azure-core based client - """ - pass - -class ComputeManagementClient(MultiApiClientMixin, _SDKClient): - """Compute Client. - - This ready contains multiple API versions, to help you deal with all of the Azure clouds - (Azure Stack, Azure Government, Azure China, etc.). - By default, it uses the latest API version available on public Azure. - For production, you should stick to a particular api-version and/or profile. - The profile sets a mapping between an operation group and its API version. - The api-version parameter sets the default API version if the operation - group is not described in the profile. - - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - :type subscription_id: str - :param str api_version: API version to use if no profile is provided, or if - missing in profile. - :param str base_url: Service URL - :param profile: A profile definition, from KnownProfiles to dict. - :type profile: azure.profiles.KnownProfiles - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - """ - - DEFAULT_API_VERSION = '2019-12-01' - _PROFILE_TAG = "azure.mgmt.compute.ComputeManagementClient" - LATEST_PROFILE = ProfileDefinition({ - _PROFILE_TAG: { - None: DEFAULT_API_VERSION, - 'disk_encryption_sets': '2019-11-01', - 'disks': '2019-11-01', - 'resource_skus': '2019-04-01', - 'snapshots': '2019-11-01', - }}, - _PROFILE_TAG + " latest" - ) - - def __init__( - self, - credential, # type: "AsyncTokenCredential" - subscription_id, # type: str - api_version=None, - base_url=None, - profile=KnownProfiles.default, - **kwargs # type: Any - ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = ComputeManagementClientConfiguration(credential, subscription_id, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - super(ComputeManagementClient, self).__init__( - credential, - self._config, - api_version=api_version, - profile=profile - ) - - @classmethod - def _models_dict(cls, api_version): - return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)} - - @classmethod - def models(cls, api_version=DEFAULT_API_VERSION): - """Module depends on the API version: - - * 2015-06-15: :mod:`v2015_06_15.models` - * 2016-03-30: :mod:`v2016_03_30.models` - * 2016-04-30-preview: :mod:`v2016_04_30_preview.models` - * 2017-03-30: :mod:`v2017_03_30.models` - * 2017-09-01: :mod:`v2017_09_01.models` - * 2017-12-01: :mod:`v2017_12_01.models` - * 2018-04-01: :mod:`v2018_04_01.models` - * 2018-06-01: :mod:`v2018_06_01.models` - * 2018-09-30: :mod:`v2018_09_30.models` - * 2018-10-01: :mod:`v2018_10_01.models` - * 2019-03-01: :mod:`v2019_03_01.models` - * 2019-04-01: :mod:`v2019_04_01.models` - * 2019-07-01: :mod:`v2019_07_01.models` - * 2019-11-01: :mod:`v2019_11_01.models` - * 2019-12-01: :mod:`v2019_12_01.models` - """ - if api_version == '2015-06-15': - from ..v2015_06_15 import models - return models - elif api_version == '2016-03-30': - from ..v2016_03_30 import models - return models - elif api_version == '2016-04-30-preview': - from ..v2016_04_30_preview import models - return models - elif api_version == '2017-03-30': - from ..v2017_03_30 import models - return models - elif api_version == '2017-09-01': - from ..v2017_09_01 import models - return models - elif api_version == '2017-12-01': - from ..v2017_12_01 import models - return models - elif api_version == '2018-04-01': - from ..v2018_04_01 import models - return models - elif api_version == '2018-06-01': - from ..v2018_06_01 import models - return models - elif api_version == '2018-09-30': - from ..v2018_09_30 import models - return models - elif api_version == '2018-10-01': - from ..v2018_10_01 import models - return models - elif api_version == '2019-03-01': - from ..v2019_03_01 import models - return models - elif api_version == '2019-04-01': - from ..v2019_04_01 import models - return models - elif api_version == '2019-07-01': - from ..v2019_07_01 import models - return models - elif api_version == '2019-11-01': - from ..v2019_11_01 import models - return models - elif api_version == '2019-12-01': - from ..v2019_12_01 import models - return models - raise NotImplementedError("APIVersion {} is not available".format(api_version)) - - @property - def availability_sets(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`AvailabilitySetsOperations` - * 2016-03-30: :class:`AvailabilitySetsOperations` - * 2016-04-30-preview: :class:`AvailabilitySetsOperations` - * 2017-03-30: :class:`AvailabilitySetsOperations` - * 2017-12-01: :class:`AvailabilitySetsOperations` - * 2018-04-01: :class:`AvailabilitySetsOperations` - * 2018-06-01: :class:`AvailabilitySetsOperations` - * 2018-10-01: :class:`AvailabilitySetsOperations` - * 2019-03-01: :class:`AvailabilitySetsOperations` - * 2019-07-01: :class:`AvailabilitySetsOperations` - * 2019-12-01: :class:`AvailabilitySetsOperations` - """ - api_version = self._get_api_version('availability_sets') - if api_version == '2015-06-15': - from ..v2015_06_15.aio.operations_async import AvailabilitySetsOperations as OperationClass - elif api_version == '2016-03-30': - from ..v2016_03_30.aio.operations_async import AvailabilitySetsOperations as OperationClass - elif api_version == '2016-04-30-preview': - from ..v2016_04_30_preview.aio.operations_async import AvailabilitySetsOperations as OperationClass - elif api_version == '2017-03-30': - from ..v2017_03_30.aio.operations_async import AvailabilitySetsOperations as OperationClass - elif api_version == '2017-12-01': - from ..v2017_12_01.aio.operations_async import AvailabilitySetsOperations as OperationClass - elif api_version == '2018-04-01': - from ..v2018_04_01.aio.operations_async import AvailabilitySetsOperations as OperationClass - elif api_version == '2018-06-01': - from ..v2018_06_01.aio.operations_async import AvailabilitySetsOperations as OperationClass - elif api_version == '2018-10-01': - from ..v2018_10_01.aio.operations_async import AvailabilitySetsOperations as OperationClass - elif api_version == '2019-03-01': - from ..v2019_03_01.aio.operations_async import AvailabilitySetsOperations as OperationClass - elif api_version == '2019-07-01': - from ..v2019_07_01.aio.operations_async import AvailabilitySetsOperations as OperationClass - elif api_version == '2019-12-01': - from ..v2019_12_01.aio.operations_async import AvailabilitySetsOperations as OperationClass - else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def dedicated_host_groups(self): - """Instance depends on the API version: - - * 2019-03-01: :class:`DedicatedHostGroupsOperations` - * 2019-07-01: :class:`DedicatedHostGroupsOperations` - * 2019-12-01: :class:`DedicatedHostGroupsOperations` - """ - api_version = self._get_api_version('dedicated_host_groups') - if api_version == '2019-03-01': - from ..v2019_03_01.aio.operations_async import DedicatedHostGroupsOperations as OperationClass - elif api_version == '2019-07-01': - from ..v2019_07_01.aio.operations_async import DedicatedHostGroupsOperations as OperationClass - elif api_version == '2019-12-01': - from ..v2019_12_01.aio.operations_async import DedicatedHostGroupsOperations as OperationClass - else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def dedicated_hosts(self): - """Instance depends on the API version: - - * 2019-03-01: :class:`DedicatedHostsOperations` - * 2019-07-01: :class:`DedicatedHostsOperations` - * 2019-12-01: :class:`DedicatedHostsOperations` - """ - api_version = self._get_api_version('dedicated_hosts') - if api_version == '2019-03-01': - from ..v2019_03_01.aio.operations_async import DedicatedHostsOperations as OperationClass - elif api_version == '2019-07-01': - from ..v2019_07_01.aio.operations_async import DedicatedHostsOperations as OperationClass - elif api_version == '2019-12-01': - from ..v2019_12_01.aio.operations_async import DedicatedHostsOperations as OperationClass - else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def disk_encryption_sets(self): - """Instance depends on the API version: - - * 2019-07-01: :class:`DiskEncryptionSetsOperations` - * 2019-11-01: :class:`DiskEncryptionSetsOperations` - """ - api_version = self._get_api_version('disk_encryption_sets') - if api_version == '2019-07-01': - from ..v2019_07_01.aio.operations_async import DiskEncryptionSetsOperations as OperationClass - elif api_version == '2019-11-01': - from ..v2019_11_01.aio.operations_async import DiskEncryptionSetsOperations as OperationClass - else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def disks(self): - """Instance depends on the API version: - - * 2016-04-30-preview: :class:`DisksOperations` - * 2017-03-30: :class:`DisksOperations` - * 2018-04-01: :class:`DisksOperations` - * 2018-06-01: :class:`DisksOperations` - * 2018-09-30: :class:`DisksOperations` - * 2019-03-01: :class:`DisksOperations` - * 2019-07-01: :class:`DisksOperations` - * 2019-11-01: :class:`DisksOperations` - """ - api_version = self._get_api_version('disks') - if api_version == '2016-04-30-preview': - from ..v2016_04_30_preview.aio.operations_async import DisksOperations as OperationClass - elif api_version == '2017-03-30': - from ..v2017_03_30.aio.operations_async import DisksOperations as OperationClass - elif api_version == '2018-04-01': - from ..v2018_04_01.aio.operations_async import DisksOperations as OperationClass - elif api_version == '2018-06-01': - from ..v2018_06_01.aio.operations_async import DisksOperations as OperationClass - elif api_version == '2018-09-30': - from ..v2018_09_30.aio.operations_async import DisksOperations as OperationClass - elif api_version == '2019-03-01': - from ..v2019_03_01.aio.operations_async import DisksOperations as OperationClass - elif api_version == '2019-07-01': - from ..v2019_07_01.aio.operations_async import DisksOperations as OperationClass - elif api_version == '2019-11-01': - from ..v2019_11_01.aio.operations_async import DisksOperations as OperationClass - else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def galleries(self): - """Instance depends on the API version: - - * 2018-06-01: :class:`GalleriesOperations` - * 2019-03-01: :class:`GalleriesOperations` - * 2019-07-01: :class:`GalleriesOperations` - * 2019-12-01: :class:`GalleriesOperations` - """ - api_version = self._get_api_version('galleries') - if api_version == '2018-06-01': - from ..v2018_06_01.aio.operations_async import GalleriesOperations as OperationClass - elif api_version == '2019-03-01': - from ..v2019_03_01.aio.operations_async import GalleriesOperations as OperationClass - elif api_version == '2019-07-01': - from ..v2019_07_01.aio.operations_async import GalleriesOperations as OperationClass - elif api_version == '2019-12-01': - from ..v2019_12_01.aio.operations_async import GalleriesOperations as OperationClass - else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def gallery_application_versions(self): - """Instance depends on the API version: - - * 2019-03-01: :class:`GalleryApplicationVersionsOperations` - * 2019-07-01: :class:`GalleryApplicationVersionsOperations` - * 2019-12-01: :class:`GalleryApplicationVersionsOperations` - """ - api_version = self._get_api_version('gallery_application_versions') - if api_version == '2019-03-01': - from ..v2019_03_01.aio.operations_async import GalleryApplicationVersionsOperations as OperationClass - elif api_version == '2019-07-01': - from ..v2019_07_01.aio.operations_async import GalleryApplicationVersionsOperations as OperationClass - elif api_version == '2019-12-01': - from ..v2019_12_01.aio.operations_async import GalleryApplicationVersionsOperations as OperationClass - else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def gallery_applications(self): - """Instance depends on the API version: - - * 2019-03-01: :class:`GalleryApplicationsOperations` - * 2019-07-01: :class:`GalleryApplicationsOperations` - * 2019-12-01: :class:`GalleryApplicationsOperations` - """ - api_version = self._get_api_version('gallery_applications') - if api_version == '2019-03-01': - from ..v2019_03_01.aio.operations_async import GalleryApplicationsOperations as OperationClass - elif api_version == '2019-07-01': - from ..v2019_07_01.aio.operations_async import GalleryApplicationsOperations as OperationClass - elif api_version == '2019-12-01': - from ..v2019_12_01.aio.operations_async import GalleryApplicationsOperations as OperationClass - else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def gallery_image_versions(self): - """Instance depends on the API version: - - * 2018-06-01: :class:`GalleryImageVersionsOperations` - * 2019-03-01: :class:`GalleryImageVersionsOperations` - * 2019-07-01: :class:`GalleryImageVersionsOperations` - * 2019-12-01: :class:`GalleryImageVersionsOperations` - """ - api_version = self._get_api_version('gallery_image_versions') - if api_version == '2018-06-01': - from ..v2018_06_01.aio.operations_async import GalleryImageVersionsOperations as OperationClass - elif api_version == '2019-03-01': - from ..v2019_03_01.aio.operations_async import GalleryImageVersionsOperations as OperationClass - elif api_version == '2019-07-01': - from ..v2019_07_01.aio.operations_async import GalleryImageVersionsOperations as OperationClass - elif api_version == '2019-12-01': - from ..v2019_12_01.aio.operations_async import GalleryImageVersionsOperations as OperationClass - else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def gallery_images(self): - """Instance depends on the API version: - - * 2018-06-01: :class:`GalleryImagesOperations` - * 2019-03-01: :class:`GalleryImagesOperations` - * 2019-07-01: :class:`GalleryImagesOperations` - * 2019-12-01: :class:`GalleryImagesOperations` - """ - api_version = self._get_api_version('gallery_images') - if api_version == '2018-06-01': - from ..v2018_06_01.aio.operations_async import GalleryImagesOperations as OperationClass - elif api_version == '2019-03-01': - from ..v2019_03_01.aio.operations_async import GalleryImagesOperations as OperationClass - elif api_version == '2019-07-01': - from ..v2019_07_01.aio.operations_async import GalleryImagesOperations as OperationClass - elif api_version == '2019-12-01': - from ..v2019_12_01.aio.operations_async import GalleryImagesOperations as OperationClass - else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def images(self): - """Instance depends on the API version: - - * 2016-04-30-preview: :class:`ImagesOperations` - * 2017-03-30: :class:`ImagesOperations` - * 2017-12-01: :class:`ImagesOperations` - * 2018-04-01: :class:`ImagesOperations` - * 2018-06-01: :class:`ImagesOperations` - * 2018-10-01: :class:`ImagesOperations` - * 2019-03-01: :class:`ImagesOperations` - * 2019-07-01: :class:`ImagesOperations` - * 2019-12-01: :class:`ImagesOperations` - """ - api_version = self._get_api_version('images') - if api_version == '2016-04-30-preview': - from ..v2016_04_30_preview.aio.operations_async import ImagesOperations as OperationClass - elif api_version == '2017-03-30': - from ..v2017_03_30.aio.operations_async import ImagesOperations as OperationClass - elif api_version == '2017-12-01': - from ..v2017_12_01.aio.operations_async import ImagesOperations as OperationClass - elif api_version == '2018-04-01': - from ..v2018_04_01.aio.operations_async import ImagesOperations as OperationClass - elif api_version == '2018-06-01': - from ..v2018_06_01.aio.operations_async import ImagesOperations as OperationClass - elif api_version == '2018-10-01': - from ..v2018_10_01.aio.operations_async import ImagesOperations as OperationClass - elif api_version == '2019-03-01': - from ..v2019_03_01.aio.operations_async import ImagesOperations as OperationClass - elif api_version == '2019-07-01': - from ..v2019_07_01.aio.operations_async import ImagesOperations as OperationClass - elif api_version == '2019-12-01': - from ..v2019_12_01.aio.operations_async import ImagesOperations as OperationClass - else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def log_analytics(self): - """Instance depends on the API version: - - * 2017-12-01: :class:`LogAnalyticsOperations` - * 2018-04-01: :class:`LogAnalyticsOperations` - * 2018-06-01: :class:`LogAnalyticsOperations` - * 2018-10-01: :class:`LogAnalyticsOperations` - * 2019-03-01: :class:`LogAnalyticsOperations` - * 2019-07-01: :class:`LogAnalyticsOperations` - * 2019-12-01: :class:`LogAnalyticsOperations` - """ - api_version = self._get_api_version('log_analytics') - if api_version == '2017-12-01': - from ..v2017_12_01.aio.operations_async import LogAnalyticsOperations as OperationClass - elif api_version == '2018-04-01': - from ..v2018_04_01.aio.operations_async import LogAnalyticsOperations as OperationClass - elif api_version == '2018-06-01': - from ..v2018_06_01.aio.operations_async import LogAnalyticsOperations as OperationClass - elif api_version == '2018-10-01': - from ..v2018_10_01.aio.operations_async import LogAnalyticsOperations as OperationClass - elif api_version == '2019-03-01': - from ..v2019_03_01.aio.operations_async import LogAnalyticsOperations as OperationClass - elif api_version == '2019-07-01': - from ..v2019_07_01.aio.operations_async import LogAnalyticsOperations as OperationClass - elif api_version == '2019-12-01': - from ..v2019_12_01.aio.operations_async import LogAnalyticsOperations as OperationClass - else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def operations(self): - """Instance depends on the API version: - - * 2017-12-01: :class:`Operations` - * 2018-04-01: :class:`Operations` - * 2018-06-01: :class:`Operations` - * 2018-10-01: :class:`Operations` - * 2019-03-01: :class:`Operations` - * 2019-07-01: :class:`Operations` - * 2019-12-01: :class:`Operations` - """ - api_version = self._get_api_version('operations') - if api_version == '2017-12-01': - from ..v2017_12_01.aio.operations_async import Operations as OperationClass - elif api_version == '2018-04-01': - from ..v2018_04_01.aio.operations_async import Operations as OperationClass - elif api_version == '2018-06-01': - from ..v2018_06_01.aio.operations_async import Operations as OperationClass - elif api_version == '2018-10-01': - from ..v2018_10_01.aio.operations_async import Operations as OperationClass - elif api_version == '2019-03-01': - from ..v2019_03_01.aio.operations_async import Operations as OperationClass - elif api_version == '2019-07-01': - from ..v2019_07_01.aio.operations_async import Operations as OperationClass - elif api_version == '2019-12-01': - from ..v2019_12_01.aio.operations_async import Operations as OperationClass - else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def proximity_placement_groups(self): - """Instance depends on the API version: - - * 2018-04-01: :class:`ProximityPlacementGroupsOperations` - * 2018-06-01: :class:`ProximityPlacementGroupsOperations` - * 2018-10-01: :class:`ProximityPlacementGroupsOperations` - * 2019-03-01: :class:`ProximityPlacementGroupsOperations` - * 2019-07-01: :class:`ProximityPlacementGroupsOperations` - * 2019-12-01: :class:`ProximityPlacementGroupsOperations` - """ - api_version = self._get_api_version('proximity_placement_groups') - if api_version == '2018-04-01': - from ..v2018_04_01.aio.operations_async import ProximityPlacementGroupsOperations as OperationClass - elif api_version == '2018-06-01': - from ..v2018_06_01.aio.operations_async import ProximityPlacementGroupsOperations as OperationClass - elif api_version == '2018-10-01': - from ..v2018_10_01.aio.operations_async import ProximityPlacementGroupsOperations as OperationClass - elif api_version == '2019-03-01': - from ..v2019_03_01.aio.operations_async import ProximityPlacementGroupsOperations as OperationClass - elif api_version == '2019-07-01': - from ..v2019_07_01.aio.operations_async import ProximityPlacementGroupsOperations as OperationClass - elif api_version == '2019-12-01': - from ..v2019_12_01.aio.operations_async import ProximityPlacementGroupsOperations as OperationClass - else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def resource_skus(self): - """Instance depends on the API version: - - * 2017-03-30: :class:`ResourceSkusOperations` - * 2017-09-01: :class:`ResourceSkusOperations` - * 2019-04-01: :class:`ResourceSkusOperations` - """ - api_version = self._get_api_version('resource_skus') - if api_version == '2017-03-30': - from ..v2017_03_30.aio.operations_async import ResourceSkusOperations as OperationClass - elif api_version == '2017-09-01': - from ..v2017_09_01.aio.operations_async import ResourceSkusOperations as OperationClass - elif api_version == '2019-04-01': - from ..v2019_04_01.aio.operations_async import ResourceSkusOperations as OperationClass - else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def snapshots(self): - """Instance depends on the API version: - - * 2016-04-30-preview: :class:`SnapshotsOperations` - * 2017-03-30: :class:`SnapshotsOperations` - * 2018-04-01: :class:`SnapshotsOperations` - * 2018-06-01: :class:`SnapshotsOperations` - * 2018-09-30: :class:`SnapshotsOperations` - * 2019-03-01: :class:`SnapshotsOperations` - * 2019-07-01: :class:`SnapshotsOperations` - * 2019-11-01: :class:`SnapshotsOperations` - """ - api_version = self._get_api_version('snapshots') - if api_version == '2016-04-30-preview': - from ..v2016_04_30_preview.aio.operations_async import SnapshotsOperations as OperationClass - elif api_version == '2017-03-30': - from ..v2017_03_30.aio.operations_async import SnapshotsOperations as OperationClass - elif api_version == '2018-04-01': - from ..v2018_04_01.aio.operations_async import SnapshotsOperations as OperationClass - elif api_version == '2018-06-01': - from ..v2018_06_01.aio.operations_async import SnapshotsOperations as OperationClass - elif api_version == '2018-09-30': - from ..v2018_09_30.aio.operations_async import SnapshotsOperations as OperationClass - elif api_version == '2019-03-01': - from ..v2019_03_01.aio.operations_async import SnapshotsOperations as OperationClass - elif api_version == '2019-07-01': - from ..v2019_07_01.aio.operations_async import SnapshotsOperations as OperationClass - elif api_version == '2019-11-01': - from ..v2019_11_01.aio.operations_async import SnapshotsOperations as OperationClass - else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def ssh_public_keys(self): - """Instance depends on the API version: - - * 2019-12-01: :class:`SshPublicKeysOperations` - """ - api_version = self._get_api_version('ssh_public_keys') - if api_version == '2019-12-01': - from ..v2019_12_01.aio.operations_async import SshPublicKeysOperations as OperationClass - else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def usage(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`UsageOperations` - * 2016-03-30: :class:`UsageOperations` - * 2016-04-30-preview: :class:`UsageOperations` - * 2017-03-30: :class:`UsageOperations` - * 2017-12-01: :class:`UsageOperations` - * 2018-04-01: :class:`UsageOperations` - * 2018-06-01: :class:`UsageOperations` - * 2018-10-01: :class:`UsageOperations` - * 2019-03-01: :class:`UsageOperations` - * 2019-07-01: :class:`UsageOperations` - * 2019-12-01: :class:`UsageOperations` - """ - api_version = self._get_api_version('usage') - if api_version == '2015-06-15': - from ..v2015_06_15.aio.operations_async import UsageOperations as OperationClass - elif api_version == '2016-03-30': - from ..v2016_03_30.aio.operations_async import UsageOperations as OperationClass - elif api_version == '2016-04-30-preview': - from ..v2016_04_30_preview.aio.operations_async import UsageOperations as OperationClass - elif api_version == '2017-03-30': - from ..v2017_03_30.aio.operations_async import UsageOperations as OperationClass - elif api_version == '2017-12-01': - from ..v2017_12_01.aio.operations_async import UsageOperations as OperationClass - elif api_version == '2018-04-01': - from ..v2018_04_01.aio.operations_async import UsageOperations as OperationClass - elif api_version == '2018-06-01': - from ..v2018_06_01.aio.operations_async import UsageOperations as OperationClass - elif api_version == '2018-10-01': - from ..v2018_10_01.aio.operations_async import UsageOperations as OperationClass - elif api_version == '2019-03-01': - from ..v2019_03_01.aio.operations_async import UsageOperations as OperationClass - elif api_version == '2019-07-01': - from ..v2019_07_01.aio.operations_async import UsageOperations as OperationClass - elif api_version == '2019-12-01': - from ..v2019_12_01.aio.operations_async import UsageOperations as OperationClass - else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def virtual_machine_extension_images(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`VirtualMachineExtensionImagesOperations` - * 2016-03-30: :class:`VirtualMachineExtensionImagesOperations` - * 2016-04-30-preview: :class:`VirtualMachineExtensionImagesOperations` - * 2017-03-30: :class:`VirtualMachineExtensionImagesOperations` - * 2017-12-01: :class:`VirtualMachineExtensionImagesOperations` - * 2018-04-01: :class:`VirtualMachineExtensionImagesOperations` - * 2018-06-01: :class:`VirtualMachineExtensionImagesOperations` - * 2018-10-01: :class:`VirtualMachineExtensionImagesOperations` - * 2019-03-01: :class:`VirtualMachineExtensionImagesOperations` - * 2019-07-01: :class:`VirtualMachineExtensionImagesOperations` - * 2019-12-01: :class:`VirtualMachineExtensionImagesOperations` - """ - api_version = self._get_api_version('virtual_machine_extension_images') - if api_version == '2015-06-15': - from ..v2015_06_15.aio.operations_async import VirtualMachineExtensionImagesOperations as OperationClass - elif api_version == '2016-03-30': - from ..v2016_03_30.aio.operations_async import VirtualMachineExtensionImagesOperations as OperationClass - elif api_version == '2016-04-30-preview': - from ..v2016_04_30_preview.aio.operations_async import VirtualMachineExtensionImagesOperations as OperationClass - elif api_version == '2017-03-30': - from ..v2017_03_30.aio.operations_async import VirtualMachineExtensionImagesOperations as OperationClass - elif api_version == '2017-12-01': - from ..v2017_12_01.aio.operations_async import VirtualMachineExtensionImagesOperations as OperationClass - elif api_version == '2018-04-01': - from ..v2018_04_01.aio.operations_async import VirtualMachineExtensionImagesOperations as OperationClass - elif api_version == '2018-06-01': - from ..v2018_06_01.aio.operations_async import VirtualMachineExtensionImagesOperations as OperationClass - elif api_version == '2018-10-01': - from ..v2018_10_01.aio.operations_async import VirtualMachineExtensionImagesOperations as OperationClass - elif api_version == '2019-03-01': - from ..v2019_03_01.aio.operations_async import VirtualMachineExtensionImagesOperations as OperationClass - elif api_version == '2019-07-01': - from ..v2019_07_01.aio.operations_async import VirtualMachineExtensionImagesOperations as OperationClass - elif api_version == '2019-12-01': - from ..v2019_12_01.aio.operations_async import VirtualMachineExtensionImagesOperations as OperationClass - else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def virtual_machine_extensions(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`VirtualMachineExtensionsOperations` - * 2016-03-30: :class:`VirtualMachineExtensionsOperations` - * 2016-04-30-preview: :class:`VirtualMachineExtensionsOperations` - * 2017-03-30: :class:`VirtualMachineExtensionsOperations` - * 2017-12-01: :class:`VirtualMachineExtensionsOperations` - * 2018-04-01: :class:`VirtualMachineExtensionsOperations` - * 2018-06-01: :class:`VirtualMachineExtensionsOperations` - * 2018-10-01: :class:`VirtualMachineExtensionsOperations` - * 2019-03-01: :class:`VirtualMachineExtensionsOperations` - * 2019-07-01: :class:`VirtualMachineExtensionsOperations` - * 2019-12-01: :class:`VirtualMachineExtensionsOperations` - """ - api_version = self._get_api_version('virtual_machine_extensions') - if api_version == '2015-06-15': - from ..v2015_06_15.aio.operations_async import VirtualMachineExtensionsOperations as OperationClass - elif api_version == '2016-03-30': - from ..v2016_03_30.aio.operations_async import VirtualMachineExtensionsOperations as OperationClass - elif api_version == '2016-04-30-preview': - from ..v2016_04_30_preview.aio.operations_async import VirtualMachineExtensionsOperations as OperationClass - elif api_version == '2017-03-30': - from ..v2017_03_30.aio.operations_async import VirtualMachineExtensionsOperations as OperationClass - elif api_version == '2017-12-01': - from ..v2017_12_01.aio.operations_async import VirtualMachineExtensionsOperations as OperationClass - elif api_version == '2018-04-01': - from ..v2018_04_01.aio.operations_async import VirtualMachineExtensionsOperations as OperationClass - elif api_version == '2018-06-01': - from ..v2018_06_01.aio.operations_async import VirtualMachineExtensionsOperations as OperationClass - elif api_version == '2018-10-01': - from ..v2018_10_01.aio.operations_async import VirtualMachineExtensionsOperations as OperationClass - elif api_version == '2019-03-01': - from ..v2019_03_01.aio.operations_async import VirtualMachineExtensionsOperations as OperationClass - elif api_version == '2019-07-01': - from ..v2019_07_01.aio.operations_async import VirtualMachineExtensionsOperations as OperationClass - elif api_version == '2019-12-01': - from ..v2019_12_01.aio.operations_async import VirtualMachineExtensionsOperations as OperationClass - else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def virtual_machine_images(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`VirtualMachineImagesOperations` - * 2016-03-30: :class:`VirtualMachineImagesOperations` - * 2016-04-30-preview: :class:`VirtualMachineImagesOperations` - * 2017-03-30: :class:`VirtualMachineImagesOperations` - * 2017-12-01: :class:`VirtualMachineImagesOperations` - * 2018-04-01: :class:`VirtualMachineImagesOperations` - * 2018-06-01: :class:`VirtualMachineImagesOperations` - * 2018-10-01: :class:`VirtualMachineImagesOperations` - * 2019-03-01: :class:`VirtualMachineImagesOperations` - * 2019-07-01: :class:`VirtualMachineImagesOperations` - * 2019-12-01: :class:`VirtualMachineImagesOperations` - """ - api_version = self._get_api_version('virtual_machine_images') - if api_version == '2015-06-15': - from ..v2015_06_15.aio.operations_async import VirtualMachineImagesOperations as OperationClass - elif api_version == '2016-03-30': - from ..v2016_03_30.aio.operations_async import VirtualMachineImagesOperations as OperationClass - elif api_version == '2016-04-30-preview': - from ..v2016_04_30_preview.aio.operations_async import VirtualMachineImagesOperations as OperationClass - elif api_version == '2017-03-30': - from ..v2017_03_30.aio.operations_async import VirtualMachineImagesOperations as OperationClass - elif api_version == '2017-12-01': - from ..v2017_12_01.aio.operations_async import VirtualMachineImagesOperations as OperationClass - elif api_version == '2018-04-01': - from ..v2018_04_01.aio.operations_async import VirtualMachineImagesOperations as OperationClass - elif api_version == '2018-06-01': - from ..v2018_06_01.aio.operations_async import VirtualMachineImagesOperations as OperationClass - elif api_version == '2018-10-01': - from ..v2018_10_01.aio.operations_async import VirtualMachineImagesOperations as OperationClass - elif api_version == '2019-03-01': - from ..v2019_03_01.aio.operations_async import VirtualMachineImagesOperations as OperationClass - elif api_version == '2019-07-01': - from ..v2019_07_01.aio.operations_async import VirtualMachineImagesOperations as OperationClass - elif api_version == '2019-12-01': - from ..v2019_12_01.aio.operations_async import VirtualMachineImagesOperations as OperationClass - else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def virtual_machine_run_commands(self): - """Instance depends on the API version: - - * 2017-03-30: :class:`VirtualMachineRunCommandsOperations` - * 2017-12-01: :class:`VirtualMachineRunCommandsOperations` - * 2018-04-01: :class:`VirtualMachineRunCommandsOperations` - * 2018-06-01: :class:`VirtualMachineRunCommandsOperations` - * 2018-10-01: :class:`VirtualMachineRunCommandsOperations` - * 2019-03-01: :class:`VirtualMachineRunCommandsOperations` - * 2019-07-01: :class:`VirtualMachineRunCommandsOperations` - * 2019-12-01: :class:`VirtualMachineRunCommandsOperations` - """ - api_version = self._get_api_version('virtual_machine_run_commands') - if api_version == '2017-03-30': - from ..v2017_03_30.aio.operations_async import VirtualMachineRunCommandsOperations as OperationClass - elif api_version == '2017-12-01': - from ..v2017_12_01.aio.operations_async import VirtualMachineRunCommandsOperations as OperationClass - elif api_version == '2018-04-01': - from ..v2018_04_01.aio.operations_async import VirtualMachineRunCommandsOperations as OperationClass - elif api_version == '2018-06-01': - from ..v2018_06_01.aio.operations_async import VirtualMachineRunCommandsOperations as OperationClass - elif api_version == '2018-10-01': - from ..v2018_10_01.aio.operations_async import VirtualMachineRunCommandsOperations as OperationClass - elif api_version == '2019-03-01': - from ..v2019_03_01.aio.operations_async import VirtualMachineRunCommandsOperations as OperationClass - elif api_version == '2019-07-01': - from ..v2019_07_01.aio.operations_async import VirtualMachineRunCommandsOperations as OperationClass - elif api_version == '2019-12-01': - from ..v2019_12_01.aio.operations_async import VirtualMachineRunCommandsOperations as OperationClass - else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def virtual_machine_scale_set_extensions(self): - """Instance depends on the API version: - - * 2017-03-30: :class:`VirtualMachineScaleSetExtensionsOperations` - * 2017-12-01: :class:`VirtualMachineScaleSetExtensionsOperations` - * 2018-04-01: :class:`VirtualMachineScaleSetExtensionsOperations` - * 2018-06-01: :class:`VirtualMachineScaleSetExtensionsOperations` - * 2018-10-01: :class:`VirtualMachineScaleSetExtensionsOperations` - * 2019-03-01: :class:`VirtualMachineScaleSetExtensionsOperations` - * 2019-07-01: :class:`VirtualMachineScaleSetExtensionsOperations` - * 2019-12-01: :class:`VirtualMachineScaleSetExtensionsOperations` - """ - api_version = self._get_api_version('virtual_machine_scale_set_extensions') - if api_version == '2017-03-30': - from ..v2017_03_30.aio.operations_async import VirtualMachineScaleSetExtensionsOperations as OperationClass - elif api_version == '2017-12-01': - from ..v2017_12_01.aio.operations_async import VirtualMachineScaleSetExtensionsOperations as OperationClass - elif api_version == '2018-04-01': - from ..v2018_04_01.aio.operations_async import VirtualMachineScaleSetExtensionsOperations as OperationClass - elif api_version == '2018-06-01': - from ..v2018_06_01.aio.operations_async import VirtualMachineScaleSetExtensionsOperations as OperationClass - elif api_version == '2018-10-01': - from ..v2018_10_01.aio.operations_async import VirtualMachineScaleSetExtensionsOperations as OperationClass - elif api_version == '2019-03-01': - from ..v2019_03_01.aio.operations_async import VirtualMachineScaleSetExtensionsOperations as OperationClass - elif api_version == '2019-07-01': - from ..v2019_07_01.aio.operations_async import VirtualMachineScaleSetExtensionsOperations as OperationClass - elif api_version == '2019-12-01': - from ..v2019_12_01.aio.operations_async import VirtualMachineScaleSetExtensionsOperations as OperationClass - else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def virtual_machine_scale_set_rolling_upgrades(self): - """Instance depends on the API version: - - * 2017-03-30: :class:`VirtualMachineScaleSetRollingUpgradesOperations` - * 2017-12-01: :class:`VirtualMachineScaleSetRollingUpgradesOperations` - * 2018-04-01: :class:`VirtualMachineScaleSetRollingUpgradesOperations` - * 2018-06-01: :class:`VirtualMachineScaleSetRollingUpgradesOperations` - * 2018-10-01: :class:`VirtualMachineScaleSetRollingUpgradesOperations` - * 2019-03-01: :class:`VirtualMachineScaleSetRollingUpgradesOperations` - * 2019-07-01: :class:`VirtualMachineScaleSetRollingUpgradesOperations` - * 2019-12-01: :class:`VirtualMachineScaleSetRollingUpgradesOperations` - """ - api_version = self._get_api_version('virtual_machine_scale_set_rolling_upgrades') - if api_version == '2017-03-30': - from ..v2017_03_30.aio.operations_async import VirtualMachineScaleSetRollingUpgradesOperations as OperationClass - elif api_version == '2017-12-01': - from ..v2017_12_01.aio.operations_async import VirtualMachineScaleSetRollingUpgradesOperations as OperationClass - elif api_version == '2018-04-01': - from ..v2018_04_01.aio.operations_async import VirtualMachineScaleSetRollingUpgradesOperations as OperationClass - elif api_version == '2018-06-01': - from ..v2018_06_01.aio.operations_async import VirtualMachineScaleSetRollingUpgradesOperations as OperationClass - elif api_version == '2018-10-01': - from ..v2018_10_01.aio.operations_async import VirtualMachineScaleSetRollingUpgradesOperations as OperationClass - elif api_version == '2019-03-01': - from ..v2019_03_01.aio.operations_async import VirtualMachineScaleSetRollingUpgradesOperations as OperationClass - elif api_version == '2019-07-01': - from ..v2019_07_01.aio.operations_async import VirtualMachineScaleSetRollingUpgradesOperations as OperationClass - elif api_version == '2019-12-01': - from ..v2019_12_01.aio.operations_async import VirtualMachineScaleSetRollingUpgradesOperations as OperationClass - else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def virtual_machine_scale_set_vm_extensions(self): - """Instance depends on the API version: - - * 2019-07-01: :class:`VirtualMachineScaleSetVMExtensionsOperations` - * 2019-12-01: :class:`VirtualMachineScaleSetVMExtensionsOperations` - """ - api_version = self._get_api_version('virtual_machine_scale_set_vm_extensions') - if api_version == '2019-07-01': - from ..v2019_07_01.aio.operations_async import VirtualMachineScaleSetVMExtensionsOperations as OperationClass - elif api_version == '2019-12-01': - from ..v2019_12_01.aio.operations_async import VirtualMachineScaleSetVMExtensionsOperations as OperationClass - else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def virtual_machine_scale_set_vms(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`VirtualMachineScaleSetVMsOperations` - * 2016-03-30: :class:`VirtualMachineScaleSetVMsOperations` - * 2016-04-30-preview: :class:`VirtualMachineScaleSetVMsOperations` - * 2017-03-30: :class:`VirtualMachineScaleSetVMsOperations` - * 2017-12-01: :class:`VirtualMachineScaleSetVMsOperations` - * 2018-04-01: :class:`VirtualMachineScaleSetVMsOperations` - * 2018-06-01: :class:`VirtualMachineScaleSetVMsOperations` - * 2018-10-01: :class:`VirtualMachineScaleSetVMsOperations` - * 2019-03-01: :class:`VirtualMachineScaleSetVMsOperations` - * 2019-07-01: :class:`VirtualMachineScaleSetVMsOperations` - * 2019-12-01: :class:`VirtualMachineScaleSetVMsOperations` - """ - api_version = self._get_api_version('virtual_machine_scale_set_vms') - if api_version == '2015-06-15': - from ..v2015_06_15.aio.operations_async import VirtualMachineScaleSetVMsOperations as OperationClass - elif api_version == '2016-03-30': - from ..v2016_03_30.aio.operations_async import VirtualMachineScaleSetVMsOperations as OperationClass - elif api_version == '2016-04-30-preview': - from ..v2016_04_30_preview.aio.operations_async import VirtualMachineScaleSetVMsOperations as OperationClass - elif api_version == '2017-03-30': - from ..v2017_03_30.aio.operations_async import VirtualMachineScaleSetVMsOperations as OperationClass - elif api_version == '2017-12-01': - from ..v2017_12_01.aio.operations_async import VirtualMachineScaleSetVMsOperations as OperationClass - elif api_version == '2018-04-01': - from ..v2018_04_01.aio.operations_async import VirtualMachineScaleSetVMsOperations as OperationClass - elif api_version == '2018-06-01': - from ..v2018_06_01.aio.operations_async import VirtualMachineScaleSetVMsOperations as OperationClass - elif api_version == '2018-10-01': - from ..v2018_10_01.aio.operations_async import VirtualMachineScaleSetVMsOperations as OperationClass - elif api_version == '2019-03-01': - from ..v2019_03_01.aio.operations_async import VirtualMachineScaleSetVMsOperations as OperationClass - elif api_version == '2019-07-01': - from ..v2019_07_01.aio.operations_async import VirtualMachineScaleSetVMsOperations as OperationClass - elif api_version == '2019-12-01': - from ..v2019_12_01.aio.operations_async import VirtualMachineScaleSetVMsOperations as OperationClass - else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def virtual_machine_scale_sets(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`VirtualMachineScaleSetsOperations` - * 2016-03-30: :class:`VirtualMachineScaleSetsOperations` - * 2016-04-30-preview: :class:`VirtualMachineScaleSetsOperations` - * 2017-03-30: :class:`VirtualMachineScaleSetsOperations` - * 2017-12-01: :class:`VirtualMachineScaleSetsOperations` - * 2018-04-01: :class:`VirtualMachineScaleSetsOperations` - * 2018-06-01: :class:`VirtualMachineScaleSetsOperations` - * 2018-10-01: :class:`VirtualMachineScaleSetsOperations` - * 2019-03-01: :class:`VirtualMachineScaleSetsOperations` - * 2019-07-01: :class:`VirtualMachineScaleSetsOperations` - * 2019-12-01: :class:`VirtualMachineScaleSetsOperations` - """ - api_version = self._get_api_version('virtual_machine_scale_sets') - if api_version == '2015-06-15': - from ..v2015_06_15.aio.operations_async import VirtualMachineScaleSetsOperations as OperationClass - elif api_version == '2016-03-30': - from ..v2016_03_30.aio.operations_async import VirtualMachineScaleSetsOperations as OperationClass - elif api_version == '2016-04-30-preview': - from ..v2016_04_30_preview.aio.operations_async import VirtualMachineScaleSetsOperations as OperationClass - elif api_version == '2017-03-30': - from ..v2017_03_30.aio.operations_async import VirtualMachineScaleSetsOperations as OperationClass - elif api_version == '2017-12-01': - from ..v2017_12_01.aio.operations_async import VirtualMachineScaleSetsOperations as OperationClass - elif api_version == '2018-04-01': - from ..v2018_04_01.aio.operations_async import VirtualMachineScaleSetsOperations as OperationClass - elif api_version == '2018-06-01': - from ..v2018_06_01.aio.operations_async import VirtualMachineScaleSetsOperations as OperationClass - elif api_version == '2018-10-01': - from ..v2018_10_01.aio.operations_async import VirtualMachineScaleSetsOperations as OperationClass - elif api_version == '2019-03-01': - from ..v2019_03_01.aio.operations_async import VirtualMachineScaleSetsOperations as OperationClass - elif api_version == '2019-07-01': - from ..v2019_07_01.aio.operations_async import VirtualMachineScaleSetsOperations as OperationClass - elif api_version == '2019-12-01': - from ..v2019_12_01.aio.operations_async import VirtualMachineScaleSetsOperations as OperationClass - else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def virtual_machine_sizes(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`VirtualMachineSizesOperations` - * 2016-03-30: :class:`VirtualMachineSizesOperations` - * 2016-04-30-preview: :class:`VirtualMachineSizesOperations` - * 2017-03-30: :class:`VirtualMachineSizesOperations` - * 2017-12-01: :class:`VirtualMachineSizesOperations` - * 2018-04-01: :class:`VirtualMachineSizesOperations` - * 2018-06-01: :class:`VirtualMachineSizesOperations` - * 2018-10-01: :class:`VirtualMachineSizesOperations` - * 2019-03-01: :class:`VirtualMachineSizesOperations` - * 2019-07-01: :class:`VirtualMachineSizesOperations` - * 2019-12-01: :class:`VirtualMachineSizesOperations` - """ - api_version = self._get_api_version('virtual_machine_sizes') - if api_version == '2015-06-15': - from ..v2015_06_15.aio.operations_async import VirtualMachineSizesOperations as OperationClass - elif api_version == '2016-03-30': - from ..v2016_03_30.aio.operations_async import VirtualMachineSizesOperations as OperationClass - elif api_version == '2016-04-30-preview': - from ..v2016_04_30_preview.aio.operations_async import VirtualMachineSizesOperations as OperationClass - elif api_version == '2017-03-30': - from ..v2017_03_30.aio.operations_async import VirtualMachineSizesOperations as OperationClass - elif api_version == '2017-12-01': - from ..v2017_12_01.aio.operations_async import VirtualMachineSizesOperations as OperationClass - elif api_version == '2018-04-01': - from ..v2018_04_01.aio.operations_async import VirtualMachineSizesOperations as OperationClass - elif api_version == '2018-06-01': - from ..v2018_06_01.aio.operations_async import VirtualMachineSizesOperations as OperationClass - elif api_version == '2018-10-01': - from ..v2018_10_01.aio.operations_async import VirtualMachineSizesOperations as OperationClass - elif api_version == '2019-03-01': - from ..v2019_03_01.aio.operations_async import VirtualMachineSizesOperations as OperationClass - elif api_version == '2019-07-01': - from ..v2019_07_01.aio.operations_async import VirtualMachineSizesOperations as OperationClass - elif api_version == '2019-12-01': - from ..v2019_12_01.aio.operations_async import VirtualMachineSizesOperations as OperationClass - else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def virtual_machines(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`VirtualMachinesOperations` - * 2016-03-30: :class:`VirtualMachinesOperations` - * 2016-04-30-preview: :class:`VirtualMachinesOperations` - * 2017-03-30: :class:`VirtualMachinesOperations` - * 2017-12-01: :class:`VirtualMachinesOperations` - * 2018-04-01: :class:`VirtualMachinesOperations` - * 2018-06-01: :class:`VirtualMachinesOperations` - * 2018-10-01: :class:`VirtualMachinesOperations` - * 2019-03-01: :class:`VirtualMachinesOperations` - * 2019-07-01: :class:`VirtualMachinesOperations` - * 2019-12-01: :class:`VirtualMachinesOperations` - """ - api_version = self._get_api_version('virtual_machines') - if api_version == '2015-06-15': - from ..v2015_06_15.aio.operations_async import VirtualMachinesOperations as OperationClass - elif api_version == '2016-03-30': - from ..v2016_03_30.aio.operations_async import VirtualMachinesOperations as OperationClass - elif api_version == '2016-04-30-preview': - from ..v2016_04_30_preview.aio.operations_async import VirtualMachinesOperations as OperationClass - elif api_version == '2017-03-30': - from ..v2017_03_30.aio.operations_async import VirtualMachinesOperations as OperationClass - elif api_version == '2017-12-01': - from ..v2017_12_01.aio.operations_async import VirtualMachinesOperations as OperationClass - elif api_version == '2018-04-01': - from ..v2018_04_01.aio.operations_async import VirtualMachinesOperations as OperationClass - elif api_version == '2018-06-01': - from ..v2018_06_01.aio.operations_async import VirtualMachinesOperations as OperationClass - elif api_version == '2018-10-01': - from ..v2018_10_01.aio.operations_async import VirtualMachinesOperations as OperationClass - elif api_version == '2019-03-01': - from ..v2019_03_01.aio.operations_async import VirtualMachinesOperations as OperationClass - elif api_version == '2019-07-01': - from ..v2019_07_01.aio.operations_async import VirtualMachinesOperations as OperationClass - elif api_version == '2019-12-01': - from ..v2019_12_01.aio.operations_async import VirtualMachinesOperations as OperationClass - else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - async def close(self): - await self._client.close() - async def __aenter__(self): - await self._client.__aenter__() - return self - async def __aexit__(self, *exc_details): - await self._client.__aexit__(*exc_details) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/aio/_configuration_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/aio/_configuration.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/aio/_configuration_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/aio/_configuration.py index d6fb50de51ba..b43a6f241903 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/aio/_configuration_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/aio/_configuration.py @@ -12,6 +12,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy from .._version import VERSION @@ -34,7 +35,6 @@ def __init__( subscription_id, # type: str **kwargs # type: Any ) -> None: - # type: (...) -> None if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: @@ -43,8 +43,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'azure-mgmt-compute/{}'.format(VERSION)) self._configure(**kwargs) @@ -56,6 +55,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) 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 9409796cec80..5d376ed3e899 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/models.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/models.py @@ -5,5 +5,6 @@ # license information. # -------------------------------------------------------------------------- from .v2019_04_01.models import * -from .v2019_11_01.models import * from .v2019_12_01.models import * +from .v2020_06_01.models import * +from .v2020_06_30.models import * diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/__init__.py index 20a4019e9c23..cdc7f7a1709a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/__init__.py @@ -10,7 +10,7 @@ __all__ = ['ComputeManagementClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass 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 a273916fd4e8..c94784b71eac 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,6 +74,7 @@ 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/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_configuration.py index 7ab3ba10366b..99872f3fd466 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -47,8 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2015-06-15" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-compute/{}'.format(VERSION)) self._configure(**kwargs) @@ -61,6 +61,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) 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 76c40d1c282e..6cdd633ceb24 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 @@ -4,7 +4,11 @@ "client": { "name": "ComputeManagementClient", "filename": "_compute_management_client", - "description": "Compute Client." + "description": "Compute Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true }, "global_parameters": { "sync_method": { @@ -41,7 +45,10 @@ }, "config": { "credential": true, - "credential_scopes": ["https://management.azure.com/.default"] + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null }, "operation_groups": { "availability_sets": "AvailabilitySetsOperations", diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/__init__.py index c8a8b4817269..9e9459635989 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._compute_management_client_async import ComputeManagementClient +from ._compute_management_client import ComputeManagementClient __all__ = ['ComputeManagementClient'] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/_compute_management_client_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/_compute_management_client.py similarity index 81% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/_compute_management_client_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/_compute_management_client.py index c8b9ccd23a08..e31ce000b06c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/_compute_management_client_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/_compute_management_client.py @@ -15,16 +15,16 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration_async import ComputeManagementClientConfiguration -from .operations_async import AvailabilitySetsOperations -from .operations_async import VirtualMachineExtensionImagesOperations -from .operations_async import VirtualMachineExtensionsOperations -from .operations_async import VirtualMachineImagesOperations -from .operations_async import UsageOperations -from .operations_async import VirtualMachineSizesOperations -from .operations_async import VirtualMachinesOperations -from .operations_async import VirtualMachineScaleSetsOperations -from .operations_async import VirtualMachineScaleSetVMsOperations +from ._configuration import ComputeManagementClientConfiguration +from .operations import AvailabilitySetsOperations +from .operations import VirtualMachineExtensionImagesOperations +from .operations import VirtualMachineExtensionsOperations +from .operations import VirtualMachineImagesOperations +from .operations import UsageOperations +from .operations import VirtualMachineSizesOperations +from .operations import VirtualMachinesOperations +from .operations import VirtualMachineScaleSetsOperations +from .operations import VirtualMachineScaleSetVMsOperations from .. import models @@ -32,23 +32,23 @@ class ComputeManagementClient(object): """Compute Client. :ivar availability_sets: AvailabilitySetsOperations operations - :vartype availability_sets: azure.mgmt.compute.v2015_06_15.aio.operations_async.AvailabilitySetsOperations + :vartype availability_sets: azure.mgmt.compute.v2015_06_15.aio.operations.AvailabilitySetsOperations :ivar virtual_machine_extension_images: VirtualMachineExtensionImagesOperations operations - :vartype virtual_machine_extension_images: azure.mgmt.compute.v2015_06_15.aio.operations_async.VirtualMachineExtensionImagesOperations + :vartype virtual_machine_extension_images: azure.mgmt.compute.v2015_06_15.aio.operations.VirtualMachineExtensionImagesOperations :ivar virtual_machine_extensions: VirtualMachineExtensionsOperations operations - :vartype virtual_machine_extensions: azure.mgmt.compute.v2015_06_15.aio.operations_async.VirtualMachineExtensionsOperations + :vartype virtual_machine_extensions: azure.mgmt.compute.v2015_06_15.aio.operations.VirtualMachineExtensionsOperations :ivar virtual_machine_images: VirtualMachineImagesOperations operations - :vartype virtual_machine_images: azure.mgmt.compute.v2015_06_15.aio.operations_async.VirtualMachineImagesOperations + :vartype virtual_machine_images: azure.mgmt.compute.v2015_06_15.aio.operations.VirtualMachineImagesOperations :ivar usage: UsageOperations operations - :vartype usage: azure.mgmt.compute.v2015_06_15.aio.operations_async.UsageOperations + :vartype usage: azure.mgmt.compute.v2015_06_15.aio.operations.UsageOperations :ivar virtual_machine_sizes: VirtualMachineSizesOperations operations - :vartype virtual_machine_sizes: azure.mgmt.compute.v2015_06_15.aio.operations_async.VirtualMachineSizesOperations + :vartype virtual_machine_sizes: azure.mgmt.compute.v2015_06_15.aio.operations.VirtualMachineSizesOperations :ivar virtual_machines: VirtualMachinesOperations operations - :vartype virtual_machines: azure.mgmt.compute.v2015_06_15.aio.operations_async.VirtualMachinesOperations + :vartype virtual_machines: azure.mgmt.compute.v2015_06_15.aio.operations.VirtualMachinesOperations :ivar virtual_machine_scale_sets: VirtualMachineScaleSetsOperations operations - :vartype virtual_machine_scale_sets: azure.mgmt.compute.v2015_06_15.aio.operations_async.VirtualMachineScaleSetsOperations + :vartype virtual_machine_scale_sets: azure.mgmt.compute.v2015_06_15.aio.operations.VirtualMachineScaleSetsOperations :ivar virtual_machine_scale_set_vms: VirtualMachineScaleSetVMsOperations operations - :vartype virtual_machine_scale_set_vms: azure.mgmt.compute.v2015_06_15.aio.operations_async.VirtualMachineScaleSetVMsOperations + :vartype virtual_machine_scale_set_vms: azure.mgmt.compute.v2015_06_15.aio.operations.VirtualMachineScaleSetVMsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. @@ -71,6 +71,7 @@ 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/aio/_configuration_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/_configuration.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/_configuration_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/_configuration.py index bfeff366b62c..a648bb88567e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/_configuration_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -44,8 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2015-06-15" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-compute/{}'.format(VERSION)) self._configure(**kwargs) @@ -57,6 +57,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations_async/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/__init__.py similarity index 52% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations_async/__init__.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/__init__.py index bad26fed75b4..e6a93279734f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations_async/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/__init__.py @@ -6,15 +6,15 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._availability_sets_operations_async import AvailabilitySetsOperations -from ._virtual_machine_extension_images_operations_async import VirtualMachineExtensionImagesOperations -from ._virtual_machine_extensions_operations_async import VirtualMachineExtensionsOperations -from ._virtual_machine_images_operations_async import VirtualMachineImagesOperations -from ._usage_operations_async import UsageOperations -from ._virtual_machine_sizes_operations_async import VirtualMachineSizesOperations -from ._virtual_machines_operations_async import VirtualMachinesOperations -from ._virtual_machine_scale_sets_operations_async import VirtualMachineScaleSetsOperations -from ._virtual_machine_scale_set_vms_operations_async import VirtualMachineScaleSetVMsOperations +from ._availability_sets_operations import AvailabilitySetsOperations +from ._virtual_machine_extension_images_operations import VirtualMachineExtensionImagesOperations +from ._virtual_machine_extensions_operations import VirtualMachineExtensionsOperations +from ._virtual_machine_images_operations import VirtualMachineImagesOperations +from ._usage_operations import UsageOperations +from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations +from ._virtual_machines_operations import VirtualMachinesOperations +from ._virtual_machine_scale_sets_operations import VirtualMachineScaleSetsOperations +from ._virtual_machine_scale_set_vms_operations import VirtualMachineScaleSetVMsOperations __all__ = [ 'AvailabilitySetsOperations', diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations_async/_availability_sets_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_availability_sets_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations_async/_availability_sets_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_availability_sets_operations.py index 1702533c3a3a..f66689e449bc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations_async/_availability_sets_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_availability_sets_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -62,10 +62,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -83,14 +86,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailabilitySet') 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 @@ -111,7 +112,7 @@ async def delete( resource_group_name: str, availability_set_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> Optional["models.OperationStatusResponse"]: """Delete an availability set. :param resource_group_name: The name of the resource group. @@ -123,10 +124,13 @@ async def delete( :rtype: ~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore @@ -143,9 +147,8 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -182,9 +185,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -201,9 +207,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -235,11 +240,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + 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 @@ -252,15 +264,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -294,7 +302,7 @@ def list_available_sizes( **kwargs ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes that can be used to create a new virtual machine in - an existing availability set. + an existing availability set. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -306,11 +314,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + 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_available_sizes.metadata['url'] # type: ignore @@ -324,15 +339,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations_async/_usage_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_usage_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations_async/_usage_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_usage_operations.py index 9076c35b0008..57e8006a4a68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations_async/_usage_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_usage_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -47,7 +47,7 @@ def list( **kwargs ) -> AsyncIterable["models.ListUsagesResult"]: """Gets, for the specified location, the current compute resource usage information as well as the - limits for compute resources under the subscription. + limits for compute resources under the subscription. :param location: The location for which resource usage is queried. :type location: str @@ -57,11 +57,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + 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 @@ -74,15 +81,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations_async/_virtual_machine_extension_images_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_extension_images_operations.py similarity index 92% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations_async/_virtual_machine_extension_images_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_extension_images_operations.py index bceb2538893b..cbb893f5a2f4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations_async/_virtual_machine_extension_images_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_extension_images_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -64,9 +64,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -85,9 +88,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -122,9 +124,12 @@ async def list_types( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self.list_types.metadata['url'] # type: ignore @@ -141,9 +146,8 @@ async def list_types( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -190,9 +194,12 @@ async def list_versions( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self.list_versions.metadata['url'] # type: ignore @@ -216,9 +223,8 @@ async def list_versions( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations_async/_virtual_machine_extensions_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_extensions_operations.py similarity index 90% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations_async/_virtual_machine_extensions_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_extensions_operations.py index a8c42a125e52..b6db7a613cdb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations_async/_virtual_machine_extensions_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_extensions_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachineExtension": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -73,14 +76,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtension') 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 @@ -88,7 +89,6 @@ async def _create_or_update_initial( 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('VirtualMachineExtension', pipeline_response) @@ -108,18 +108,18 @@ async def begin_create_or_update( vm_extension_name: str, extension_parameters: "models.VirtualMachineExtension", **kwargs - ) -> "models.VirtualMachineExtension": + ) -> AsyncLROPoller["models.VirtualMachineExtension"]: """The operation to create or update the extension. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_name: The name of the virtual machine where the extension should be created or - updated. + updated. :type vm_name: str :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Create Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineExtension :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. @@ -127,8 +127,8 @@ async def begin_create_or_update( 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: VirtualMachineExtension, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineExtension + :return: An instance of AsyncLROPoller that returns either VirtualMachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -181,10 +181,13 @@ async def _update_initial( **kwargs ) -> "models.VirtualMachineExtension": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -203,14 +206,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtensionUpdate') 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 @@ -233,7 +234,7 @@ async def begin_update( vm_extension_name: str, extension_parameters: "models.VirtualMachineExtensionUpdate", **kwargs - ) -> "models.VirtualMachineExtension": + ) -> AsyncLROPoller["models.VirtualMachineExtension"]: """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -243,7 +244,7 @@ async def begin_update( :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Update Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineExtensionUpdate :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. @@ -251,8 +252,8 @@ async def begin_update( 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: VirtualMachineExtension, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineExtension + :return: An instance of AsyncLROPoller that returns either VirtualMachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -302,11 +303,14 @@ async def _delete_initial( vm_name: str, vm_extension_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -324,9 +328,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -351,7 +354,7 @@ async def begin_delete( vm_name: str, vm_extension_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -366,8 +369,8 @@ async def begin_delete( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -434,9 +437,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -456,9 +462,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations_async/_virtual_machine_images_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_images_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations_async/_virtual_machine_images_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_images_operations.py index d86c26cc5571..a4dd4ea86a6a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations_async/_virtual_machine_images_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_images_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -67,9 +67,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -89,9 +92,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -142,9 +144,12 @@ async def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -169,9 +174,8 @@ async def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -206,9 +210,12 @@ async def list_offers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self.list_offers.metadata['url'] # type: ignore @@ -225,9 +232,8 @@ async def list_offers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -259,9 +265,12 @@ async def list_publishers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self.list_publishers.metadata['url'] # type: ignore @@ -277,9 +286,8 @@ async def list_publishers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -317,9 +325,12 @@ async def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self.list_skus.metadata['url'] # type: ignore @@ -337,9 +348,8 @@ async def list_skus( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations_async/_virtual_machine_scale_set_vms_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_scale_set_vms_operations.py similarity index 87% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations_async/_virtual_machine_scale_set_vms_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_scale_set_vms_operations.py index bbf1b5ec41b6..29c09ac2d052 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations_async/_virtual_machine_scale_set_vms_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -49,11 +49,14 @@ async def _reimage_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self._reimage_initial.metadata['url'] # type: ignore @@ -71,9 +74,8 @@ async def _reimage_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -98,7 +100,7 @@ async def begin_reimage( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -113,8 +115,8 @@ async def begin_reimage( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -163,11 +165,14 @@ async def _deallocate_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self._deallocate_initial.metadata['url'] # type: ignore @@ -185,9 +190,8 @@ async def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -212,10 +216,10 @@ async def begin_deallocate( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and - releases the compute resources it uses. You are not billed for the compute resources of this - virtual machine once it is deallocated. + releases the compute resources it uses. You are not billed for the compute resources of this + virtual machine once it is deallocated. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -229,8 +233,8 @@ async def begin_deallocate( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -279,11 +283,14 @@ async def _delete_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -301,9 +308,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -328,7 +334,7 @@ async def begin_delete( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Deletes a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -343,8 +349,8 @@ async def begin_delete( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -408,9 +414,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -428,9 +437,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -468,9 +476,12 @@ async def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -488,9 +499,8 @@ async def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -522,11 +532,14 @@ def list( :type resource_group_name: str :param virtual_machine_scale_set_name: The name of the VM scale set. :type virtual_machine_scale_set_name: str - :param filter: The filter to apply to the operation. + :param filter: The filter to apply to the operation. Allowed values are + 'startswith(instanceView/statuses/code, 'PowerState') eq true', 'properties/latestModelApplied + eq true', 'properties/latestModelApplied eq false'. :type filter: str - :param select: The list parameters. + :param select: The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. :type select: str - :param expand: The expand expression to apply to the operation. + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetVMListResult or the result of cls(response) @@ -534,11 +547,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + 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 @@ -558,15 +578,11 @@ def prepare_request(next_link=None): query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -599,11 +615,14 @@ async def _power_off_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self._power_off_initial.metadata['url'] # type: ignore @@ -621,9 +640,8 @@ async def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -648,10 +666,10 @@ async def begin_power_off( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached - and you are getting charged for the resources. Instead, use deallocate to release resources and - avoid charges. + and you are getting charged for the resources. Instead, use deallocate to release resources and + avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -665,8 +683,8 @@ async def begin_power_off( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -715,11 +733,14 @@ async def _restart_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self._restart_initial.metadata['url'] # type: ignore @@ -737,9 +758,8 @@ async def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -764,7 +784,7 @@ async def begin_restart( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Restarts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -779,8 +799,8 @@ async def begin_restart( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -829,11 +849,14 @@ async def _start_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self._start_initial.metadata['url'] # type: ignore @@ -851,9 +874,8 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -878,7 +900,7 @@ async def begin_start( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Starts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -893,8 +915,8 @@ async def begin_start( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations_async/_virtual_machine_scale_sets_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_scale_sets_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations_async/_virtual_machine_scale_sets_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_scale_sets_operations.py index 3011aaff0e03..09c17b45d643 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations_async/_virtual_machine_scale_sets_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_scale_sets_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachineScaleSet": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSet') 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('VirtualMachineScaleSet', pipeline_response) @@ -106,7 +106,7 @@ async def begin_create_or_update( name: str, parameters: "models.VirtualMachineScaleSet", **kwargs - ) -> "models.VirtualMachineScaleSet": + ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -121,8 +121,8 @@ async def begin_create_or_update( 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: VirtualMachineScaleSet, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineScaleSet + :return: An instance of AsyncLROPoller that returns either VirtualMachineScaleSet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineScaleSet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -170,11 +170,14 @@ async def _delete_initial( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -191,9 +194,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -217,7 +219,7 @@ async def begin_delete( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Deletes a VM scale set. :param resource_group_name: The name of the resource group. @@ -230,8 +232,8 @@ async def begin_delete( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -291,9 +293,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -310,9 +315,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -335,12 +339,15 @@ async def _deallocate_initial( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._deallocate_initial.metadata['url'] # type: ignore @@ -358,9 +365,8 @@ async def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -368,7 +374,6 @@ async def _deallocate_initial( body_content = None 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 @@ -392,10 +397,10 @@ async def begin_deallocate( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and - releases the compute resources. You are not billed for the compute resources that this virtual - machine scale set deallocates. + releases the compute resources. You are not billed for the compute resources that this virtual + machine scale set deallocates. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -409,8 +414,8 @@ async def begin_deallocate( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,12 +464,15 @@ async def _delete_instances_initial( vm_scale_set_name: str, vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._delete_instances_initial.metadata['url'] # type: ignore @@ -482,14 +490,12 @@ async def _delete_instances_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -513,7 +519,7 @@ async def begin_delete_instances( vm_scale_set_name: str, vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Deletes virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -528,8 +534,8 @@ async def begin_delete_instances( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -590,9 +596,12 @@ async def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -609,9 +618,8 @@ async def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -643,11 +651,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + 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 @@ -660,15 +675,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -700,8 +711,8 @@ def list_all( **kwargs ) -> AsyncIterable["models.VirtualMachineScaleSetListWithLinkResult"]: """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource - group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this - till nextLink is null to fetch all the VM Scale Sets. + group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this + till nextLink is null to fetch all the VM Scale Sets. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetListWithLinkResult or the result of cls(response) @@ -709,11 +720,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + 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_all.metadata['url'] # type: ignore @@ -725,15 +743,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -767,7 +781,7 @@ def list_skus( **kwargs ) -> AsyncIterable["models.VirtualMachineScaleSetListSkusResult"]: """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM - instances allowed for each SKU. + instances allowed for each SKU. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -779,11 +793,18 @@ def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + 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_skus.metadata['url'] # type: ignore @@ -797,15 +818,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -838,12 +855,15 @@ async def _power_off_initial( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._power_off_initial.metadata['url'] # type: ignore @@ -861,9 +881,8 @@ async def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -871,7 +890,6 @@ async def _power_off_initial( body_content = None 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 @@ -895,10 +913,10 @@ async def begin_power_off( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still - attached and you are getting charged for the resources. Instead, use deallocate to release - resources and avoid charges. + attached and you are getting charged for the resources. Instead, use deallocate to release + resources and avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -912,8 +930,8 @@ async def begin_power_off( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -962,12 +980,15 @@ async def _restart_initial( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._restart_initial.metadata['url'] # type: ignore @@ -985,9 +1006,8 @@ async def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -995,7 +1015,6 @@ async def _restart_initial( body_content = None 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 @@ -1019,7 +1038,7 @@ async def begin_restart( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Restarts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1034,8 +1053,8 @@ async def begin_restart( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1084,12 +1103,15 @@ async def _start_initial( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._start_initial.metadata['url'] # type: ignore @@ -1107,9 +1129,8 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1117,7 +1138,6 @@ async def _start_initial( body_content = None 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 @@ -1141,7 +1161,7 @@ async def begin_start( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Starts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1156,8 +1176,8 @@ async def begin_start( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1206,12 +1226,15 @@ async def _update_instances_initial( vm_scale_set_name: str, vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_instances_initial.metadata['url'] # type: ignore @@ -1229,14 +1252,12 @@ async def _update_instances_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -1260,7 +1281,7 @@ async def begin_update_instances( vm_scale_set_name: str, vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. :param resource_group_name: The name of the resource group. @@ -1275,8 +1296,8 @@ async def begin_update_instances( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1324,11 +1345,14 @@ async def _reimage_initial( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self._reimage_initial.metadata['url'] # type: ignore @@ -1345,9 +1369,8 @@ async def _reimage_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1371,7 +1394,7 @@ async def begin_reimage( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1384,8 +1407,8 @@ async def begin_reimage( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations_async/_virtual_machine_sizes_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_sizes_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations_async/_virtual_machine_sizes_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_sizes_operations.py index bfe09670487b..267401a2f3d6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations_async/_virtual_machine_sizes_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_sizes_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,11 +56,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + 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 @@ -73,15 +80,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations_async/_virtual_machines_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machines_operations.py similarity index 87% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations_async/_virtual_machines_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machines_operations.py index 0f19b419bfc1..a149f9380a26 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations_async/_virtual_machines_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machines_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -49,12 +49,15 @@ async def _capture_initial( vm_name: str, parameters: "models.VirtualMachineCaptureParameters", **kwargs - ) -> "models.VirtualMachineCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.VirtualMachineCaptureResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._capture_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _capture_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineCaptureParameters') 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 @@ -103,9 +104,9 @@ async def begin_capture( vm_name: str, parameters: "models.VirtualMachineCaptureParameters", **kwargs - ) -> "models.VirtualMachineCaptureResult": + ) -> AsyncLROPoller["models.VirtualMachineCaptureResult"]: """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used - to create similar VMs. + to create similar VMs. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -119,8 +120,8 @@ async def begin_capture( 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: VirtualMachineCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineCaptureResult + :return: An instance of AsyncLROPoller that returns either VirtualMachineCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineCaptureResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -171,10 +172,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachine": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -192,14 +196,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachine') 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 @@ -207,7 +209,6 @@ async def _create_or_update_initial( 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('VirtualMachine', pipeline_response) @@ -226,7 +227,7 @@ async def begin_create_or_update( vm_name: str, parameters: "models.VirtualMachine", **kwargs - ) -> "models.VirtualMachine": + ) -> AsyncLROPoller["models.VirtualMachine"]: """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -241,8 +242,8 @@ async def begin_create_or_update( 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: VirtualMachine, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2015_06_15.models.VirtualMachine + :return: An instance of AsyncLROPoller that returns either VirtualMachine or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2015_06_15.models.VirtualMachine] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -290,11 +291,14 @@ async def _delete_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -311,9 +315,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -337,7 +340,7 @@ async def begin_delete( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """The operation to delete a virtual machine. :param resource_group_name: The name of the resource group. @@ -350,8 +353,8 @@ async def begin_delete( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -414,9 +417,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -435,9 +441,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -459,11 +464,14 @@ async def _deallocate_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self._deallocate_initial.metadata['url'] # type: ignore @@ -480,9 +488,8 @@ async def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -506,9 +513,9 @@ async def begin_deallocate( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Shuts down the virtual machine and releases the compute resources. You are not billed for the - compute resources that this virtual machine uses. + compute resources that this virtual machine uses. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -520,8 +527,8 @@ async def begin_deallocate( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -581,9 +588,12 @@ async def generalize( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self.generalize.metadata['url'] # type: ignore @@ -600,9 +610,8 @@ async def generalize( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -625,7 +634,7 @@ def list( **kwargs ) -> AsyncIterable["models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified resource group. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -635,11 +644,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + 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 @@ -652,15 +668,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -692,7 +704,7 @@ def list_all( **kwargs ) -> AsyncIterable["models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified subscription. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineListResult or the result of cls(response) @@ -700,11 +712,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + 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_all.metadata['url'] # type: ignore @@ -716,15 +735,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -758,7 +773,7 @@ def list_available_sizes( **kwargs ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes to which the specified virtual machine can be - resized. + resized. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -770,11 +785,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + 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_available_sizes.metadata['url'] # type: ignore @@ -788,15 +810,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -828,11 +846,14 @@ async def _power_off_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self._power_off_initial.metadata['url'] # type: ignore @@ -849,9 +870,8 @@ async def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -875,9 +895,9 @@ async def begin_power_off( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with - the same provisioned resources. You are still charged for this virtual machine. + the same provisioned resources. You are still charged for this virtual machine. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -889,8 +909,8 @@ async def begin_power_off( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -937,11 +957,14 @@ async def _restart_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self._restart_initial.metadata['url'] # type: ignore @@ -958,9 +981,8 @@ async def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -984,7 +1006,7 @@ async def begin_restart( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """The operation to restart a virtual machine. :param resource_group_name: The name of the resource group. @@ -997,8 +1019,8 @@ async def begin_restart( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1045,11 +1067,14 @@ async def _start_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self._start_initial.metadata['url'] # type: ignore @@ -1066,9 +1091,8 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1092,7 +1116,7 @@ async def begin_start( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """The operation to start a virtual machine. :param resource_group_name: The name of the resource group. @@ -1105,8 +1129,8 @@ async def begin_start( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1153,11 +1177,14 @@ async def _redeploy_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self._redeploy_initial.metadata['url'] # type: ignore @@ -1174,9 +1201,8 @@ async def _redeploy_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1200,7 +1226,7 @@ async def begin_redeploy( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Shuts down the virtual machine, moves it to a new node, and powers it back on. :param resource_group_name: The name of the resource group. @@ -1213,8 +1239,8 @@ async def begin_redeploy( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/_compute_management_client_enums.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/_compute_management_client_enums.py index d822d1da4938..b1f0315e9e09 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/_compute_management_client_enums.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/_compute_management_client_enums.py @@ -6,20 +6,38 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum - -class CachingTypes(str, Enum): +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class CachingTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the caching requirements. :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **None** :code:`
`:code:`
` **ReadOnly** :code:`
`:code:`
` **ReadWrite** :code:`
`:code:`
` Default: **None for Standard storage. ReadOnly for Premium storage** """ - none = "None" - read_only = "ReadOnly" - read_write = "ReadWrite" + NONE = "None" + READ_ONLY = "ReadOnly" + READ_WRITE = "ReadWrite" -class DiskCreateOptionTypes(str, Enum): +class DiskCreateOptionTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies how the virtual machine should be created.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` **Attach** \u2013 This value is used when you are using a specialized disk to create the virtual machine.:code:`
`:code:`
` **FromImage** \u2013 @@ -28,42 +46,42 @@ class DiskCreateOptionTypes(str, Enum): marketplace image, you also use the plan element previously described. """ - from_image = "FromImage" - empty = "Empty" - attach = "Attach" + FROM_IMAGE = "FromImage" + EMPTY = "Empty" + ATTACH = "Attach" -class OperatingSystemTypes(str, Enum): +class OperatingSystemTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The operating system of the osDiskImage. """ - windows = "Windows" - linux = "Linux" + WINDOWS = "Windows" + LINUX = "Linux" -class ProtocolTypes(str, Enum): +class ProtocolTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the protocol of listener. :code:`
`:code:`
` Possible values are: :code:`
`\ **http** :code:`
`:code:`
` **https** """ - http = "Http" - https = "Https" + HTTP = "Http" + HTTPS = "Https" -class SettingNames(str, Enum): +class SettingNames(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon. """ - auto_logon = "AutoLogon" - first_logon_commands = "FirstLogonCommands" + AUTO_LOGON = "AutoLogon" + FIRST_LOGON_COMMANDS = "FirstLogonCommands" -class StatusLevelTypes(str, Enum): +class StatusLevelTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The level code. """ - info = "Info" - warning = "Warning" - error = "Error" + INFO = "Info" + WARNING = "Warning" + ERROR = "Error" -class UpgradeMode(str, Enum): +class UpgradeMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the mode of an upgrade to virtual machines in the scale set.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` **Manual** - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade @@ -71,17 +89,17 @@ class UpgradeMode(str, Enum): automatically updated at the same time. """ - automatic = "Automatic" - manual = "Manual" + AUTOMATIC = "Automatic" + MANUAL = "Manual" -class VirtualMachineScaleSetSkuScaleType(str, Enum): +class VirtualMachineScaleSetSkuScaleType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The scale type applicable to the sku. """ - automatic = "Automatic" - none = "None" + AUTOMATIC = "Automatic" + NONE = "None" -class VirtualMachineSizeTypes(str, Enum): +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 `_. @@ -95,55 +113,55 @@ class VirtualMachineSizeTypes(str, Enum): `_ """ - basic_a0 = "Basic_A0" - basic_a1 = "Basic_A1" - basic_a2 = "Basic_A2" - basic_a3 = "Basic_A3" - basic_a4 = "Basic_A4" - standard_a0 = "Standard_A0" - standard_a1 = "Standard_A1" - standard_a2 = "Standard_A2" - standard_a3 = "Standard_A3" - standard_a4 = "Standard_A4" - standard_a5 = "Standard_A5" - standard_a6 = "Standard_A6" - standard_a7 = "Standard_A7" - standard_a8 = "Standard_A8" - standard_a9 = "Standard_A9" - standard_a10 = "Standard_A10" - standard_a11 = "Standard_A11" - standard_d1 = "Standard_D1" - standard_d2 = "Standard_D2" - standard_d3 = "Standard_D3" - standard_d4 = "Standard_D4" - standard_d11 = "Standard_D11" - standard_d12 = "Standard_D12" - standard_d13 = "Standard_D13" - standard_d14 = "Standard_D14" - standard_d1_v2 = "Standard_D1_v2" - standard_d2_v2 = "Standard_D2_v2" - standard_d3_v2 = "Standard_D3_v2" - standard_d4_v2 = "Standard_D4_v2" - standard_d5_v2 = "Standard_D5_v2" - standard_d11_v2 = "Standard_D11_v2" - standard_d12_v2 = "Standard_D12_v2" - standard_d13_v2 = "Standard_D13_v2" - standard_d14_v2 = "Standard_D14_v2" - standard_ds1 = "Standard_DS1" - standard_ds2 = "Standard_DS2" - standard_ds3 = "Standard_DS3" - standard_ds4 = "Standard_DS4" - standard_ds11 = "Standard_DS11" - standard_ds12 = "Standard_DS12" - standard_ds13 = "Standard_DS13" - standard_ds14 = "Standard_DS14" - standard_g1 = "Standard_G1" - standard_g2 = "Standard_G2" - standard_g3 = "Standard_G3" - standard_g4 = "Standard_G4" - standard_g5 = "Standard_G5" - standard_gs1 = "Standard_GS1" - standard_gs2 = "Standard_GS2" - standard_gs3 = "Standard_GS3" - standard_gs4 = "Standard_GS4" - standard_gs5 = "Standard_GS5" + BASIC_A0 = "Basic_A0" + BASIC_A1 = "Basic_A1" + BASIC_A2 = "Basic_A2" + BASIC_A3 = "Basic_A3" + BASIC_A4 = "Basic_A4" + STANDARD_A0 = "Standard_A0" + STANDARD_A1 = "Standard_A1" + STANDARD_A2 = "Standard_A2" + STANDARD_A3 = "Standard_A3" + STANDARD_A4 = "Standard_A4" + STANDARD_A5 = "Standard_A5" + STANDARD_A6 = "Standard_A6" + STANDARD_A7 = "Standard_A7" + STANDARD_A8 = "Standard_A8" + STANDARD_A9 = "Standard_A9" + STANDARD_A10 = "Standard_A10" + STANDARD_A11 = "Standard_A11" + STANDARD_D1 = "Standard_D1" + STANDARD_D2 = "Standard_D2" + STANDARD_D3 = "Standard_D3" + STANDARD_D4 = "Standard_D4" + STANDARD_D11 = "Standard_D11" + STANDARD_D12 = "Standard_D12" + STANDARD_D13 = "Standard_D13" + STANDARD_D14 = "Standard_D14" + STANDARD_D1_V2 = "Standard_D1_v2" + STANDARD_D2_V2 = "Standard_D2_v2" + STANDARD_D3_V2 = "Standard_D3_v2" + STANDARD_D4_V2 = "Standard_D4_v2" + STANDARD_D5_V2 = "Standard_D5_v2" + STANDARD_D11_V2 = "Standard_D11_v2" + STANDARD_D12_V2 = "Standard_D12_v2" + STANDARD_D13_V2 = "Standard_D13_v2" + STANDARD_D14_V2 = "Standard_D14_v2" + STANDARD_DS1 = "Standard_DS1" + STANDARD_DS2 = "Standard_DS2" + STANDARD_DS3 = "Standard_DS3" + STANDARD_DS4 = "Standard_DS4" + STANDARD_DS11 = "Standard_DS11" + STANDARD_DS12 = "Standard_DS12" + STANDARD_DS13 = "Standard_DS13" + STANDARD_DS14 = "Standard_DS14" + STANDARD_G1 = "Standard_G1" + STANDARD_G2 = "Standard_G2" + STANDARD_G3 = "Standard_G3" + STANDARD_G4 = "Standard_G4" + STANDARD_G5 = "Standard_G5" + STANDARD_GS1 = "Standard_GS1" + STANDARD_GS2 = "Standard_GS2" + STANDARD_GS3 = "Standard_GS3" + STANDARD_GS4 = "Standard_GS4" + STANDARD_GS5 = "Standard_GS5" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_availability_sets_operations.py index 118bfbe1a098..7770838844af 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_availability_sets_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -67,10 +67,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -88,14 +91,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailabilitySet') 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 @@ -117,7 +118,7 @@ def delete( availability_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" + # type: (...) -> Optional["models.OperationStatusResponse"] """Delete an availability set. :param resource_group_name: The name of the resource group. @@ -129,10 +130,13 @@ def delete( :rtype: ~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore @@ -149,9 +153,8 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -189,9 +192,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -208,9 +214,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -243,11 +248,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + 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 @@ -260,15 +272,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -303,7 +311,7 @@ def list_available_sizes( ): # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes that can be used to create a new virtual machine in - an existing availability set. + an existing availability set. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -315,11 +323,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + 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_available_sizes.metadata['url'] # type: ignore @@ -333,15 +348,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_usage_operations.py index d0269ca69b67..30c808333082 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_usage_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,7 +52,7 @@ def list( ): # type: (...) -> Iterable["models.ListUsagesResult"] """Gets, for the specified location, the current compute resource usage information as well as the - limits for compute resources under the subscription. + limits for compute resources under the subscription. :param location: The location for which resource usage is queried. :type location: str @@ -62,11 +62,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + 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 @@ -79,15 +86,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_extension_images_operations.py index a2a6435bda92..23bad4e68d51 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_extension_images_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -69,9 +69,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -90,9 +93,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -128,9 +130,12 @@ def list_types( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self.list_types.metadata['url'] # type: ignore @@ -147,9 +152,8 @@ def list_types( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -197,9 +201,12 @@ def list_versions( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self.list_versions.metadata['url'] # type: ignore @@ -223,9 +230,8 @@ def list_versions( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_extensions_operations.py index f6f063d3031a..0c84661fabd0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_extensions_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachineExtension" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -78,14 +81,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtension') 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 @@ -93,7 +94,6 @@ def _create_or_update_initial( 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('VirtualMachineExtension', pipeline_response) @@ -114,18 +114,18 @@ def begin_create_or_update( extension_parameters, # type: "models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineExtension"] """The operation to create or update the extension. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_name: The name of the virtual machine where the extension should be created or - updated. + updated. :type vm_name: str :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Create Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineExtension :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. @@ -188,10 +188,13 @@ def _update_initial( ): # type: (...) -> "models.VirtualMachineExtension" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -210,14 +213,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtensionUpdate') 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 @@ -241,7 +242,7 @@ def begin_update( extension_parameters, # type: "models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineExtension"] """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -251,7 +252,7 @@ def begin_update( :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Update Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineExtensionUpdate :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. @@ -311,11 +312,14 @@ def _delete_initial( vm_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -333,9 +337,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -361,7 +364,7 @@ def begin_delete( vm_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -445,9 +448,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -467,9 +473,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_images_operations.py index d58c00efb0f4..9842bfb00836 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_images_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -72,9 +72,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -94,9 +97,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -148,9 +150,12 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -175,9 +180,8 @@ def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -213,9 +217,12 @@ def list_offers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self.list_offers.metadata['url'] # type: ignore @@ -232,9 +239,8 @@ def list_offers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -267,9 +273,12 @@ def list_publishers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self.list_publishers.metadata['url'] # type: ignore @@ -285,9 +294,8 @@ def list_publishers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -326,9 +334,12 @@ def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self.list_skus.metadata['url'] # type: ignore @@ -346,9 +357,8 @@ def list_skus( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_scale_set_vms_operations.py index 9d725b857e70..d20a8607ac48 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_scale_set_vms_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -54,11 +54,14 @@ def _reimage_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self._reimage_initial.metadata['url'] # type: ignore @@ -76,9 +79,8 @@ def _reimage_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -104,7 +106,7 @@ def begin_reimage( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -170,11 +172,14 @@ def _deallocate_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self._deallocate_initial.metadata['url'] # type: ignore @@ -192,9 +197,8 @@ def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -220,10 +224,10 @@ def begin_deallocate( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and - releases the compute resources it uses. You are not billed for the compute resources of this - virtual machine once it is deallocated. + releases the compute resources it uses. You are not billed for the compute resources of this + virtual machine once it is deallocated. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -288,11 +292,14 @@ def _delete_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -310,9 +317,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -338,7 +344,7 @@ def begin_delete( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Deletes a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -419,9 +425,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -439,9 +448,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -480,9 +488,12 @@ def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -500,9 +511,8 @@ def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -535,11 +545,14 @@ def list( :type resource_group_name: str :param virtual_machine_scale_set_name: The name of the VM scale set. :type virtual_machine_scale_set_name: str - :param filter: The filter to apply to the operation. + :param filter: The filter to apply to the operation. Allowed values are + 'startswith(instanceView/statuses/code, 'PowerState') eq true', 'properties/latestModelApplied + eq true', 'properties/latestModelApplied eq false'. :type filter: str - :param select: The list parameters. + :param select: The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. :type select: str - :param expand: The expand expression to apply to the operation. + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetVMListResult or the result of cls(response) @@ -547,11 +560,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + 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 @@ -571,15 +591,11 @@ def prepare_request(next_link=None): query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -613,11 +629,14 @@ def _power_off_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self._power_off_initial.metadata['url'] # type: ignore @@ -635,9 +654,8 @@ def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -663,10 +681,10 @@ def begin_power_off( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached - and you are getting charged for the resources. Instead, use deallocate to release resources and - avoid charges. + and you are getting charged for the resources. Instead, use deallocate to release resources and + avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -731,11 +749,14 @@ def _restart_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self._restart_initial.metadata['url'] # type: ignore @@ -753,9 +774,8 @@ def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -781,7 +801,7 @@ def begin_restart( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Restarts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -847,11 +867,14 @@ def _start_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self._start_initial.metadata['url'] # type: ignore @@ -869,9 +892,8 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -897,7 +919,7 @@ def begin_start( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Starts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_scale_sets_operations.py index 83ccb97aebb6..b66c03dd4203 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_scale_sets_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachineScaleSet" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSet') 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('VirtualMachineScaleSet', pipeline_response) @@ -112,7 +112,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualMachineScaleSet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -177,11 +177,14 @@ def _delete_initial( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -198,9 +201,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -225,7 +227,7 @@ def begin_delete( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Deletes a VM scale set. :param resource_group_name: The name of the resource group. @@ -300,9 +302,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -319,9 +324,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -345,12 +349,15 @@ def _deallocate_initial( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._deallocate_initial.metadata['url'] # type: ignore @@ -368,9 +375,8 @@ def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -378,7 +384,6 @@ def _deallocate_initial( body_content = None 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 @@ -403,10 +408,10 @@ def begin_deallocate( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and - releases the compute resources. You are not billed for the compute resources that this virtual - machine scale set deallocates. + releases the compute resources. You are not billed for the compute resources that this virtual + machine scale set deallocates. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -471,12 +476,15 @@ def _delete_instances_initial( vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._delete_instances_initial.metadata['url'] # type: ignore @@ -494,14 +502,12 @@ def _delete_instances_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -526,7 +532,7 @@ def begin_delete_instances( vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Deletes virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -604,9 +610,12 @@ def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -623,9 +632,8 @@ def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -658,11 +666,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + 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 @@ -675,15 +690,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -716,8 +727,8 @@ def list_all( ): # type: (...) -> Iterable["models.VirtualMachineScaleSetListWithLinkResult"] """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource - group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this - till nextLink is null to fetch all the VM Scale Sets. + group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this + till nextLink is null to fetch all the VM Scale Sets. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetListWithLinkResult or the result of cls(response) @@ -725,11 +736,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + 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_all.metadata['url'] # type: ignore @@ -741,15 +759,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -784,7 +798,7 @@ def list_skus( ): # type: (...) -> Iterable["models.VirtualMachineScaleSetListSkusResult"] """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM - instances allowed for each SKU. + instances allowed for each SKU. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -796,11 +810,18 @@ def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + 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_skus.metadata['url'] # type: ignore @@ -814,15 +835,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -856,12 +873,15 @@ def _power_off_initial( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._power_off_initial.metadata['url'] # type: ignore @@ -879,9 +899,8 @@ def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -889,7 +908,6 @@ def _power_off_initial( body_content = None 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 @@ -914,10 +932,10 @@ def begin_power_off( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still - attached and you are getting charged for the resources. Instead, use deallocate to release - resources and avoid charges. + attached and you are getting charged for the resources. Instead, use deallocate to release + resources and avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -982,12 +1000,15 @@ def _restart_initial( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._restart_initial.metadata['url'] # type: ignore @@ -1005,9 +1026,8 @@ def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1015,7 +1035,6 @@ def _restart_initial( body_content = None 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 @@ -1040,7 +1059,7 @@ def begin_restart( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Restarts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1106,12 +1125,15 @@ def _start_initial( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._start_initial.metadata['url'] # type: ignore @@ -1129,9 +1151,8 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1139,7 +1160,6 @@ def _start_initial( body_content = None 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 @@ -1164,7 +1184,7 @@ def begin_start( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Starts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1230,12 +1250,15 @@ def _update_instances_initial( vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_instances_initial.metadata['url'] # type: ignore @@ -1253,14 +1276,12 @@ def _update_instances_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -1285,7 +1306,7 @@ def begin_update_instances( vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. :param resource_group_name: The name of the resource group. @@ -1350,11 +1371,14 @@ def _reimage_initial( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self._reimage_initial.metadata['url'] # type: ignore @@ -1371,9 +1395,8 @@ def _reimage_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1398,7 +1421,7 @@ def begin_reimage( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_sizes_operations.py index 32379031f0df..1eabae8491b1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_sizes_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -61,11 +61,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + 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 @@ -78,15 +85,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machines_operations.py index 3c9dc5a8d63b..facff4823b7f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machines_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -54,12 +54,15 @@ def _capture_initial( parameters, # type: "models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._capture_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _capture_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineCaptureParameters') 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 @@ -109,9 +110,9 @@ def begin_capture( parameters, # type: "models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineCaptureResult"] """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used - to create similar VMs. + to create similar VMs. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -178,10 +179,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachine" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -199,14 +203,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachine') 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 @@ -214,7 +216,6 @@ def _create_or_update_initial( 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('VirtualMachine', pipeline_response) @@ -234,7 +235,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualMachine" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachine"] """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -299,11 +300,14 @@ def _delete_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -320,9 +324,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -347,7 +350,7 @@ def begin_delete( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """The operation to delete a virtual machine. :param resource_group_name: The name of the resource group. @@ -425,9 +428,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -446,9 +452,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -471,11 +476,14 @@ def _deallocate_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self._deallocate_initial.metadata['url'] # type: ignore @@ -492,9 +500,8 @@ def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -519,9 +526,9 @@ def begin_deallocate( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Shuts down the virtual machine and releases the compute resources. You are not billed for the - compute resources that this virtual machine uses. + compute resources that this virtual machine uses. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -595,9 +602,12 @@ def generalize( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self.generalize.metadata['url'] # type: ignore @@ -614,9 +624,8 @@ def generalize( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -640,7 +649,7 @@ def list( ): # type: (...) -> Iterable["models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified resource group. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -650,11 +659,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + 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 @@ -667,15 +683,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -708,7 +720,7 @@ def list_all( ): # type: (...) -> Iterable["models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified subscription. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineListResult or the result of cls(response) @@ -716,11 +728,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + 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_all.metadata['url'] # type: ignore @@ -732,15 +751,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -775,7 +790,7 @@ def list_available_sizes( ): # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes to which the specified virtual machine can be - resized. + resized. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -787,11 +802,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + 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_available_sizes.metadata['url'] # type: ignore @@ -805,15 +827,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -846,11 +864,14 @@ def _power_off_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self._power_off_initial.metadata['url'] # type: ignore @@ -867,9 +888,8 @@ def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -894,9 +914,9 @@ def begin_power_off( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with - the same provisioned resources. You are still charged for this virtual machine. + the same provisioned resources. You are still charged for this virtual machine. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -957,11 +977,14 @@ def _restart_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self._restart_initial.metadata['url'] # type: ignore @@ -978,9 +1001,8 @@ def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1005,7 +1027,7 @@ def begin_restart( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """The operation to restart a virtual machine. :param resource_group_name: The name of the resource group. @@ -1067,11 +1089,14 @@ def _start_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self._start_initial.metadata['url'] # type: ignore @@ -1088,9 +1113,8 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1115,7 +1139,7 @@ def begin_start( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """The operation to start a virtual machine. :param resource_group_name: The name of the resource group. @@ -1177,11 +1201,14 @@ def _redeploy_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" + accept = "application/json" # Construct URL url = self._redeploy_initial.metadata['url'] # type: ignore @@ -1198,9 +1225,8 @@ def _redeploy_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1225,7 +1251,7 @@ def begin_redeploy( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Shuts down the virtual machine, moves it to a new node, and powers it back on. :param resource_group_name: The name of the resource group. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/__init__.py index 20a4019e9c23..cdc7f7a1709a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/__init__.py @@ -10,7 +10,7 @@ __all__ = ['ComputeManagementClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass 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 7edb8482424a..8e306e622dbd 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,6 +74,7 @@ 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/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_configuration.py index 7cc81e9f9e25..d237e2ac1d5e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -47,8 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2016-03-30" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-compute/{}'.format(VERSION)) self._configure(**kwargs) @@ -61,6 +61,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) 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 0ad819868e09..93672d359ba3 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 @@ -4,7 +4,11 @@ "client": { "name": "ComputeManagementClient", "filename": "_compute_management_client", - "description": "Compute Client." + "description": "Compute Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true }, "global_parameters": { "sync_method": { @@ -41,7 +45,10 @@ }, "config": { "credential": true, - "credential_scopes": ["https://management.azure.com/.default"] + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null }, "operation_groups": { "availability_sets": "AvailabilitySetsOperations", diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/__init__.py index c8a8b4817269..9e9459635989 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._compute_management_client_async import ComputeManagementClient +from ._compute_management_client import ComputeManagementClient __all__ = ['ComputeManagementClient'] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/_compute_management_client_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/_compute_management_client.py similarity index 81% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/_compute_management_client_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/_compute_management_client.py index 0bb1f04ad433..ad94a530b8f9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/_compute_management_client_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/_compute_management_client.py @@ -15,16 +15,16 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration_async import ComputeManagementClientConfiguration -from .operations_async import AvailabilitySetsOperations -from .operations_async import VirtualMachineExtensionImagesOperations -from .operations_async import VirtualMachineExtensionsOperations -from .operations_async import VirtualMachinesOperations -from .operations_async import VirtualMachineImagesOperations -from .operations_async import UsageOperations -from .operations_async import VirtualMachineSizesOperations -from .operations_async import VirtualMachineScaleSetsOperations -from .operations_async import VirtualMachineScaleSetVMsOperations +from ._configuration import ComputeManagementClientConfiguration +from .operations import AvailabilitySetsOperations +from .operations import VirtualMachineExtensionImagesOperations +from .operations import VirtualMachineExtensionsOperations +from .operations import VirtualMachinesOperations +from .operations import VirtualMachineImagesOperations +from .operations import UsageOperations +from .operations import VirtualMachineSizesOperations +from .operations import VirtualMachineScaleSetsOperations +from .operations import VirtualMachineScaleSetVMsOperations from .. import models @@ -32,23 +32,23 @@ class ComputeManagementClient(object): """Compute Client. :ivar availability_sets: AvailabilitySetsOperations operations - :vartype availability_sets: azure.mgmt.compute.v2016_03_30.aio.operations_async.AvailabilitySetsOperations + :vartype availability_sets: azure.mgmt.compute.v2016_03_30.aio.operations.AvailabilitySetsOperations :ivar virtual_machine_extension_images: VirtualMachineExtensionImagesOperations operations - :vartype virtual_machine_extension_images: azure.mgmt.compute.v2016_03_30.aio.operations_async.VirtualMachineExtensionImagesOperations + :vartype virtual_machine_extension_images: azure.mgmt.compute.v2016_03_30.aio.operations.VirtualMachineExtensionImagesOperations :ivar virtual_machine_extensions: VirtualMachineExtensionsOperations operations - :vartype virtual_machine_extensions: azure.mgmt.compute.v2016_03_30.aio.operations_async.VirtualMachineExtensionsOperations + :vartype virtual_machine_extensions: azure.mgmt.compute.v2016_03_30.aio.operations.VirtualMachineExtensionsOperations :ivar virtual_machines: VirtualMachinesOperations operations - :vartype virtual_machines: azure.mgmt.compute.v2016_03_30.aio.operations_async.VirtualMachinesOperations + :vartype virtual_machines: azure.mgmt.compute.v2016_03_30.aio.operations.VirtualMachinesOperations :ivar virtual_machine_images: VirtualMachineImagesOperations operations - :vartype virtual_machine_images: azure.mgmt.compute.v2016_03_30.aio.operations_async.VirtualMachineImagesOperations + :vartype virtual_machine_images: azure.mgmt.compute.v2016_03_30.aio.operations.VirtualMachineImagesOperations :ivar usage: UsageOperations operations - :vartype usage: azure.mgmt.compute.v2016_03_30.aio.operations_async.UsageOperations + :vartype usage: azure.mgmt.compute.v2016_03_30.aio.operations.UsageOperations :ivar virtual_machine_sizes: VirtualMachineSizesOperations operations - :vartype virtual_machine_sizes: azure.mgmt.compute.v2016_03_30.aio.operations_async.VirtualMachineSizesOperations + :vartype virtual_machine_sizes: azure.mgmt.compute.v2016_03_30.aio.operations.VirtualMachineSizesOperations :ivar virtual_machine_scale_sets: VirtualMachineScaleSetsOperations operations - :vartype virtual_machine_scale_sets: azure.mgmt.compute.v2016_03_30.aio.operations_async.VirtualMachineScaleSetsOperations + :vartype virtual_machine_scale_sets: azure.mgmt.compute.v2016_03_30.aio.operations.VirtualMachineScaleSetsOperations :ivar virtual_machine_scale_set_vms: VirtualMachineScaleSetVMsOperations operations - :vartype virtual_machine_scale_set_vms: azure.mgmt.compute.v2016_03_30.aio.operations_async.VirtualMachineScaleSetVMsOperations + :vartype virtual_machine_scale_set_vms: azure.mgmt.compute.v2016_03_30.aio.operations.VirtualMachineScaleSetVMsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. @@ -71,6 +71,7 @@ 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/aio/_configuration_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/_configuration.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/_configuration_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/_configuration.py index 8addc73288f8..1df89d31b659 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/_configuration_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -44,8 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2016-03-30" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-compute/{}'.format(VERSION)) self._configure(**kwargs) @@ -57,6 +57,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations_async/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/__init__.py similarity index 52% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations_async/__init__.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/__init__.py index ee096d6767e9..266148781f3e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations_async/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/__init__.py @@ -6,15 +6,15 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._availability_sets_operations_async import AvailabilitySetsOperations -from ._virtual_machine_extension_images_operations_async import VirtualMachineExtensionImagesOperations -from ._virtual_machine_extensions_operations_async import VirtualMachineExtensionsOperations -from ._virtual_machines_operations_async import VirtualMachinesOperations -from ._virtual_machine_images_operations_async import VirtualMachineImagesOperations -from ._usage_operations_async import UsageOperations -from ._virtual_machine_sizes_operations_async import VirtualMachineSizesOperations -from ._virtual_machine_scale_sets_operations_async import VirtualMachineScaleSetsOperations -from ._virtual_machine_scale_set_vms_operations_async import VirtualMachineScaleSetVMsOperations +from ._availability_sets_operations import AvailabilitySetsOperations +from ._virtual_machine_extension_images_operations import VirtualMachineExtensionImagesOperations +from ._virtual_machine_extensions_operations import VirtualMachineExtensionsOperations +from ._virtual_machines_operations import VirtualMachinesOperations +from ._virtual_machine_images_operations import VirtualMachineImagesOperations +from ._usage_operations import UsageOperations +from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations +from ._virtual_machine_scale_sets_operations import VirtualMachineScaleSetsOperations +from ._virtual_machine_scale_set_vms_operations import VirtualMachineScaleSetVMsOperations __all__ = [ 'AvailabilitySetsOperations', diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations_async/_availability_sets_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_availability_sets_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations_async/_availability_sets_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_availability_sets_operations.py index 32cdaf0540aa..58fbbf8daefb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations_async/_availability_sets_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_availability_sets_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -62,10 +62,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -83,14 +86,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailabilitySet') 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 @@ -111,7 +112,7 @@ async def delete( resource_group_name: str, availability_set_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> Optional["models.OperationStatusResponse"]: """Delete an availability set. :param resource_group_name: The name of the resource group. @@ -123,10 +124,13 @@ async def delete( :rtype: ~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore @@ -143,9 +147,8 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -182,9 +185,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -201,9 +207,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -227,7 +232,8 @@ def list_by_subscription( ) -> AsyncIterable["models.AvailabilitySetListResult"]: """Lists all availability sets in a subscription. - :param expand: The expand expression to apply to the operation. + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AvailabilitySetListResult or the result of cls(response) @@ -235,11 +241,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-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_subscription.metadata['url'] # type: ignore @@ -253,15 +266,11 @@ def prepare_request(next_link=None): if expand is not None: query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -303,11 +312,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-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 @@ -320,15 +336,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -362,7 +374,7 @@ def list_available_sizes( **kwargs ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes that can be used to create a new virtual machine in - an existing availability set. + an existing availability set. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -374,11 +386,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-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_available_sizes.metadata['url'] # type: ignore @@ -392,15 +411,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations_async/_usage_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_usage_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations_async/_usage_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_usage_operations.py index e02fc1ec92b6..d360c6a31a02 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations_async/_usage_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_usage_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -47,7 +47,7 @@ def list( **kwargs ) -> AsyncIterable["models.ListUsagesResult"]: """Gets, for the specified location, the current compute resource usage information as well as the - limits for compute resources under the subscription. + limits for compute resources under the subscription. :param location: The location for which resource usage is queried. :type location: str @@ -57,11 +57,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-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 @@ -74,15 +81,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations_async/_virtual_machine_extension_images_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_extension_images_operations.py similarity index 92% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations_async/_virtual_machine_extension_images_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_extension_images_operations.py index 1b70c33dc191..f979271dd839 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations_async/_virtual_machine_extension_images_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_extension_images_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -64,9 +64,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -85,9 +88,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -122,9 +124,12 @@ async def list_types( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self.list_types.metadata['url'] # type: ignore @@ -141,9 +146,8 @@ async def list_types( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -190,9 +194,12 @@ async def list_versions( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self.list_versions.metadata['url'] # type: ignore @@ -216,9 +223,8 @@ async def list_versions( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations_async/_virtual_machine_extensions_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_extensions_operations.py similarity index 90% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations_async/_virtual_machine_extensions_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_extensions_operations.py index c4b3480fb434..8db4c2ff89aa 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations_async/_virtual_machine_extensions_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_extensions_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachineExtension": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -73,14 +76,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtension') 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 @@ -88,7 +89,6 @@ async def _create_or_update_initial( 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('VirtualMachineExtension', pipeline_response) @@ -108,18 +108,18 @@ async def begin_create_or_update( vm_extension_name: str, extension_parameters: "models.VirtualMachineExtension", **kwargs - ) -> "models.VirtualMachineExtension": + ) -> AsyncLROPoller["models.VirtualMachineExtension"]: """The operation to create or update the extension. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_name: The name of the virtual machine where the extension should be created or - updated. + updated. :type vm_name: str :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Create Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineExtension :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. @@ -127,8 +127,8 @@ async def begin_create_or_update( 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: VirtualMachineExtension, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineExtension + :return: An instance of AsyncLROPoller that returns either VirtualMachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -181,10 +181,13 @@ async def _update_initial( **kwargs ) -> "models.VirtualMachineExtension": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -203,14 +206,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtensionUpdate') 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 @@ -233,7 +234,7 @@ async def begin_update( vm_extension_name: str, extension_parameters: "models.VirtualMachineExtensionUpdate", **kwargs - ) -> "models.VirtualMachineExtension": + ) -> AsyncLROPoller["models.VirtualMachineExtension"]: """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -243,7 +244,7 @@ async def begin_update( :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Update Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineExtensionUpdate :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. @@ -251,8 +252,8 @@ async def begin_update( 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: VirtualMachineExtension, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineExtension + :return: An instance of AsyncLROPoller that returns either VirtualMachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -302,11 +303,14 @@ async def _delete_initial( vm_name: str, vm_extension_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -324,9 +328,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -351,7 +354,7 @@ async def begin_delete( vm_name: str, vm_extension_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -366,8 +369,8 @@ async def begin_delete( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -434,9 +437,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -456,9 +462,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations_async/_virtual_machine_images_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_images_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations_async/_virtual_machine_images_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_images_operations.py index da3ab5fa2031..b39be7154394 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations_async/_virtual_machine_images_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_images_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -67,9 +67,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -89,9 +92,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -142,9 +144,12 @@ async def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -169,9 +174,8 @@ async def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -206,9 +210,12 @@ async def list_offers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self.list_offers.metadata['url'] # type: ignore @@ -225,9 +232,8 @@ async def list_offers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -259,9 +265,12 @@ async def list_publishers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self.list_publishers.metadata['url'] # type: ignore @@ -277,9 +286,8 @@ async def list_publishers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -317,9 +325,12 @@ async def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self.list_skus.metadata['url'] # type: ignore @@ -337,9 +348,8 @@ async def list_skus( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations_async/_virtual_machine_scale_set_vms_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_scale_set_vms_operations.py similarity index 87% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations_async/_virtual_machine_scale_set_vms_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_scale_set_vms_operations.py index 47ea880bd581..2c647d58eca4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations_async/_virtual_machine_scale_set_vms_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -49,11 +49,14 @@ async def _reimage_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self._reimage_initial.metadata['url'] # type: ignore @@ -71,9 +74,8 @@ async def _reimage_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -98,7 +100,7 @@ async def begin_reimage( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -113,8 +115,8 @@ async def begin_reimage( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -163,11 +165,14 @@ async def _deallocate_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self._deallocate_initial.metadata['url'] # type: ignore @@ -185,9 +190,8 @@ async def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -212,10 +216,10 @@ async def begin_deallocate( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and - releases the compute resources it uses. You are not billed for the compute resources of this - virtual machine once it is deallocated. + releases the compute resources it uses. You are not billed for the compute resources of this + virtual machine once it is deallocated. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -229,8 +233,8 @@ async def begin_deallocate( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -279,11 +283,14 @@ async def _delete_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -301,9 +308,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -328,7 +334,7 @@ async def begin_delete( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Deletes a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -343,8 +349,8 @@ async def begin_delete( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -408,9 +414,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -428,9 +437,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -468,9 +476,12 @@ async def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -488,9 +499,8 @@ async def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -522,11 +532,14 @@ def list( :type resource_group_name: str :param virtual_machine_scale_set_name: The name of the VM scale set. :type virtual_machine_scale_set_name: str - :param filter: The filter to apply to the operation. + :param filter: The filter to apply to the operation. Allowed values are + 'startswith(instanceView/statuses/code, 'PowerState') eq true', 'properties/latestModelApplied + eq true', 'properties/latestModelApplied eq false'. :type filter: str - :param select: The list parameters. + :param select: The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. :type select: str - :param expand: The expand expression to apply to the operation. + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetVMListResult or the result of cls(response) @@ -534,11 +547,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-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 @@ -558,15 +578,11 @@ def prepare_request(next_link=None): query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -599,11 +615,14 @@ async def _power_off_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self._power_off_initial.metadata['url'] # type: ignore @@ -621,9 +640,8 @@ async def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -648,10 +666,10 @@ async def begin_power_off( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached - and you are getting charged for the resources. Instead, use deallocate to release resources and - avoid charges. + and you are getting charged for the resources. Instead, use deallocate to release resources and + avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -665,8 +683,8 @@ async def begin_power_off( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -715,11 +733,14 @@ async def _restart_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self._restart_initial.metadata['url'] # type: ignore @@ -737,9 +758,8 @@ async def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -764,7 +784,7 @@ async def begin_restart( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Restarts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -779,8 +799,8 @@ async def begin_restart( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -829,11 +849,14 @@ async def _start_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self._start_initial.metadata['url'] # type: ignore @@ -851,9 +874,8 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -878,7 +900,7 @@ async def begin_start( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Starts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -893,8 +915,8 @@ async def begin_start( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations_async/_virtual_machine_scale_sets_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_scale_sets_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations_async/_virtual_machine_scale_sets_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_scale_sets_operations.py index 7be059a000da..bd93f7c61df2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations_async/_virtual_machine_scale_sets_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_scale_sets_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachineScaleSet": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSet') 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('VirtualMachineScaleSet', pipeline_response) @@ -106,7 +106,7 @@ async def begin_create_or_update( name: str, parameters: "models.VirtualMachineScaleSet", **kwargs - ) -> "models.VirtualMachineScaleSet": + ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -121,8 +121,8 @@ async def begin_create_or_update( 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: VirtualMachineScaleSet, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineScaleSet + :return: An instance of AsyncLROPoller that returns either VirtualMachineScaleSet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineScaleSet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -170,11 +170,14 @@ async def _delete_initial( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -191,9 +194,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -217,7 +219,7 @@ async def begin_delete( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Deletes a VM scale set. :param resource_group_name: The name of the resource group. @@ -230,8 +232,8 @@ async def begin_delete( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -291,9 +293,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -310,9 +315,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -335,12 +339,15 @@ async def _deallocate_initial( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._deallocate_initial.metadata['url'] # type: ignore @@ -358,9 +365,8 @@ async def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -368,7 +374,6 @@ async def _deallocate_initial( body_content = None 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 @@ -392,10 +397,10 @@ async def begin_deallocate( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and - releases the compute resources. You are not billed for the compute resources that this virtual - machine scale set deallocates. + releases the compute resources. You are not billed for the compute resources that this virtual + machine scale set deallocates. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -409,8 +414,8 @@ async def begin_deallocate( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,12 +464,15 @@ async def _delete_instances_initial( vm_scale_set_name: str, vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._delete_instances_initial.metadata['url'] # type: ignore @@ -482,14 +490,12 @@ async def _delete_instances_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -513,7 +519,7 @@ async def begin_delete_instances( vm_scale_set_name: str, vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Deletes virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -528,8 +534,8 @@ async def begin_delete_instances( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -590,9 +596,12 @@ async def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -609,9 +618,8 @@ async def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -643,11 +651,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-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 @@ -660,15 +675,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -700,8 +711,8 @@ def list_all( **kwargs ) -> AsyncIterable["models.VirtualMachineScaleSetListWithLinkResult"]: """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource - group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this - till nextLink is null to fetch all the VM Scale Sets. + group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this + till nextLink is null to fetch all the VM Scale Sets. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetListWithLinkResult or the result of cls(response) @@ -709,11 +720,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-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_all.metadata['url'] # type: ignore @@ -725,15 +743,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -767,7 +781,7 @@ def list_skus( **kwargs ) -> AsyncIterable["models.VirtualMachineScaleSetListSkusResult"]: """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM - instances allowed for each SKU. + instances allowed for each SKU. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -779,11 +793,18 @@ def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-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_skus.metadata['url'] # type: ignore @@ -797,15 +818,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -838,12 +855,15 @@ async def _power_off_initial( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._power_off_initial.metadata['url'] # type: ignore @@ -861,9 +881,8 @@ async def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -871,7 +890,6 @@ async def _power_off_initial( body_content = None 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 @@ -895,10 +913,10 @@ async def begin_power_off( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still - attached and you are getting charged for the resources. Instead, use deallocate to release - resources and avoid charges. + attached and you are getting charged for the resources. Instead, use deallocate to release + resources and avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -912,8 +930,8 @@ async def begin_power_off( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -962,12 +980,15 @@ async def _restart_initial( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._restart_initial.metadata['url'] # type: ignore @@ -985,9 +1006,8 @@ async def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -995,7 +1015,6 @@ async def _restart_initial( body_content = None 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 @@ -1019,7 +1038,7 @@ async def begin_restart( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Restarts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1034,8 +1053,8 @@ async def begin_restart( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1084,12 +1103,15 @@ async def _start_initial( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._start_initial.metadata['url'] # type: ignore @@ -1107,9 +1129,8 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1117,7 +1138,6 @@ async def _start_initial( body_content = None 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 @@ -1141,7 +1161,7 @@ async def begin_start( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Starts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1156,8 +1176,8 @@ async def begin_start( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1206,12 +1226,15 @@ async def _update_instances_initial( vm_scale_set_name: str, vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_instances_initial.metadata['url'] # type: ignore @@ -1229,14 +1252,12 @@ async def _update_instances_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -1260,7 +1281,7 @@ async def begin_update_instances( vm_scale_set_name: str, vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. :param resource_group_name: The name of the resource group. @@ -1275,8 +1296,8 @@ async def begin_update_instances( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1324,11 +1345,14 @@ async def _reimage_initial( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self._reimage_initial.metadata['url'] # type: ignore @@ -1345,9 +1369,8 @@ async def _reimage_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1371,7 +1394,7 @@ async def begin_reimage( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1384,8 +1407,8 @@ async def begin_reimage( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations_async/_virtual_machine_sizes_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_sizes_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations_async/_virtual_machine_sizes_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_sizes_operations.py index 500544edf1ba..fcb92799f18b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations_async/_virtual_machine_sizes_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_sizes_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,11 +56,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-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 @@ -73,15 +80,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations_async/_virtual_machines_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machines_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations_async/_virtual_machines_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machines_operations.py index 6a9b7f742c7d..a0240ebefdd9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations_async/_virtual_machines_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machines_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -64,9 +64,12 @@ async def get_extensions( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self.get_extensions.metadata['url'] # type: ignore @@ -85,9 +88,8 @@ async def get_extensions( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -110,12 +112,15 @@ async def _capture_initial( vm_name: str, parameters: "models.VirtualMachineCaptureParameters", **kwargs - ) -> "models.VirtualMachineCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.VirtualMachineCaptureResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._capture_initial.metadata['url'] # type: ignore @@ -133,14 +138,12 @@ async def _capture_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineCaptureParameters') 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 @@ -164,9 +167,9 @@ async def begin_capture( vm_name: str, parameters: "models.VirtualMachineCaptureParameters", **kwargs - ) -> "models.VirtualMachineCaptureResult": + ) -> AsyncLROPoller["models.VirtualMachineCaptureResult"]: """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used - to create similar VMs. + to create similar VMs. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -180,8 +183,8 @@ async def begin_capture( 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: VirtualMachineCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineCaptureResult + :return: An instance of AsyncLROPoller that returns either VirtualMachineCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineCaptureResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -232,10 +235,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachine": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -253,14 +259,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachine') 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 @@ -268,7 +272,6 @@ async def _create_or_update_initial( 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('VirtualMachine', pipeline_response) @@ -287,7 +290,7 @@ async def begin_create_or_update( vm_name: str, parameters: "models.VirtualMachine", **kwargs - ) -> "models.VirtualMachine": + ) -> AsyncLROPoller["models.VirtualMachine"]: """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -302,8 +305,8 @@ async def begin_create_or_update( 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: VirtualMachine, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_03_30.models.VirtualMachine + :return: An instance of AsyncLROPoller that returns either VirtualMachine or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_03_30.models.VirtualMachine] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,11 +354,14 @@ async def _delete_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -372,9 +378,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -398,7 +403,7 @@ async def begin_delete( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """The operation to delete a virtual machine. :param resource_group_name: The name of the resource group. @@ -411,8 +416,8 @@ async def begin_delete( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -475,9 +480,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -496,9 +504,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -520,11 +527,14 @@ async def _deallocate_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self._deallocate_initial.metadata['url'] # type: ignore @@ -541,9 +551,8 @@ async def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -567,9 +576,9 @@ async def begin_deallocate( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Shuts down the virtual machine and releases the compute resources. You are not billed for the - compute resources that this virtual machine uses. + compute resources that this virtual machine uses. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -581,8 +590,8 @@ async def begin_deallocate( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -642,9 +651,12 @@ async def generalize( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self.generalize.metadata['url'] # type: ignore @@ -661,9 +673,8 @@ async def generalize( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -686,7 +697,7 @@ def list( **kwargs ) -> AsyncIterable["models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified resource group. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -696,11 +707,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-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 @@ -713,15 +731,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -753,7 +767,7 @@ def list_all( **kwargs ) -> AsyncIterable["models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified subscription. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineListResult or the result of cls(response) @@ -761,11 +775,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-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_all.metadata['url'] # type: ignore @@ -777,15 +798,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -819,7 +836,7 @@ def list_available_sizes( **kwargs ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes to which the specified virtual machine can be - resized. + resized. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -831,11 +848,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-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_available_sizes.metadata['url'] # type: ignore @@ -849,15 +873,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -889,11 +909,14 @@ async def _power_off_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self._power_off_initial.metadata['url'] # type: ignore @@ -910,9 +933,8 @@ async def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -936,9 +958,9 @@ async def begin_power_off( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with - the same provisioned resources. You are still charged for this virtual machine. + the same provisioned resources. You are still charged for this virtual machine. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -950,8 +972,8 @@ async def begin_power_off( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -998,11 +1020,14 @@ async def _restart_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self._restart_initial.metadata['url'] # type: ignore @@ -1019,9 +1044,8 @@ async def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1045,7 +1069,7 @@ async def begin_restart( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """The operation to restart a virtual machine. :param resource_group_name: The name of the resource group. @@ -1058,8 +1082,8 @@ async def begin_restart( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1106,11 +1130,14 @@ async def _start_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self._start_initial.metadata['url'] # type: ignore @@ -1127,9 +1154,8 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1153,7 +1179,7 @@ async def begin_start( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """The operation to start a virtual machine. :param resource_group_name: The name of the resource group. @@ -1166,8 +1192,8 @@ async def begin_start( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1214,11 +1240,14 @@ async def _redeploy_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self._redeploy_initial.metadata['url'] # type: ignore @@ -1235,9 +1264,8 @@ async def _redeploy_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1261,7 +1289,7 @@ async def begin_redeploy( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Shuts down the virtual machine, moves it to a new node, and powers it back on. :param resource_group_name: The name of the resource group. @@ -1274,8 +1302,8 @@ async def begin_redeploy( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/_compute_management_client_enums.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/_compute_management_client_enums.py index a9f0f6ba41ff..af1fc83a2871 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/_compute_management_client_enums.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/_compute_management_client_enums.py @@ -6,20 +6,38 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum - -class CachingTypes(str, Enum): +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class CachingTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the caching requirements. :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **None** :code:`
`:code:`
` **ReadOnly** :code:`
`:code:`
` **ReadWrite** :code:`
`:code:`
` Default: **None for Standard storage. ReadOnly for Premium storage** """ - none = "None" - read_only = "ReadOnly" - read_write = "ReadWrite" + NONE = "None" + READ_ONLY = "ReadOnly" + READ_WRITE = "ReadWrite" -class DiskCreateOptionTypes(str, Enum): +class DiskCreateOptionTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies how the virtual machine should be created.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` **Attach** \u2013 This value is used when you are using a specialized disk to create the virtual machine.:code:`
`:code:`
` **FromImage** \u2013 @@ -28,42 +46,42 @@ class DiskCreateOptionTypes(str, Enum): marketplace image, you also use the plan element previously described. """ - from_image = "FromImage" - empty = "Empty" - attach = "Attach" + FROM_IMAGE = "FromImage" + EMPTY = "Empty" + ATTACH = "Attach" -class OperatingSystemTypes(str, Enum): +class OperatingSystemTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The operating system of the osDiskImage. """ - windows = "Windows" - linux = "Linux" + WINDOWS = "Windows" + LINUX = "Linux" -class ProtocolTypes(str, Enum): +class ProtocolTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the protocol of listener. :code:`
`:code:`
` Possible values are: :code:`
`\ **http** :code:`
`:code:`
` **https** """ - http = "Http" - https = "Https" + HTTP = "Http" + HTTPS = "Https" -class SettingNames(str, Enum): +class SettingNames(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon. """ - auto_logon = "AutoLogon" - first_logon_commands = "FirstLogonCommands" + AUTO_LOGON = "AutoLogon" + FIRST_LOGON_COMMANDS = "FirstLogonCommands" -class StatusLevelTypes(str, Enum): +class StatusLevelTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The level code. """ - info = "Info" - warning = "Warning" - error = "Error" + INFO = "Info" + WARNING = "Warning" + ERROR = "Error" -class UpgradeMode(str, Enum): +class UpgradeMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the mode of an upgrade to virtual machines in the scale set.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` **Manual** - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade @@ -71,17 +89,17 @@ class UpgradeMode(str, Enum): automatically updated at the same time. """ - automatic = "Automatic" - manual = "Manual" + AUTOMATIC = "Automatic" + MANUAL = "Manual" -class VirtualMachineScaleSetSkuScaleType(str, Enum): +class VirtualMachineScaleSetSkuScaleType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The scale type applicable to the sku. """ - automatic = "Automatic" - none = "None" + AUTOMATIC = "Automatic" + NONE = "None" -class VirtualMachineSizeTypes(str, Enum): +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 `_. @@ -95,66 +113,66 @@ class VirtualMachineSizeTypes(str, Enum): `_ """ - basic_a0 = "Basic_A0" - basic_a1 = "Basic_A1" - basic_a2 = "Basic_A2" - basic_a3 = "Basic_A3" - basic_a4 = "Basic_A4" - standard_a0 = "Standard_A0" - standard_a1 = "Standard_A1" - standard_a2 = "Standard_A2" - standard_a3 = "Standard_A3" - standard_a4 = "Standard_A4" - standard_a5 = "Standard_A5" - standard_a6 = "Standard_A6" - standard_a7 = "Standard_A7" - standard_a8 = "Standard_A8" - standard_a9 = "Standard_A9" - standard_a10 = "Standard_A10" - standard_a11 = "Standard_A11" - standard_d1 = "Standard_D1" - standard_d2 = "Standard_D2" - standard_d3 = "Standard_D3" - standard_d4 = "Standard_D4" - standard_d11 = "Standard_D11" - standard_d12 = "Standard_D12" - standard_d13 = "Standard_D13" - standard_d14 = "Standard_D14" - standard_d1_v2 = "Standard_D1_v2" - standard_d2_v2 = "Standard_D2_v2" - standard_d3_v2 = "Standard_D3_v2" - standard_d4_v2 = "Standard_D4_v2" - standard_d5_v2 = "Standard_D5_v2" - standard_d11_v2 = "Standard_D11_v2" - standard_d12_v2 = "Standard_D12_v2" - standard_d13_v2 = "Standard_D13_v2" - standard_d14_v2 = "Standard_D14_v2" - standard_d15_v2 = "Standard_D15_v2" - standard_ds1 = "Standard_DS1" - standard_ds2 = "Standard_DS2" - standard_ds3 = "Standard_DS3" - standard_ds4 = "Standard_DS4" - standard_ds11 = "Standard_DS11" - standard_ds12 = "Standard_DS12" - standard_ds13 = "Standard_DS13" - standard_ds14 = "Standard_DS14" - standard_ds1_v2 = "Standard_DS1_v2" - standard_ds2_v2 = "Standard_DS2_v2" - standard_ds3_v2 = "Standard_DS3_v2" - standard_ds4_v2 = "Standard_DS4_v2" - standard_ds5_v2 = "Standard_DS5_v2" - standard_ds11_v2 = "Standard_DS11_v2" - standard_ds12_v2 = "Standard_DS12_v2" - standard_ds13_v2 = "Standard_DS13_v2" - standard_ds14_v2 = "Standard_DS14_v2" - standard_ds15_v2 = "Standard_DS15_v2" - standard_g1 = "Standard_G1" - standard_g2 = "Standard_G2" - standard_g3 = "Standard_G3" - standard_g4 = "Standard_G4" - standard_g5 = "Standard_G5" - standard_gs1 = "Standard_GS1" - standard_gs2 = "Standard_GS2" - standard_gs3 = "Standard_GS3" - standard_gs4 = "Standard_GS4" - standard_gs5 = "Standard_GS5" + BASIC_A0 = "Basic_A0" + BASIC_A1 = "Basic_A1" + BASIC_A2 = "Basic_A2" + BASIC_A3 = "Basic_A3" + BASIC_A4 = "Basic_A4" + STANDARD_A0 = "Standard_A0" + STANDARD_A1 = "Standard_A1" + STANDARD_A2 = "Standard_A2" + STANDARD_A3 = "Standard_A3" + STANDARD_A4 = "Standard_A4" + STANDARD_A5 = "Standard_A5" + STANDARD_A6 = "Standard_A6" + STANDARD_A7 = "Standard_A7" + STANDARD_A8 = "Standard_A8" + STANDARD_A9 = "Standard_A9" + STANDARD_A10 = "Standard_A10" + STANDARD_A11 = "Standard_A11" + STANDARD_D1 = "Standard_D1" + STANDARD_D2 = "Standard_D2" + STANDARD_D3 = "Standard_D3" + STANDARD_D4 = "Standard_D4" + STANDARD_D11 = "Standard_D11" + STANDARD_D12 = "Standard_D12" + STANDARD_D13 = "Standard_D13" + STANDARD_D14 = "Standard_D14" + STANDARD_D1_V2 = "Standard_D1_v2" + STANDARD_D2_V2 = "Standard_D2_v2" + STANDARD_D3_V2 = "Standard_D3_v2" + STANDARD_D4_V2 = "Standard_D4_v2" + STANDARD_D5_V2 = "Standard_D5_v2" + STANDARD_D11_V2 = "Standard_D11_v2" + STANDARD_D12_V2 = "Standard_D12_v2" + STANDARD_D13_V2 = "Standard_D13_v2" + STANDARD_D14_V2 = "Standard_D14_v2" + STANDARD_D15_V2 = "Standard_D15_v2" + STANDARD_DS1 = "Standard_DS1" + STANDARD_DS2 = "Standard_DS2" + STANDARD_DS3 = "Standard_DS3" + STANDARD_DS4 = "Standard_DS4" + STANDARD_DS11 = "Standard_DS11" + STANDARD_DS12 = "Standard_DS12" + STANDARD_DS13 = "Standard_DS13" + STANDARD_DS14 = "Standard_DS14" + STANDARD_DS1_V2 = "Standard_DS1_v2" + STANDARD_DS2_V2 = "Standard_DS2_v2" + STANDARD_DS3_V2 = "Standard_DS3_v2" + STANDARD_DS4_V2 = "Standard_DS4_v2" + STANDARD_DS5_V2 = "Standard_DS5_v2" + STANDARD_DS11_V2 = "Standard_DS11_v2" + STANDARD_DS12_V2 = "Standard_DS12_v2" + STANDARD_DS13_V2 = "Standard_DS13_v2" + STANDARD_DS14_V2 = "Standard_DS14_v2" + STANDARD_DS15_V2 = "Standard_DS15_v2" + STANDARD_G1 = "Standard_G1" + STANDARD_G2 = "Standard_G2" + STANDARD_G3 = "Standard_G3" + STANDARD_G4 = "Standard_G4" + STANDARD_G5 = "Standard_G5" + STANDARD_GS1 = "Standard_GS1" + STANDARD_GS2 = "Standard_GS2" + STANDARD_GS3 = "Standard_GS3" + STANDARD_GS4 = "Standard_GS4" + STANDARD_GS5 = "Standard_GS5" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_availability_sets_operations.py index c60eefc51693..010e1cc61af6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_availability_sets_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -67,10 +67,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -88,14 +91,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailabilitySet') 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 @@ -117,7 +118,7 @@ def delete( availability_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" + # type: (...) -> Optional["models.OperationStatusResponse"] """Delete an availability set. :param resource_group_name: The name of the resource group. @@ -129,10 +130,13 @@ def delete( :rtype: ~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore @@ -149,9 +153,8 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -189,9 +192,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -208,9 +214,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -235,7 +240,8 @@ def list_by_subscription( # type: (...) -> Iterable["models.AvailabilitySetListResult"] """Lists all availability sets in a subscription. - :param expand: The expand expression to apply to the operation. + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AvailabilitySetListResult or the result of cls(response) @@ -243,11 +249,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-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_subscription.metadata['url'] # type: ignore @@ -261,15 +274,11 @@ def prepare_request(next_link=None): if expand is not None: query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -312,11 +321,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-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 @@ -329,15 +345,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -372,7 +384,7 @@ def list_available_sizes( ): # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes that can be used to create a new virtual machine in - an existing availability set. + an existing availability set. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -384,11 +396,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-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_available_sizes.metadata['url'] # type: ignore @@ -402,15 +421,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_usage_operations.py index d7c28bc178f6..be6b48366cf5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_usage_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,7 +52,7 @@ def list( ): # type: (...) -> Iterable["models.ListUsagesResult"] """Gets, for the specified location, the current compute resource usage information as well as the - limits for compute resources under the subscription. + limits for compute resources under the subscription. :param location: The location for which resource usage is queried. :type location: str @@ -62,11 +62,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-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 @@ -79,15 +86,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_extension_images_operations.py index 40f35b42d0ac..eaee4353f80a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_extension_images_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -69,9 +69,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -90,9 +93,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -128,9 +130,12 @@ def list_types( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self.list_types.metadata['url'] # type: ignore @@ -147,9 +152,8 @@ def list_types( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -197,9 +201,12 @@ def list_versions( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self.list_versions.metadata['url'] # type: ignore @@ -223,9 +230,8 @@ def list_versions( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_extensions_operations.py index 54a9e6e19017..3ec51e39c908 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_extensions_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachineExtension" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -78,14 +81,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtension') 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 @@ -93,7 +94,6 @@ def _create_or_update_initial( 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('VirtualMachineExtension', pipeline_response) @@ -114,18 +114,18 @@ def begin_create_or_update( extension_parameters, # type: "models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineExtension"] """The operation to create or update the extension. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_name: The name of the virtual machine where the extension should be created or - updated. + updated. :type vm_name: str :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Create Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineExtension :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. @@ -188,10 +188,13 @@ def _update_initial( ): # type: (...) -> "models.VirtualMachineExtension" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -210,14 +213,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtensionUpdate') 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 @@ -241,7 +242,7 @@ def begin_update( extension_parameters, # type: "models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineExtension"] """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -251,7 +252,7 @@ def begin_update( :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Update Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineExtensionUpdate :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. @@ -311,11 +312,14 @@ def _delete_initial( vm_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -333,9 +337,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -361,7 +364,7 @@ def begin_delete( vm_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -445,9 +448,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -467,9 +473,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_images_operations.py index 26412bf42383..952c5798734e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_images_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -72,9 +72,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -94,9 +97,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -148,9 +150,12 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -175,9 +180,8 @@ def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -213,9 +217,12 @@ def list_offers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self.list_offers.metadata['url'] # type: ignore @@ -232,9 +239,8 @@ def list_offers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -267,9 +273,12 @@ def list_publishers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self.list_publishers.metadata['url'] # type: ignore @@ -285,9 +294,8 @@ def list_publishers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -326,9 +334,12 @@ def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self.list_skus.metadata['url'] # type: ignore @@ -346,9 +357,8 @@ def list_skus( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_scale_set_vms_operations.py index 798f14f983ba..84f113bff444 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_scale_set_vms_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -54,11 +54,14 @@ def _reimage_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self._reimage_initial.metadata['url'] # type: ignore @@ -76,9 +79,8 @@ def _reimage_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -104,7 +106,7 @@ def begin_reimage( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -170,11 +172,14 @@ def _deallocate_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self._deallocate_initial.metadata['url'] # type: ignore @@ -192,9 +197,8 @@ def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -220,10 +224,10 @@ def begin_deallocate( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and - releases the compute resources it uses. You are not billed for the compute resources of this - virtual machine once it is deallocated. + releases the compute resources it uses. You are not billed for the compute resources of this + virtual machine once it is deallocated. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -288,11 +292,14 @@ def _delete_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -310,9 +317,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -338,7 +344,7 @@ def begin_delete( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Deletes a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -419,9 +425,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -439,9 +448,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -480,9 +488,12 @@ def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -500,9 +511,8 @@ def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -535,11 +545,14 @@ def list( :type resource_group_name: str :param virtual_machine_scale_set_name: The name of the VM scale set. :type virtual_machine_scale_set_name: str - :param filter: The filter to apply to the operation. + :param filter: The filter to apply to the operation. Allowed values are + 'startswith(instanceView/statuses/code, 'PowerState') eq true', 'properties/latestModelApplied + eq true', 'properties/latestModelApplied eq false'. :type filter: str - :param select: The list parameters. + :param select: The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. :type select: str - :param expand: The expand expression to apply to the operation. + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetVMListResult or the result of cls(response) @@ -547,11 +560,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-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 @@ -571,15 +591,11 @@ def prepare_request(next_link=None): query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -613,11 +629,14 @@ def _power_off_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self._power_off_initial.metadata['url'] # type: ignore @@ -635,9 +654,8 @@ def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -663,10 +681,10 @@ def begin_power_off( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached - and you are getting charged for the resources. Instead, use deallocate to release resources and - avoid charges. + and you are getting charged for the resources. Instead, use deallocate to release resources and + avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -731,11 +749,14 @@ def _restart_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self._restart_initial.metadata['url'] # type: ignore @@ -753,9 +774,8 @@ def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -781,7 +801,7 @@ def begin_restart( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Restarts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -847,11 +867,14 @@ def _start_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self._start_initial.metadata['url'] # type: ignore @@ -869,9 +892,8 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -897,7 +919,7 @@ def begin_start( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Starts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_scale_sets_operations.py index 865415aa8dae..5d377e2de081 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_scale_sets_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachineScaleSet" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSet') 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('VirtualMachineScaleSet', pipeline_response) @@ -112,7 +112,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualMachineScaleSet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -177,11 +177,14 @@ def _delete_initial( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -198,9 +201,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -225,7 +227,7 @@ def begin_delete( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Deletes a VM scale set. :param resource_group_name: The name of the resource group. @@ -300,9 +302,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -319,9 +324,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -345,12 +349,15 @@ def _deallocate_initial( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._deallocate_initial.metadata['url'] # type: ignore @@ -368,9 +375,8 @@ def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -378,7 +384,6 @@ def _deallocate_initial( body_content = None 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 @@ -403,10 +408,10 @@ def begin_deallocate( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and - releases the compute resources. You are not billed for the compute resources that this virtual - machine scale set deallocates. + releases the compute resources. You are not billed for the compute resources that this virtual + machine scale set deallocates. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -471,12 +476,15 @@ def _delete_instances_initial( vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._delete_instances_initial.metadata['url'] # type: ignore @@ -494,14 +502,12 @@ def _delete_instances_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -526,7 +532,7 @@ def begin_delete_instances( vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Deletes virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -604,9 +610,12 @@ def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -623,9 +632,8 @@ def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -658,11 +666,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-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 @@ -675,15 +690,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -716,8 +727,8 @@ def list_all( ): # type: (...) -> Iterable["models.VirtualMachineScaleSetListWithLinkResult"] """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource - group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this - till nextLink is null to fetch all the VM Scale Sets. + group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this + till nextLink is null to fetch all the VM Scale Sets. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetListWithLinkResult or the result of cls(response) @@ -725,11 +736,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-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_all.metadata['url'] # type: ignore @@ -741,15 +759,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -784,7 +798,7 @@ def list_skus( ): # type: (...) -> Iterable["models.VirtualMachineScaleSetListSkusResult"] """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM - instances allowed for each SKU. + instances allowed for each SKU. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -796,11 +810,18 @@ def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-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_skus.metadata['url'] # type: ignore @@ -814,15 +835,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -856,12 +873,15 @@ def _power_off_initial( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._power_off_initial.metadata['url'] # type: ignore @@ -879,9 +899,8 @@ def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -889,7 +908,6 @@ def _power_off_initial( body_content = None 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 @@ -914,10 +932,10 @@ def begin_power_off( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still - attached and you are getting charged for the resources. Instead, use deallocate to release - resources and avoid charges. + attached and you are getting charged for the resources. Instead, use deallocate to release + resources and avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -982,12 +1000,15 @@ def _restart_initial( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._restart_initial.metadata['url'] # type: ignore @@ -1005,9 +1026,8 @@ def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1015,7 +1035,6 @@ def _restart_initial( body_content = None 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 @@ -1040,7 +1059,7 @@ def begin_restart( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Restarts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1106,12 +1125,15 @@ def _start_initial( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._start_initial.metadata['url'] # type: ignore @@ -1129,9 +1151,8 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1139,7 +1160,6 @@ def _start_initial( body_content = None 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 @@ -1164,7 +1184,7 @@ def begin_start( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Starts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1230,12 +1250,15 @@ def _update_instances_initial( vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_instances_initial.metadata['url'] # type: ignore @@ -1253,14 +1276,12 @@ def _update_instances_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -1285,7 +1306,7 @@ def begin_update_instances( vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. :param resource_group_name: The name of the resource group. @@ -1350,11 +1371,14 @@ def _reimage_initial( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self._reimage_initial.metadata['url'] # type: ignore @@ -1371,9 +1395,8 @@ def _reimage_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1398,7 +1421,7 @@ def begin_reimage( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_sizes_operations.py index 7dbccf1de367..93d62f3dc530 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_sizes_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -61,11 +61,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-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 @@ -78,15 +85,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machines_operations.py index f9ad8093107a..38c18652b760 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machines_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -69,9 +69,12 @@ def get_extensions( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self.get_extensions.metadata['url'] # type: ignore @@ -90,9 +93,8 @@ def get_extensions( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -116,12 +118,15 @@ def _capture_initial( parameters, # type: "models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._capture_initial.metadata['url'] # type: ignore @@ -139,14 +144,12 @@ def _capture_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineCaptureParameters') 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 @@ -171,9 +174,9 @@ def begin_capture( parameters, # type: "models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineCaptureResult"] """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used - to create similar VMs. + to create similar VMs. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -240,10 +243,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachine" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -261,14 +267,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachine') 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 @@ -276,7 +280,6 @@ def _create_or_update_initial( 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('VirtualMachine', pipeline_response) @@ -296,7 +299,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualMachine" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachine"] """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -361,11 +364,14 @@ def _delete_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -382,9 +388,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -409,7 +414,7 @@ def begin_delete( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """The operation to delete a virtual machine. :param resource_group_name: The name of the resource group. @@ -487,9 +492,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -508,9 +516,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -533,11 +540,14 @@ def _deallocate_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self._deallocate_initial.metadata['url'] # type: ignore @@ -554,9 +564,8 @@ def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -581,9 +590,9 @@ def begin_deallocate( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Shuts down the virtual machine and releases the compute resources. You are not billed for the - compute resources that this virtual machine uses. + compute resources that this virtual machine uses. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -657,9 +666,12 @@ def generalize( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self.generalize.metadata['url'] # type: ignore @@ -676,9 +688,8 @@ def generalize( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -702,7 +713,7 @@ def list( ): # type: (...) -> Iterable["models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified resource group. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -712,11 +723,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-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 @@ -729,15 +747,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -770,7 +784,7 @@ def list_all( ): # type: (...) -> Iterable["models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified subscription. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineListResult or the result of cls(response) @@ -778,11 +792,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-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_all.metadata['url'] # type: ignore @@ -794,15 +815,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -837,7 +854,7 @@ def list_available_sizes( ): # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes to which the specified virtual machine can be - resized. + resized. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -849,11 +866,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-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_available_sizes.metadata['url'] # type: ignore @@ -867,15 +891,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -908,11 +928,14 @@ def _power_off_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self._power_off_initial.metadata['url'] # type: ignore @@ -929,9 +952,8 @@ def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -956,9 +978,9 @@ def begin_power_off( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with - the same provisioned resources. You are still charged for this virtual machine. + the same provisioned resources. You are still charged for this virtual machine. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1019,11 +1041,14 @@ def _restart_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self._restart_initial.metadata['url'] # type: ignore @@ -1040,9 +1065,8 @@ def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1067,7 +1091,7 @@ def begin_restart( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """The operation to restart a virtual machine. :param resource_group_name: The name of the resource group. @@ -1129,11 +1153,14 @@ def _start_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self._start_initial.metadata['url'] # type: ignore @@ -1150,9 +1177,8 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1177,7 +1203,7 @@ def begin_start( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """The operation to start a virtual machine. :param resource_group_name: The name of the resource group. @@ -1239,11 +1265,14 @@ def _redeploy_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-30" + accept = "application/json" # Construct URL url = self._redeploy_initial.metadata['url'] # type: ignore @@ -1260,9 +1289,8 @@ def _redeploy_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1287,7 +1315,7 @@ def begin_redeploy( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Shuts down the virtual machine, moves it to a new node, and powers it back on. :param resource_group_name: The name of the resource group. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/__init__.py index 20a4019e9c23..cdc7f7a1709a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/__init__.py @@ -10,7 +10,7 @@ __all__ = ['ComputeManagementClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass 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 78e44772189d..c08c09d03e0b 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,6 +83,7 @@ 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/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_configuration.py index d83c4e737d29..e1e857fd1218 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -47,8 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2016-04-30-preview" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-compute/{}'.format(VERSION)) self._configure(**kwargs) @@ -61,6 +61,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) 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 23bc1958757d..4d29350aa90e 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 @@ -4,7 +4,11 @@ "client": { "name": "ComputeManagementClient", "filename": "_compute_management_client", - "description": "Compute Client." + "description": "Compute Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true }, "global_parameters": { "sync_method": { @@ -41,7 +45,10 @@ }, "config": { "credential": true, - "credential_scopes": ["https://management.azure.com/.default"] + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null }, "operation_groups": { "availability_sets": "AvailabilitySetsOperations", diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/__init__.py index c8a8b4817269..9e9459635989 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._compute_management_client_async import ComputeManagementClient +from ._compute_management_client import ComputeManagementClient __all__ = ['ComputeManagementClient'] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/_compute_management_client_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/_compute_management_client.py similarity index 79% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/_compute_management_client_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/_compute_management_client.py index 3b447667d164..5a3172727c21 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/_compute_management_client_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/_compute_management_client.py @@ -15,19 +15,19 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration_async import ComputeManagementClientConfiguration -from .operations_async import AvailabilitySetsOperations -from .operations_async import VirtualMachineExtensionImagesOperations -from .operations_async import VirtualMachineExtensionsOperations -from .operations_async import VirtualMachinesOperations -from .operations_async import VirtualMachineImagesOperations -from .operations_async import UsageOperations -from .operations_async import VirtualMachineSizesOperations -from .operations_async import ImagesOperations -from .operations_async import VirtualMachineScaleSetsOperations -from .operations_async import VirtualMachineScaleSetVMsOperations -from .operations_async import DisksOperations -from .operations_async import SnapshotsOperations +from ._configuration import ComputeManagementClientConfiguration +from .operations import AvailabilitySetsOperations +from .operations import VirtualMachineExtensionImagesOperations +from .operations import VirtualMachineExtensionsOperations +from .operations import VirtualMachinesOperations +from .operations import VirtualMachineImagesOperations +from .operations import UsageOperations +from .operations import VirtualMachineSizesOperations +from .operations import ImagesOperations +from .operations import VirtualMachineScaleSetsOperations +from .operations import VirtualMachineScaleSetVMsOperations +from .operations import DisksOperations +from .operations import SnapshotsOperations from .. import models @@ -35,29 +35,29 @@ class ComputeManagementClient(object): """Compute Client. :ivar availability_sets: AvailabilitySetsOperations operations - :vartype availability_sets: azure.mgmt.compute.v2016_04_30_preview.aio.operations_async.AvailabilitySetsOperations + :vartype availability_sets: azure.mgmt.compute.v2016_04_30_preview.aio.operations.AvailabilitySetsOperations :ivar virtual_machine_extension_images: VirtualMachineExtensionImagesOperations operations - :vartype virtual_machine_extension_images: azure.mgmt.compute.v2016_04_30_preview.aio.operations_async.VirtualMachineExtensionImagesOperations + :vartype virtual_machine_extension_images: azure.mgmt.compute.v2016_04_30_preview.aio.operations.VirtualMachineExtensionImagesOperations :ivar virtual_machine_extensions: VirtualMachineExtensionsOperations operations - :vartype virtual_machine_extensions: azure.mgmt.compute.v2016_04_30_preview.aio.operations_async.VirtualMachineExtensionsOperations + :vartype virtual_machine_extensions: azure.mgmt.compute.v2016_04_30_preview.aio.operations.VirtualMachineExtensionsOperations :ivar virtual_machines: VirtualMachinesOperations operations - :vartype virtual_machines: azure.mgmt.compute.v2016_04_30_preview.aio.operations_async.VirtualMachinesOperations + :vartype virtual_machines: azure.mgmt.compute.v2016_04_30_preview.aio.operations.VirtualMachinesOperations :ivar virtual_machine_images: VirtualMachineImagesOperations operations - :vartype virtual_machine_images: azure.mgmt.compute.v2016_04_30_preview.aio.operations_async.VirtualMachineImagesOperations + :vartype virtual_machine_images: azure.mgmt.compute.v2016_04_30_preview.aio.operations.VirtualMachineImagesOperations :ivar usage: UsageOperations operations - :vartype usage: azure.mgmt.compute.v2016_04_30_preview.aio.operations_async.UsageOperations + :vartype usage: azure.mgmt.compute.v2016_04_30_preview.aio.operations.UsageOperations :ivar virtual_machine_sizes: VirtualMachineSizesOperations operations - :vartype virtual_machine_sizes: azure.mgmt.compute.v2016_04_30_preview.aio.operations_async.VirtualMachineSizesOperations + :vartype virtual_machine_sizes: azure.mgmt.compute.v2016_04_30_preview.aio.operations.VirtualMachineSizesOperations :ivar images: ImagesOperations operations - :vartype images: azure.mgmt.compute.v2016_04_30_preview.aio.operations_async.ImagesOperations + :vartype images: azure.mgmt.compute.v2016_04_30_preview.aio.operations.ImagesOperations :ivar virtual_machine_scale_sets: VirtualMachineScaleSetsOperations operations - :vartype virtual_machine_scale_sets: azure.mgmt.compute.v2016_04_30_preview.aio.operations_async.VirtualMachineScaleSetsOperations + :vartype virtual_machine_scale_sets: azure.mgmt.compute.v2016_04_30_preview.aio.operations.VirtualMachineScaleSetsOperations :ivar virtual_machine_scale_set_vms: VirtualMachineScaleSetVMsOperations operations - :vartype virtual_machine_scale_set_vms: azure.mgmt.compute.v2016_04_30_preview.aio.operations_async.VirtualMachineScaleSetVMsOperations + :vartype virtual_machine_scale_set_vms: azure.mgmt.compute.v2016_04_30_preview.aio.operations.VirtualMachineScaleSetVMsOperations :ivar disks: DisksOperations operations - :vartype disks: azure.mgmt.compute.v2016_04_30_preview.aio.operations_async.DisksOperations + :vartype disks: azure.mgmt.compute.v2016_04_30_preview.aio.operations.DisksOperations :ivar snapshots: SnapshotsOperations operations - :vartype snapshots: azure.mgmt.compute.v2016_04_30_preview.aio.operations_async.SnapshotsOperations + :vartype snapshots: azure.mgmt.compute.v2016_04_30_preview.aio.operations.SnapshotsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. @@ -80,6 +80,7 @@ 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/aio/_configuration_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/_configuration.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/_configuration_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/_configuration.py index 7573a4479cfc..e04183b6207d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/_configuration_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -44,8 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2016-04-30-preview" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-compute/{}'.format(VERSION)) self._configure(**kwargs) @@ -57,6 +57,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/__init__.py new file mode 100644 index 000000000000..1887a28bbe4c --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/__init__.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._availability_sets_operations import AvailabilitySetsOperations +from ._virtual_machine_extension_images_operations import VirtualMachineExtensionImagesOperations +from ._virtual_machine_extensions_operations import VirtualMachineExtensionsOperations +from ._virtual_machines_operations import VirtualMachinesOperations +from ._virtual_machine_images_operations import VirtualMachineImagesOperations +from ._usage_operations import UsageOperations +from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations +from ._images_operations import ImagesOperations +from ._virtual_machine_scale_sets_operations import VirtualMachineScaleSetsOperations +from ._virtual_machine_scale_set_vms_operations import VirtualMachineScaleSetVMsOperations +from ._disks_operations import DisksOperations +from ._snapshots_operations import SnapshotsOperations + +__all__ = [ + 'AvailabilitySetsOperations', + 'VirtualMachineExtensionImagesOperations', + 'VirtualMachineExtensionsOperations', + 'VirtualMachinesOperations', + 'VirtualMachineImagesOperations', + 'UsageOperations', + 'VirtualMachineSizesOperations', + 'ImagesOperations', + 'VirtualMachineScaleSetsOperations', + 'VirtualMachineScaleSetVMsOperations', + 'DisksOperations', + 'SnapshotsOperations', +] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/_availability_sets_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_availability_sets_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/_availability_sets_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_availability_sets_operations.py index 06be379fa2ba..0827933e711f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/_availability_sets_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_availability_sets_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -62,10 +62,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -83,14 +86,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailabilitySet') 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 @@ -111,7 +112,7 @@ async def delete( resource_group_name: str, availability_set_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> Optional["models.OperationStatusResponse"]: """Delete an availability set. :param resource_group_name: The name of the resource group. @@ -123,10 +124,13 @@ async def delete( :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore @@ -143,9 +147,8 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -182,9 +185,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -201,9 +207,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -232,11 +237,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + 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_subscription.metadata['url'] # type: ignore @@ -248,15 +260,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -298,11 +306,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + 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 @@ -315,15 +330,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -357,7 +368,7 @@ def list_available_sizes( **kwargs ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes that can be used to create a new virtual machine in - an existing availability set. + an existing availability set. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -369,11 +380,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + 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_available_sizes.metadata['url'] # type: ignore @@ -387,15 +405,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/_disks_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_disks_operations.py similarity index 87% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/_disks_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_disks_operations.py index 0a0cab9303de..c2eba1321480 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/_disks_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_disks_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.Disk": cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('Disk', pipeline_response) @@ -106,14 +106,14 @@ async def begin_create_or_update( disk_name: str, disk: "models.Disk", **kwargs - ) -> "models.Disk": + ) -> 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. + 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.v2016_04_30_preview.models.Disk @@ -123,8 +123,8 @@ async def begin_create_or_update( 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: Disk, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.Disk + :return: An instance of AsyncLROPoller that returns either Disk or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.Disk] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -175,10 +175,13 @@ async def _update_initial( **kwargs ) -> "models.Disk": cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -196,14 +199,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -211,7 +212,6 @@ async def _update_initial( 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('Disk', pipeline_response) @@ -230,14 +230,14 @@ async def begin_update( disk_name: str, disk: "models.DiskUpdate", **kwargs - ) -> "models.Disk": + ) -> 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. + 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.v2016_04_30_preview.models.DiskUpdate @@ -247,8 +247,8 @@ async def begin_update( 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: Disk, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.Disk + :return: An instance of AsyncLROPoller that returns either Disk or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.Disk] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -311,9 +311,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -330,9 +333,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -354,11 +356,14 @@ async def _delete_initial( resource_group_name: str, disk_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -375,9 +380,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -401,14 +405,14 @@ async def begin_delete( resource_group_name: str, disk_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """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. + 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. @@ -416,8 +420,8 @@ async def begin_delete( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -474,11 +478,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + 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 @@ -491,15 +502,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -538,11 +545,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + 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 @@ -554,15 +568,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -595,12 +605,15 @@ async def _grant_access_initial( disk_name: str, grant_access_data: "models.GrantAccessData", **kwargs - ) -> "models.AccessUri": - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> 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 = "2016-04-30-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._grant_access_initial.metadata['url'] # type: ignore @@ -618,14 +631,12 @@ async def _grant_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -649,17 +660,17 @@ async def begin_grant_access( disk_name: str, grant_access_data: "models.GrantAccessData", **kwargs - ) -> "models.AccessUri": + ) -> 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. + 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. + operation. :type grant_access_data: ~azure.mgmt.compute.v2016_04_30_preview.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. @@ -667,8 +678,8 @@ async def begin_grant_access( 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: AccessUri, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.AccessUri + :return: An instance of AsyncLROPoller that returns either AccessUri or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.AccessUri] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -716,11 +727,14 @@ async def _revoke_access_initial( resource_group_name: str, disk_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._revoke_access_initial.metadata['url'] # type: ignore @@ -737,9 +751,8 @@ async def _revoke_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -763,14 +776,14 @@ async def begin_revoke_access( resource_group_name: str, disk_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """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. + 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. @@ -778,8 +791,8 @@ async def begin_revoke_access( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/_images_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_images_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/_images_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_images_operations.py index b25eab4ba25e..17d28063ba64 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/_images_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_images_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.Image": cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'Image') 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('Image', pipeline_response) @@ -106,7 +106,7 @@ async def begin_create_or_update( image_name: str, parameters: "models.Image", **kwargs - ) -> "models.Image": + ) -> AsyncLROPoller["models.Image"]: """Create or update an image. :param resource_group_name: The name of the resource group. @@ -121,8 +121,8 @@ async def begin_create_or_update( 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: Image, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.Image + :return: An instance of AsyncLROPoller that returns either Image or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.Image] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -170,11 +170,14 @@ async def _delete_initial( resource_group_name: str, image_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -191,9 +194,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -217,7 +219,7 @@ async def begin_delete( resource_group_name: str, image_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Deletes an Image. :param resource_group_name: The name of the resource group. @@ -230,8 +232,8 @@ async def begin_delete( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -294,9 +296,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -315,9 +320,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -349,11 +353,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + 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 @@ -366,15 +377,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -406,7 +413,7 @@ def list( **kwargs ) -> AsyncIterable["models.ImageListResult"]: """Gets the list of Images in the subscription. Use nextLink property in the response to get the - next page of Images. Do this till nextLink is null to fetch all the Images. + next page of Images. Do this till nextLink is null to fetch all the Images. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ImageListResult or the result of cls(response) @@ -414,11 +421,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + 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 @@ -430,15 +444,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/_snapshots_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_snapshots_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/_snapshots_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_snapshots_operations.py index 33ee6c27ba36..dd65efcd389e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/_snapshots_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_snapshots_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.Snapshot": cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('Snapshot', pipeline_response) @@ -106,13 +106,13 @@ async def begin_create_or_update( snapshot_name: str, snapshot: "models.Snapshot", **kwargs - ) -> "models.Snapshot": + ) -> 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 within the given subscription and resource - group. + group. :type snapshot_name: str :param snapshot: Snapshot object supplied in the body of the Put disk operation. :type snapshot: ~azure.mgmt.compute.v2016_04_30_preview.models.Snapshot @@ -122,8 +122,8 @@ async def begin_create_or_update( 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: Snapshot, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.Snapshot + :return: An instance of AsyncLROPoller that returns either Snapshot or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.Snapshot] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -174,10 +174,13 @@ async def _update_initial( **kwargs ) -> "models.Snapshot": cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -195,14 +198,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -210,7 +211,6 @@ async def _update_initial( 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('Snapshot', pipeline_response) @@ -229,13 +229,13 @@ async def begin_update( snapshot_name: str, snapshot: "models.SnapshotUpdate", **kwargs - ) -> "models.Snapshot": + ) -> 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 within the given subscription and resource - group. + group. :type snapshot_name: str :param snapshot: Snapshot object supplied in the body of the Patch snapshot operation. :type snapshot: ~azure.mgmt.compute.v2016_04_30_preview.models.SnapshotUpdate @@ -245,8 +245,8 @@ async def begin_update( 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: Snapshot, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.Snapshot + :return: An instance of AsyncLROPoller that returns either Snapshot or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.Snapshot] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -308,9 +308,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -327,9 +330,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -351,11 +353,14 @@ async def _delete_initial( resource_group_name: str, snapshot_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -372,9 +377,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -398,13 +402,13 @@ async def begin_delete( resource_group_name: str, snapshot_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """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 within the given subscription and resource - group. + group. :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. @@ -412,8 +416,8 @@ async def begin_delete( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -470,11 +474,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + 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 @@ -487,15 +498,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -534,11 +541,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + 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 @@ -550,15 +564,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -591,12 +601,15 @@ async def _grant_access_initial( snapshot_name: str, grant_access_data: "models.GrantAccessData", **kwargs - ) -> "models.AccessUri": - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> 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 = "2016-04-30-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._grant_access_initial.metadata['url'] # type: ignore @@ -614,14 +627,12 @@ async def _grant_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -645,16 +656,16 @@ async def begin_grant_access( snapshot_name: str, grant_access_data: "models.GrantAccessData", **kwargs - ) -> "models.AccessUri": + ) -> 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 within the given subscription and resource - group. + group. :type snapshot_name: str :param grant_access_data: Access data object supplied in the body of the get snapshot access - operation. + operation. :type grant_access_data: ~azure.mgmt.compute.v2016_04_30_preview.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. @@ -662,8 +673,8 @@ async def begin_grant_access( 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: AccessUri, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.AccessUri + :return: An instance of AsyncLROPoller that returns either AccessUri or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.AccessUri] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -711,11 +722,14 @@ async def _revoke_access_initial( resource_group_name: str, snapshot_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._revoke_access_initial.metadata['url'] # type: ignore @@ -732,9 +746,8 @@ async def _revoke_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -758,13 +771,13 @@ async def begin_revoke_access( resource_group_name: str, snapshot_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """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 within the given subscription and resource - group. + group. :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. @@ -772,8 +785,8 @@ async def begin_revoke_access( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/_usage_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_usage_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/_usage_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_usage_operations.py index 6840498fa872..42e853bca174 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/_usage_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_usage_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -47,7 +47,7 @@ def list( **kwargs ) -> AsyncIterable["models.ListUsagesResult"]: """Gets, for the specified location, the current compute resource usage information as well as the - limits for compute resources under the subscription. + limits for compute resources under the subscription. :param location: The location for which resource usage is queried. :type location: str @@ -57,11 +57,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + 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 @@ -74,15 +81,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/_virtual_machine_extension_images_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_extension_images_operations.py similarity index 92% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/_virtual_machine_extension_images_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_extension_images_operations.py index efb58d802585..013027f96fab 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/_virtual_machine_extension_images_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_extension_images_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -64,9 +64,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -85,9 +88,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -122,9 +124,12 @@ async def list_types( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.list_types.metadata['url'] # type: ignore @@ -141,9 +146,8 @@ async def list_types( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -190,9 +194,12 @@ async def list_versions( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.list_versions.metadata['url'] # type: ignore @@ -216,9 +223,8 @@ async def list_versions( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/_virtual_machine_extensions_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_extensions_operations.py similarity index 90% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/_virtual_machine_extensions_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_extensions_operations.py index a8c11ccecfd1..03414a2c83d4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/_virtual_machine_extensions_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_extensions_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachineExtension": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -73,14 +76,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtension') 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 @@ -88,7 +89,6 @@ async def _create_or_update_initial( 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('VirtualMachineExtension', pipeline_response) @@ -108,18 +108,18 @@ async def begin_create_or_update( vm_extension_name: str, extension_parameters: "models.VirtualMachineExtension", **kwargs - ) -> "models.VirtualMachineExtension": + ) -> AsyncLROPoller["models.VirtualMachineExtension"]: """The operation to create or update the extension. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_name: The name of the virtual machine where the extension should be created or - updated. + updated. :type vm_name: str :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Create Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineExtension :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. @@ -127,8 +127,8 @@ async def begin_create_or_update( 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: VirtualMachineExtension, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineExtension + :return: An instance of AsyncLROPoller that returns either VirtualMachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -181,10 +181,13 @@ async def _update_initial( **kwargs ) -> "models.VirtualMachineExtension": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -203,14 +206,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtensionUpdate') 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 @@ -233,7 +234,7 @@ async def begin_update( vm_extension_name: str, extension_parameters: "models.VirtualMachineExtensionUpdate", **kwargs - ) -> "models.VirtualMachineExtension": + ) -> AsyncLROPoller["models.VirtualMachineExtension"]: """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -243,7 +244,7 @@ async def begin_update( :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Update Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineExtensionUpdate :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. @@ -251,8 +252,8 @@ async def begin_update( 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: VirtualMachineExtension, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineExtension + :return: An instance of AsyncLROPoller that returns either VirtualMachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -302,11 +303,14 @@ async def _delete_initial( vm_name: str, vm_extension_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -324,9 +328,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -351,7 +354,7 @@ async def begin_delete( vm_name: str, vm_extension_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -366,8 +369,8 @@ async def begin_delete( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -434,9 +437,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -456,9 +462,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/_virtual_machine_images_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_images_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/_virtual_machine_images_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_images_operations.py index 73ea33381a8b..9d4843febaf4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/_virtual_machine_images_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_images_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -67,9 +67,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -89,9 +92,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -142,9 +144,12 @@ async def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -169,9 +174,8 @@ async def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -206,9 +210,12 @@ async def list_offers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.list_offers.metadata['url'] # type: ignore @@ -225,9 +232,8 @@ async def list_offers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -259,9 +265,12 @@ async def list_publishers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.list_publishers.metadata['url'] # type: ignore @@ -277,9 +286,8 @@ async def list_publishers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -317,9 +325,12 @@ async def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.list_skus.metadata['url'] # type: ignore @@ -337,9 +348,8 @@ async def list_skus( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/_virtual_machine_scale_set_vms_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_scale_set_vms_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/_virtual_machine_scale_set_vms_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_scale_set_vms_operations.py index b0025c1837d6..6f20b94404e1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/_virtual_machine_scale_set_vms_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -49,11 +49,14 @@ async def _reimage_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._reimage_initial.metadata['url'] # type: ignore @@ -71,9 +74,8 @@ async def _reimage_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -98,7 +100,7 @@ async def begin_reimage( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -113,8 +115,8 @@ async def begin_reimage( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -163,11 +165,14 @@ async def _reimage_all_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._reimage_all_initial.metadata['url'] # type: ignore @@ -185,9 +190,8 @@ async def _reimage_all_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -212,9 +216,9 @@ async def begin_reimage_all( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. - This operation is only supported for managed disks. + This operation is only supported for managed disks. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -228,8 +232,8 @@ async def begin_reimage_all( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -278,11 +282,14 @@ async def _deallocate_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._deallocate_initial.metadata['url'] # type: ignore @@ -300,9 +307,8 @@ async def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -327,10 +333,10 @@ async def begin_deallocate( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and - releases the compute resources it uses. You are not billed for the compute resources of this - virtual machine once it is deallocated. + releases the compute resources it uses. You are not billed for the compute resources of this + virtual machine once it is deallocated. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -344,8 +350,8 @@ async def begin_deallocate( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -394,11 +400,14 @@ async def _delete_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -416,9 +425,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -443,7 +451,7 @@ async def begin_delete( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Deletes a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -458,8 +466,8 @@ async def begin_delete( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -523,9 +531,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -543,9 +554,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -583,9 +593,12 @@ async def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -603,9 +616,8 @@ async def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -649,11 +661,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + 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 @@ -673,15 +692,11 @@ def prepare_request(next_link=None): query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -714,11 +729,14 @@ async def _power_off_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._power_off_initial.metadata['url'] # type: ignore @@ -736,9 +754,8 @@ async def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -763,10 +780,10 @@ async def begin_power_off( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached - and you are getting charged for the resources. Instead, use deallocate to release resources and - avoid charges. + and you are getting charged for the resources. Instead, use deallocate to release resources and + avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -780,8 +797,8 @@ async def begin_power_off( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -830,11 +847,14 @@ async def _restart_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._restart_initial.metadata['url'] # type: ignore @@ -852,9 +872,8 @@ async def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -879,7 +898,7 @@ async def begin_restart( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Restarts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -894,8 +913,8 @@ async def begin_restart( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -944,11 +963,14 @@ async def _start_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._start_initial.metadata['url'] # type: ignore @@ -966,9 +988,8 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -993,7 +1014,7 @@ async def begin_start( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Starts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1008,8 +1029,8 @@ async def begin_start( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/_virtual_machine_scale_sets_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_scale_sets_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/_virtual_machine_scale_sets_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_scale_sets_operations.py index ca24f9884fbe..92ef3158490e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/_virtual_machine_scale_sets_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_scale_sets_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachineScaleSet": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSet') 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('VirtualMachineScaleSet', pipeline_response) @@ -106,7 +106,7 @@ async def begin_create_or_update( name: str, parameters: "models.VirtualMachineScaleSet", **kwargs - ) -> "models.VirtualMachineScaleSet": + ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -121,8 +121,8 @@ async def begin_create_or_update( 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: VirtualMachineScaleSet, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSet + :return: An instance of AsyncLROPoller that returns either VirtualMachineScaleSet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -170,11 +170,14 @@ async def _delete_initial( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -191,9 +194,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -217,7 +219,7 @@ async def begin_delete( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Deletes a VM scale set. :param resource_group_name: The name of the resource group. @@ -230,8 +232,8 @@ async def begin_delete( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -291,9 +293,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -310,9 +315,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -335,12 +339,15 @@ async def _deallocate_initial( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._deallocate_initial.metadata['url'] # type: ignore @@ -358,9 +365,8 @@ async def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -368,7 +374,6 @@ async def _deallocate_initial( body_content = None 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 @@ -392,10 +397,10 @@ async def begin_deallocate( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and - releases the compute resources. You are not billed for the compute resources that this virtual - machine scale set deallocates. + releases the compute resources. You are not billed for the compute resources that this virtual + machine scale set deallocates. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -409,8 +414,8 @@ async def begin_deallocate( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,12 +464,15 @@ async def _delete_instances_initial( vm_scale_set_name: str, vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._delete_instances_initial.metadata['url'] # type: ignore @@ -482,14 +490,12 @@ async def _delete_instances_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -513,7 +519,7 @@ async def begin_delete_instances( vm_scale_set_name: str, vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Deletes virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -528,8 +534,8 @@ async def begin_delete_instances( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -590,9 +596,12 @@ async def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -609,9 +618,8 @@ async def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -643,11 +651,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + 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 @@ -660,15 +675,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -700,8 +711,8 @@ def list_all( **kwargs ) -> AsyncIterable["models.VirtualMachineScaleSetListWithLinkResult"]: """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource - group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this - till nextLink is null to fetch all the VM Scale Sets. + group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this + till nextLink is null to fetch all the VM Scale Sets. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetListWithLinkResult or the result of cls(response) @@ -709,11 +720,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + 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_all.metadata['url'] # type: ignore @@ -725,15 +743,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -767,7 +781,7 @@ def list_skus( **kwargs ) -> AsyncIterable["models.VirtualMachineScaleSetListSkusResult"]: """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM - instances allowed for each SKU. + instances allowed for each SKU. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -779,11 +793,18 @@ def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + 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_skus.metadata['url'] # type: ignore @@ -797,15 +818,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -838,12 +855,15 @@ async def _power_off_initial( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._power_off_initial.metadata['url'] # type: ignore @@ -861,9 +881,8 @@ async def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -871,7 +890,6 @@ async def _power_off_initial( body_content = None 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 @@ -895,10 +913,10 @@ async def begin_power_off( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still - attached and you are getting charged for the resources. Instead, use deallocate to release - resources and avoid charges. + attached and you are getting charged for the resources. Instead, use deallocate to release + resources and avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -912,8 +930,8 @@ async def begin_power_off( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -962,12 +980,15 @@ async def _restart_initial( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._restart_initial.metadata['url'] # type: ignore @@ -985,9 +1006,8 @@ async def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -995,7 +1015,6 @@ async def _restart_initial( body_content = None 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 @@ -1019,7 +1038,7 @@ async def begin_restart( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Restarts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1034,8 +1053,8 @@ async def begin_restart( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1084,12 +1103,15 @@ async def _start_initial( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._start_initial.metadata['url'] # type: ignore @@ -1107,9 +1129,8 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1117,7 +1138,6 @@ async def _start_initial( body_content = None 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 @@ -1141,7 +1161,7 @@ async def begin_start( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Starts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1156,8 +1176,8 @@ async def begin_start( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1206,12 +1226,15 @@ async def _update_instances_initial( vm_scale_set_name: str, vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_instances_initial.metadata['url'] # type: ignore @@ -1229,14 +1252,12 @@ async def _update_instances_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -1260,7 +1281,7 @@ async def begin_update_instances( vm_scale_set_name: str, vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. :param resource_group_name: The name of the resource group. @@ -1275,8 +1296,8 @@ async def begin_update_instances( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1324,11 +1345,14 @@ async def _reimage_initial( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._reimage_initial.metadata['url'] # type: ignore @@ -1345,9 +1369,8 @@ async def _reimage_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1371,7 +1394,7 @@ async def begin_reimage( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1384,8 +1407,8 @@ async def begin_reimage( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1432,11 +1455,14 @@ async def _reimage_all_initial( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._reimage_all_initial.metadata['url'] # type: ignore @@ -1453,9 +1479,8 @@ async def _reimage_all_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1479,9 +1504,9 @@ async def begin_reimage_all( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This - operation is only supported for managed disks. + operation is only supported for managed disks. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1493,8 +1518,8 @@ async def begin_reimage_all( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/_virtual_machine_sizes_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_sizes_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/_virtual_machine_sizes_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_sizes_operations.py index b1a8a40297f3..de9a09c33384 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/_virtual_machine_sizes_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_sizes_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,11 +56,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + 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 @@ -73,15 +80,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/_virtual_machines_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machines_operations.py similarity index 87% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/_virtual_machines_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machines_operations.py index 0047a3e4a118..4cf5d181cedc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/_virtual_machines_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machines_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -64,9 +64,12 @@ async def get_extensions( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.get_extensions.metadata['url'] # type: ignore @@ -85,9 +88,8 @@ async def get_extensions( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -110,12 +112,15 @@ async def _capture_initial( vm_name: str, parameters: "models.VirtualMachineCaptureParameters", **kwargs - ) -> "models.VirtualMachineCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.VirtualMachineCaptureResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._capture_initial.metadata['url'] # type: ignore @@ -133,14 +138,12 @@ async def _capture_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineCaptureParameters') 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 @@ -164,9 +167,9 @@ async def begin_capture( vm_name: str, parameters: "models.VirtualMachineCaptureParameters", **kwargs - ) -> "models.VirtualMachineCaptureResult": + ) -> AsyncLROPoller["models.VirtualMachineCaptureResult"]: """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used - to create similar VMs. + to create similar VMs. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -180,8 +183,8 @@ async def begin_capture( 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: VirtualMachineCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineCaptureResult + :return: An instance of AsyncLROPoller that returns either VirtualMachineCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineCaptureResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -232,10 +235,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachine": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -253,14 +259,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachine') 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 @@ -268,7 +272,6 @@ async def _create_or_update_initial( 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('VirtualMachine', pipeline_response) @@ -287,7 +290,7 @@ async def begin_create_or_update( vm_name: str, parameters: "models.VirtualMachine", **kwargs - ) -> "models.VirtualMachine": + ) -> AsyncLROPoller["models.VirtualMachine"]: """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -302,8 +305,8 @@ async def begin_create_or_update( 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: VirtualMachine, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachine + :return: An instance of AsyncLROPoller that returns either VirtualMachine or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachine] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,11 +354,14 @@ async def _delete_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -372,9 +378,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -398,7 +403,7 @@ async def begin_delete( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """The operation to delete a virtual machine. :param resource_group_name: The name of the resource group. @@ -411,8 +416,8 @@ async def begin_delete( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -475,9 +480,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -496,9 +504,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -520,11 +527,14 @@ async def _convert_to_managed_disks_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._convert_to_managed_disks_initial.metadata['url'] # type: ignore @@ -541,9 +551,8 @@ async def _convert_to_managed_disks_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -567,9 +576,9 @@ async def begin_convert_to_managed_disks( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop- - deallocated before invoking this operation. + deallocated before invoking this operation. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -581,8 +590,8 @@ async def begin_convert_to_managed_disks( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -629,11 +638,14 @@ async def _deallocate_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._deallocate_initial.metadata['url'] # type: ignore @@ -650,9 +662,8 @@ async def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -676,9 +687,9 @@ async def begin_deallocate( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Shuts down the virtual machine and releases the compute resources. You are not billed for the - compute resources that this virtual machine uses. + compute resources that this virtual machine uses. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -690,8 +701,8 @@ async def begin_deallocate( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -751,9 +762,12 @@ async def generalize( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.generalize.metadata['url'] # type: ignore @@ -770,9 +784,8 @@ async def generalize( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -795,7 +808,7 @@ def list( **kwargs ) -> AsyncIterable["models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified resource group. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -805,11 +818,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + 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 @@ -822,15 +842,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -862,7 +878,7 @@ def list_all( **kwargs ) -> AsyncIterable["models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified subscription. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineListResult or the result of cls(response) @@ -870,11 +886,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + 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_all.metadata['url'] # type: ignore @@ -886,15 +909,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -928,7 +947,7 @@ def list_available_sizes( **kwargs ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes to which the specified virtual machine can be - resized. + resized. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -940,11 +959,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + 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_available_sizes.metadata['url'] # type: ignore @@ -958,15 +984,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -998,11 +1020,14 @@ async def _power_off_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._power_off_initial.metadata['url'] # type: ignore @@ -1019,9 +1044,8 @@ async def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1045,9 +1069,9 @@ async def begin_power_off( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with - the same provisioned resources. You are still charged for this virtual machine. + the same provisioned resources. You are still charged for this virtual machine. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1059,8 +1083,8 @@ async def begin_power_off( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1107,11 +1131,14 @@ async def _restart_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._restart_initial.metadata['url'] # type: ignore @@ -1128,9 +1155,8 @@ async def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1154,7 +1180,7 @@ async def begin_restart( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """The operation to restart a virtual machine. :param resource_group_name: The name of the resource group. @@ -1167,8 +1193,8 @@ async def begin_restart( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1215,11 +1241,14 @@ async def _start_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._start_initial.metadata['url'] # type: ignore @@ -1236,9 +1265,8 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1262,7 +1290,7 @@ async def begin_start( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """The operation to start a virtual machine. :param resource_group_name: The name of the resource group. @@ -1275,8 +1303,8 @@ async def begin_start( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1323,11 +1351,14 @@ async def _redeploy_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._redeploy_initial.metadata['url'] # type: ignore @@ -1344,9 +1375,8 @@ async def _redeploy_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1370,7 +1400,7 @@ async def begin_redeploy( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Shuts down the virtual machine, moves it to a new node, and powers it back on. :param resource_group_name: The name of the resource group. @@ -1383,8 +1413,8 @@ async def begin_redeploy( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/__init__.py deleted file mode 100644 index f0dc47d18de6..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations_async/__init__.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 ._availability_sets_operations_async import AvailabilitySetsOperations -from ._virtual_machine_extension_images_operations_async import VirtualMachineExtensionImagesOperations -from ._virtual_machine_extensions_operations_async import VirtualMachineExtensionsOperations -from ._virtual_machines_operations_async import VirtualMachinesOperations -from ._virtual_machine_images_operations_async import VirtualMachineImagesOperations -from ._usage_operations_async import UsageOperations -from ._virtual_machine_sizes_operations_async import VirtualMachineSizesOperations -from ._images_operations_async import ImagesOperations -from ._virtual_machine_scale_sets_operations_async import VirtualMachineScaleSetsOperations -from ._virtual_machine_scale_set_vms_operations_async import VirtualMachineScaleSetVMsOperations -from ._disks_operations_async import DisksOperations -from ._snapshots_operations_async import SnapshotsOperations - -__all__ = [ - 'AvailabilitySetsOperations', - 'VirtualMachineExtensionImagesOperations', - 'VirtualMachineExtensionsOperations', - 'VirtualMachinesOperations', - 'VirtualMachineImagesOperations', - 'UsageOperations', - 'VirtualMachineSizesOperations', - 'ImagesOperations', - 'VirtualMachineScaleSetsOperations', - 'VirtualMachineScaleSetVMsOperations', - 'DisksOperations', - 'SnapshotsOperations', -] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/_compute_management_client_enums.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/_compute_management_client_enums.py index d20308cd84a4..9fabb4080374 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/_compute_management_client_enums.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/_compute_management_client_enums.py @@ -6,36 +6,54 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum +from enum import Enum, EnumMeta +from six import with_metaclass -class AccessLevel(str, Enum): +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) - none = "None" - read = "Read" + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) -class CachingTypes(str, Enum): + +class AccessLevel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + NONE = "None" + READ = "Read" + +class CachingTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the caching requirements. :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **None** :code:`
`:code:`
` **ReadOnly** :code:`
`:code:`
` **ReadWrite** :code:`
`:code:`
` Default: **None for Standard storage. ReadOnly for Premium storage** """ - none = "None" - read_only = "ReadOnly" - read_write = "ReadWrite" + NONE = "None" + READ_ONLY = "ReadOnly" + READ_WRITE = "ReadWrite" -class DiskCreateOption(str, Enum): +class DiskCreateOption(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """This enumerates the possible sources of a disk's creation. """ - empty = "Empty" - attach = "Attach" - from_image = "FromImage" - import_enum = "Import" - copy = "Copy" - restore = "Restore" + EMPTY = "Empty" + ATTACH = "Attach" + FROM_IMAGE = "FromImage" + IMPORT_ENUM = "Import" + COPY = "Copy" + RESTORE = "Restore" -class DiskCreateOptionTypes(str, Enum): +class DiskCreateOptionTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies how the virtual machine should be created.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` **Attach** \u2013 This value is used when you are using a specialized disk to create the virtual machine.:code:`
`:code:`
` **FromImage** \u2013 @@ -44,57 +62,57 @@ class DiskCreateOptionTypes(str, Enum): marketplace image, you also use the plan element previously described. """ - from_image = "FromImage" - empty = "Empty" - attach = "Attach" + FROM_IMAGE = "FromImage" + EMPTY = "Empty" + ATTACH = "Attach" -class OperatingSystemStateTypes(str, Enum): +class OperatingSystemStateTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The OS State. """ - generalized = "Generalized" - specialized = "Specialized" + GENERALIZED = "Generalized" + SPECIALIZED = "Specialized" -class OperatingSystemTypes(str, Enum): +class OperatingSystemTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The operating system of the osDiskImage. """ - windows = "Windows" - linux = "Linux" + WINDOWS = "Windows" + LINUX = "Linux" -class ProtocolTypes(str, Enum): +class ProtocolTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the protocol of listener. :code:`
`:code:`
` Possible values are: :code:`
`\ **http** :code:`
`:code:`
` **https** """ - http = "Http" - https = "Https" + HTTP = "Http" + HTTPS = "Https" -class SettingNames(str, Enum): +class SettingNames(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon. """ - auto_logon = "AutoLogon" - first_logon_commands = "FirstLogonCommands" + AUTO_LOGON = "AutoLogon" + FIRST_LOGON_COMMANDS = "FirstLogonCommands" -class StatusLevelTypes(str, Enum): +class StatusLevelTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The level code. """ - info = "Info" - warning = "Warning" - error = "Error" + INFO = "Info" + WARNING = "Warning" + ERROR = "Error" -class StorageAccountTypes(str, Enum): +class StorageAccountTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the storage account type for the managed disk. Possible values are: Standard_LRS or Premium_LRS. """ - standard_lrs = "Standard_LRS" - premium_lrs = "Premium_LRS" + STANDARD_LRS = "Standard_LRS" + PREMIUM_LRS = "Premium_LRS" -class UpgradeMode(str, Enum): +class UpgradeMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the mode of an upgrade to virtual machines in the scale set.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` **Manual** - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade @@ -102,17 +120,17 @@ class UpgradeMode(str, Enum): automatically updated at the same time. """ - automatic = "Automatic" - manual = "Manual" + AUTOMATIC = "Automatic" + MANUAL = "Manual" -class VirtualMachineScaleSetSkuScaleType(str, Enum): +class VirtualMachineScaleSetSkuScaleType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The scale type applicable to the sku. """ - automatic = "Automatic" - none = "None" + AUTOMATIC = "Automatic" + NONE = "None" -class VirtualMachineSizeTypes(str, Enum): +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 `_. @@ -124,66 +142,66 @@ class VirtualMachineSizeTypes(str, Enum): machine sizes for resizing `_ """ - basic_a0 = "Basic_A0" - basic_a1 = "Basic_A1" - basic_a2 = "Basic_A2" - basic_a3 = "Basic_A3" - basic_a4 = "Basic_A4" - standard_a0 = "Standard_A0" - standard_a1 = "Standard_A1" - standard_a2 = "Standard_A2" - standard_a3 = "Standard_A3" - standard_a4 = "Standard_A4" - standard_a5 = "Standard_A5" - standard_a6 = "Standard_A6" - standard_a7 = "Standard_A7" - standard_a8 = "Standard_A8" - standard_a9 = "Standard_A9" - standard_a10 = "Standard_A10" - standard_a11 = "Standard_A11" - standard_d1 = "Standard_D1" - standard_d2 = "Standard_D2" - standard_d3 = "Standard_D3" - standard_d4 = "Standard_D4" - standard_d11 = "Standard_D11" - standard_d12 = "Standard_D12" - standard_d13 = "Standard_D13" - standard_d14 = "Standard_D14" - standard_d1_v2 = "Standard_D1_v2" - standard_d2_v2 = "Standard_D2_v2" - standard_d3_v2 = "Standard_D3_v2" - standard_d4_v2 = "Standard_D4_v2" - standard_d5_v2 = "Standard_D5_v2" - standard_d11_v2 = "Standard_D11_v2" - standard_d12_v2 = "Standard_D12_v2" - standard_d13_v2 = "Standard_D13_v2" - standard_d14_v2 = "Standard_D14_v2" - standard_d15_v2 = "Standard_D15_v2" - standard_ds1 = "Standard_DS1" - standard_ds2 = "Standard_DS2" - standard_ds3 = "Standard_DS3" - standard_ds4 = "Standard_DS4" - standard_ds11 = "Standard_DS11" - standard_ds12 = "Standard_DS12" - standard_ds13 = "Standard_DS13" - standard_ds14 = "Standard_DS14" - standard_ds1_v2 = "Standard_DS1_v2" - standard_ds2_v2 = "Standard_DS2_v2" - standard_ds3_v2 = "Standard_DS3_v2" - standard_ds4_v2 = "Standard_DS4_v2" - standard_ds5_v2 = "Standard_DS5_v2" - standard_ds11_v2 = "Standard_DS11_v2" - standard_ds12_v2 = "Standard_DS12_v2" - standard_ds13_v2 = "Standard_DS13_v2" - standard_ds14_v2 = "Standard_DS14_v2" - standard_ds15_v2 = "Standard_DS15_v2" - standard_g1 = "Standard_G1" - standard_g2 = "Standard_G2" - standard_g3 = "Standard_G3" - standard_g4 = "Standard_G4" - standard_g5 = "Standard_G5" - standard_gs1 = "Standard_GS1" - standard_gs2 = "Standard_GS2" - standard_gs3 = "Standard_GS3" - standard_gs4 = "Standard_GS4" - standard_gs5 = "Standard_GS5" + BASIC_A0 = "Basic_A0" + BASIC_A1 = "Basic_A1" + BASIC_A2 = "Basic_A2" + BASIC_A3 = "Basic_A3" + BASIC_A4 = "Basic_A4" + STANDARD_A0 = "Standard_A0" + STANDARD_A1 = "Standard_A1" + STANDARD_A2 = "Standard_A2" + STANDARD_A3 = "Standard_A3" + STANDARD_A4 = "Standard_A4" + STANDARD_A5 = "Standard_A5" + STANDARD_A6 = "Standard_A6" + STANDARD_A7 = "Standard_A7" + STANDARD_A8 = "Standard_A8" + STANDARD_A9 = "Standard_A9" + STANDARD_A10 = "Standard_A10" + STANDARD_A11 = "Standard_A11" + STANDARD_D1 = "Standard_D1" + STANDARD_D2 = "Standard_D2" + STANDARD_D3 = "Standard_D3" + STANDARD_D4 = "Standard_D4" + STANDARD_D11 = "Standard_D11" + STANDARD_D12 = "Standard_D12" + STANDARD_D13 = "Standard_D13" + STANDARD_D14 = "Standard_D14" + STANDARD_D1_V2 = "Standard_D1_v2" + STANDARD_D2_V2 = "Standard_D2_v2" + STANDARD_D3_V2 = "Standard_D3_v2" + STANDARD_D4_V2 = "Standard_D4_v2" + STANDARD_D5_V2 = "Standard_D5_v2" + STANDARD_D11_V2 = "Standard_D11_v2" + STANDARD_D12_V2 = "Standard_D12_v2" + STANDARD_D13_V2 = "Standard_D13_v2" + STANDARD_D14_V2 = "Standard_D14_v2" + STANDARD_D15_V2 = "Standard_D15_v2" + STANDARD_DS1 = "Standard_DS1" + STANDARD_DS2 = "Standard_DS2" + STANDARD_DS3 = "Standard_DS3" + STANDARD_DS4 = "Standard_DS4" + STANDARD_DS11 = "Standard_DS11" + STANDARD_DS12 = "Standard_DS12" + STANDARD_DS13 = "Standard_DS13" + STANDARD_DS14 = "Standard_DS14" + STANDARD_DS1_V2 = "Standard_DS1_v2" + STANDARD_DS2_V2 = "Standard_DS2_v2" + STANDARD_DS3_V2 = "Standard_DS3_v2" + STANDARD_DS4_V2 = "Standard_DS4_v2" + STANDARD_DS5_V2 = "Standard_DS5_v2" + STANDARD_DS11_V2 = "Standard_DS11_v2" + STANDARD_DS12_V2 = "Standard_DS12_v2" + STANDARD_DS13_V2 = "Standard_DS13_v2" + STANDARD_DS14_V2 = "Standard_DS14_v2" + STANDARD_DS15_V2 = "Standard_DS15_v2" + STANDARD_G1 = "Standard_G1" + STANDARD_G2 = "Standard_G2" + STANDARD_G3 = "Standard_G3" + STANDARD_G4 = "Standard_G4" + STANDARD_G5 = "Standard_G5" + STANDARD_GS1 = "Standard_GS1" + STANDARD_GS2 = "Standard_GS2" + STANDARD_GS3 = "Standard_GS3" + STANDARD_GS4 = "Standard_GS4" + STANDARD_GS5 = "Standard_GS5" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_availability_sets_operations.py index 7eefc48a5e3a..ad8549434483 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_availability_sets_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -67,10 +67,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -88,14 +91,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailabilitySet') 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 @@ -117,7 +118,7 @@ def delete( availability_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" + # type: (...) -> Optional["models.OperationStatusResponse"] """Delete an availability set. :param resource_group_name: The name of the resource group. @@ -129,10 +130,13 @@ def delete( :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore @@ -149,9 +153,8 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -189,9 +192,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -208,9 +214,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -240,11 +245,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + 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_subscription.metadata['url'] # type: ignore @@ -256,15 +268,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -307,11 +315,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + 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 @@ -324,15 +339,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -367,7 +378,7 @@ def list_available_sizes( ): # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes that can be used to create a new virtual machine in - an existing availability set. + an existing availability set. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -379,11 +390,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + 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_available_sizes.metadata['url'] # type: ignore @@ -397,15 +415,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_disks_operations.py index e2cb5ab7f06e..a76b30749fd1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_disks_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.Disk" cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('Disk', pipeline_response) @@ -112,14 +112,14 @@ def begin_create_or_update( disk, # type: "models.Disk" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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.v2016_04_30_preview.models.Disk @@ -182,10 +182,13 @@ def _update_initial( ): # type: (...) -> "models.Disk" cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -203,14 +206,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -218,7 +219,6 @@ def _update_initial( 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('Disk', pipeline_response) @@ -238,14 +238,14 @@ def begin_update( disk, # type: "models.DiskUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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.v2016_04_30_preview.models.DiskUpdate @@ -320,9 +320,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -339,9 +342,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -364,11 +366,14 @@ def _delete_initial( disk_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -385,9 +390,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -412,14 +416,14 @@ def begin_delete( disk_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """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. + 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. @@ -486,11 +490,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + 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 @@ -503,15 +514,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -551,11 +558,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + 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 @@ -567,15 +581,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -609,12 +619,15 @@ def _grant_access_initial( grant_access_data, # type: "models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> "models.AccessUri" - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # 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 = "2016-04-30-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._grant_access_initial.metadata['url'] # type: ignore @@ -632,14 +645,12 @@ def _grant_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -664,17 +675,17 @@ def begin_grant_access( grant_access_data, # type: "models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. + operation. :type grant_access_data: ~azure.mgmt.compute.v2016_04_30_preview.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. @@ -732,11 +743,14 @@ def _revoke_access_initial( disk_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._revoke_access_initial.metadata['url'] # type: ignore @@ -753,9 +767,8 @@ def _revoke_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -780,14 +793,14 @@ def begin_revoke_access( disk_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """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. + 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. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_images_operations.py index 312d57be6f60..7c59e5f2d6e9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_images_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.Image" cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'Image') 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('Image', pipeline_response) @@ -112,7 +112,7 @@ def begin_create_or_update( parameters, # type: "models.Image" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Image"] """Create or update an image. :param resource_group_name: The name of the resource group. @@ -177,11 +177,14 @@ def _delete_initial( image_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -198,9 +201,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -225,7 +227,7 @@ def begin_delete( image_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Deletes an Image. :param resource_group_name: The name of the resource group. @@ -303,9 +305,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -324,9 +329,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -359,11 +363,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + 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 @@ -376,15 +387,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -417,7 +424,7 @@ def list( ): # type: (...) -> Iterable["models.ImageListResult"] """Gets the list of Images in the subscription. Use nextLink property in the response to get the - next page of Images. Do this till nextLink is null to fetch all the Images. + next page of Images. Do this till nextLink is null to fetch all the Images. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ImageListResult or the result of cls(response) @@ -425,11 +432,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + 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 @@ -441,15 +455,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_snapshots_operations.py index 0c02e4cdaad0..b85ad71a5b76 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_snapshots_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.Snapshot" cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('Snapshot', pipeline_response) @@ -112,13 +112,13 @@ def begin_create_or_update( snapshot, # type: "models.Snapshot" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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 within the given subscription and resource - group. + group. :type snapshot_name: str :param snapshot: Snapshot object supplied in the body of the Put disk operation. :type snapshot: ~azure.mgmt.compute.v2016_04_30_preview.models.Snapshot @@ -181,10 +181,13 @@ def _update_initial( ): # type: (...) -> "models.Snapshot" cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -202,14 +205,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -217,7 +218,6 @@ def _update_initial( 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('Snapshot', pipeline_response) @@ -237,13 +237,13 @@ def begin_update( snapshot, # type: "models.SnapshotUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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 within the given subscription and resource - group. + group. :type snapshot_name: str :param snapshot: Snapshot object supplied in the body of the Patch snapshot operation. :type snapshot: ~azure.mgmt.compute.v2016_04_30_preview.models.SnapshotUpdate @@ -317,9 +317,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -336,9 +339,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -361,11 +363,14 @@ def _delete_initial( snapshot_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -382,9 +387,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -409,13 +413,13 @@ def begin_delete( snapshot_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """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 within the given subscription and resource - group. + group. :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. @@ -482,11 +486,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + 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 @@ -499,15 +510,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -547,11 +554,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + 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 @@ -563,15 +577,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -605,12 +615,15 @@ def _grant_access_initial( grant_access_data, # type: "models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> "models.AccessUri" - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # 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 = "2016-04-30-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._grant_access_initial.metadata['url'] # type: ignore @@ -628,14 +641,12 @@ def _grant_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -660,16 +671,16 @@ def begin_grant_access( grant_access_data, # type: "models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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 within the given subscription and resource - group. + group. :type snapshot_name: str :param grant_access_data: Access data object supplied in the body of the get snapshot access - operation. + operation. :type grant_access_data: ~azure.mgmt.compute.v2016_04_30_preview.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. @@ -727,11 +738,14 @@ def _revoke_access_initial( snapshot_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._revoke_access_initial.metadata['url'] # type: ignore @@ -748,9 +762,8 @@ def _revoke_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -775,13 +788,13 @@ def begin_revoke_access( snapshot_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """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 within the given subscription and resource - group. + group. :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. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_usage_operations.py index aba2e7370294..4d67acac46cf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_usage_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,7 +52,7 @@ def list( ): # type: (...) -> Iterable["models.ListUsagesResult"] """Gets, for the specified location, the current compute resource usage information as well as the - limits for compute resources under the subscription. + limits for compute resources under the subscription. :param location: The location for which resource usage is queried. :type location: str @@ -62,11 +62,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + 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 @@ -79,15 +86,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_extension_images_operations.py index e03f1ed33028..7446adba613d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_extension_images_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -69,9 +69,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -90,9 +93,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -128,9 +130,12 @@ def list_types( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.list_types.metadata['url'] # type: ignore @@ -147,9 +152,8 @@ def list_types( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -197,9 +201,12 @@ def list_versions( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.list_versions.metadata['url'] # type: ignore @@ -223,9 +230,8 @@ def list_versions( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_extensions_operations.py index d8e996b70046..be1468c22be5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_extensions_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachineExtension" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -78,14 +81,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtension') 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 @@ -93,7 +94,6 @@ def _create_or_update_initial( 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('VirtualMachineExtension', pipeline_response) @@ -114,18 +114,18 @@ def begin_create_or_update( extension_parameters, # type: "models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineExtension"] """The operation to create or update the extension. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_name: The name of the virtual machine where the extension should be created or - updated. + updated. :type vm_name: str :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Create Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineExtension :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. @@ -188,10 +188,13 @@ def _update_initial( ): # type: (...) -> "models.VirtualMachineExtension" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -210,14 +213,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtensionUpdate') 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 @@ -241,7 +242,7 @@ def begin_update( extension_parameters, # type: "models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineExtension"] """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -251,7 +252,7 @@ def begin_update( :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Update Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineExtensionUpdate :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. @@ -311,11 +312,14 @@ def _delete_initial( vm_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -333,9 +337,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -361,7 +364,7 @@ def begin_delete( vm_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -445,9 +448,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -467,9 +473,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_images_operations.py index 3ea3d7b62dea..af213b211190 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_images_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -72,9 +72,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -94,9 +97,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -148,9 +150,12 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -175,9 +180,8 @@ def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -213,9 +217,12 @@ def list_offers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.list_offers.metadata['url'] # type: ignore @@ -232,9 +239,8 @@ def list_offers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -267,9 +273,12 @@ def list_publishers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.list_publishers.metadata['url'] # type: ignore @@ -285,9 +294,8 @@ def list_publishers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -326,9 +334,12 @@ def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.list_skus.metadata['url'] # type: ignore @@ -346,9 +357,8 @@ def list_skus( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_scale_set_vms_operations.py index f6f5d6994d37..345fd31a2f65 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_scale_set_vms_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -54,11 +54,14 @@ def _reimage_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._reimage_initial.metadata['url'] # type: ignore @@ -76,9 +79,8 @@ def _reimage_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -104,7 +106,7 @@ def begin_reimage( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -170,11 +172,14 @@ def _reimage_all_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._reimage_all_initial.metadata['url'] # type: ignore @@ -192,9 +197,8 @@ def _reimage_all_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -220,9 +224,9 @@ def begin_reimage_all( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. - This operation is only supported for managed disks. + This operation is only supported for managed disks. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -287,11 +291,14 @@ def _deallocate_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._deallocate_initial.metadata['url'] # type: ignore @@ -309,9 +316,8 @@ def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -337,10 +343,10 @@ def begin_deallocate( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and - releases the compute resources it uses. You are not billed for the compute resources of this - virtual machine once it is deallocated. + releases the compute resources it uses. You are not billed for the compute resources of this + virtual machine once it is deallocated. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -405,11 +411,14 @@ def _delete_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -427,9 +436,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -455,7 +463,7 @@ def begin_delete( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Deletes a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -536,9 +544,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -556,9 +567,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -597,9 +607,12 @@ def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -617,9 +630,8 @@ def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -664,11 +676,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + 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 @@ -688,15 +707,11 @@ def prepare_request(next_link=None): query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -730,11 +745,14 @@ def _power_off_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._power_off_initial.metadata['url'] # type: ignore @@ -752,9 +770,8 @@ def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -780,10 +797,10 @@ def begin_power_off( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached - and you are getting charged for the resources. Instead, use deallocate to release resources and - avoid charges. + and you are getting charged for the resources. Instead, use deallocate to release resources and + avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -848,11 +865,14 @@ def _restart_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._restart_initial.metadata['url'] # type: ignore @@ -870,9 +890,8 @@ def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -898,7 +917,7 @@ def begin_restart( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Restarts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -964,11 +983,14 @@ def _start_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._start_initial.metadata['url'] # type: ignore @@ -986,9 +1008,8 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1014,7 +1035,7 @@ def begin_start( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Starts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_scale_sets_operations.py index 9574bf06f702..3f71471fd314 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_scale_sets_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachineScaleSet" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSet') 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('VirtualMachineScaleSet', pipeline_response) @@ -112,7 +112,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualMachineScaleSet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -177,11 +177,14 @@ def _delete_initial( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -198,9 +201,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -225,7 +227,7 @@ def begin_delete( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Deletes a VM scale set. :param resource_group_name: The name of the resource group. @@ -300,9 +302,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -319,9 +324,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -345,12 +349,15 @@ def _deallocate_initial( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._deallocate_initial.metadata['url'] # type: ignore @@ -368,9 +375,8 @@ def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -378,7 +384,6 @@ def _deallocate_initial( body_content = None 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 @@ -403,10 +408,10 @@ def begin_deallocate( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and - releases the compute resources. You are not billed for the compute resources that this virtual - machine scale set deallocates. + releases the compute resources. You are not billed for the compute resources that this virtual + machine scale set deallocates. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -471,12 +476,15 @@ def _delete_instances_initial( vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._delete_instances_initial.metadata['url'] # type: ignore @@ -494,14 +502,12 @@ def _delete_instances_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -526,7 +532,7 @@ def begin_delete_instances( vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Deletes virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -604,9 +610,12 @@ def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -623,9 +632,8 @@ def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -658,11 +666,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + 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 @@ -675,15 +690,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -716,8 +727,8 @@ def list_all( ): # type: (...) -> Iterable["models.VirtualMachineScaleSetListWithLinkResult"] """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource - group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this - till nextLink is null to fetch all the VM Scale Sets. + group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this + till nextLink is null to fetch all the VM Scale Sets. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetListWithLinkResult or the result of cls(response) @@ -725,11 +736,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + 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_all.metadata['url'] # type: ignore @@ -741,15 +759,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -784,7 +798,7 @@ def list_skus( ): # type: (...) -> Iterable["models.VirtualMachineScaleSetListSkusResult"] """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM - instances allowed for each SKU. + instances allowed for each SKU. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -796,11 +810,18 @@ def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + 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_skus.metadata['url'] # type: ignore @@ -814,15 +835,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -856,12 +873,15 @@ def _power_off_initial( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._power_off_initial.metadata['url'] # type: ignore @@ -879,9 +899,8 @@ def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -889,7 +908,6 @@ def _power_off_initial( body_content = None 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 @@ -914,10 +932,10 @@ def begin_power_off( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still - attached and you are getting charged for the resources. Instead, use deallocate to release - resources and avoid charges. + attached and you are getting charged for the resources. Instead, use deallocate to release + resources and avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -982,12 +1000,15 @@ def _restart_initial( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._restart_initial.metadata['url'] # type: ignore @@ -1005,9 +1026,8 @@ def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1015,7 +1035,6 @@ def _restart_initial( body_content = None 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 @@ -1040,7 +1059,7 @@ def begin_restart( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Restarts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1106,12 +1125,15 @@ def _start_initial( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._start_initial.metadata['url'] # type: ignore @@ -1129,9 +1151,8 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1139,7 +1160,6 @@ def _start_initial( body_content = None 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 @@ -1164,7 +1184,7 @@ def begin_start( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Starts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1230,12 +1250,15 @@ def _update_instances_initial( vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_instances_initial.metadata['url'] # type: ignore @@ -1253,14 +1276,12 @@ def _update_instances_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -1285,7 +1306,7 @@ def begin_update_instances( vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. :param resource_group_name: The name of the resource group. @@ -1350,11 +1371,14 @@ def _reimage_initial( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._reimage_initial.metadata['url'] # type: ignore @@ -1371,9 +1395,8 @@ def _reimage_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1398,7 +1421,7 @@ def begin_reimage( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1460,11 +1483,14 @@ def _reimage_all_initial( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._reimage_all_initial.metadata['url'] # type: ignore @@ -1481,9 +1507,8 @@ def _reimage_all_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1508,9 +1533,9 @@ def begin_reimage_all( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This - operation is only supported for managed disks. + operation is only supported for managed disks. :param resource_group_name: The name of the resource group. :type resource_group_name: str diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_sizes_operations.py index 876cdea8b4f2..d222ce07b06c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_sizes_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -61,11 +61,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + 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 @@ -78,15 +85,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machines_operations.py index bfc41b5875ef..0638f0459363 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machines_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -69,9 +69,12 @@ def get_extensions( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.get_extensions.metadata['url'] # type: ignore @@ -90,9 +93,8 @@ def get_extensions( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -116,12 +118,15 @@ def _capture_initial( parameters, # type: "models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._capture_initial.metadata['url'] # type: ignore @@ -139,14 +144,12 @@ def _capture_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineCaptureParameters') 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 @@ -171,9 +174,9 @@ def begin_capture( parameters, # type: "models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineCaptureResult"] """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used - to create similar VMs. + to create similar VMs. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -240,10 +243,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachine" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -261,14 +267,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachine') 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 @@ -276,7 +280,6 @@ def _create_or_update_initial( 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('VirtualMachine', pipeline_response) @@ -296,7 +299,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualMachine" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachine"] """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -361,11 +364,14 @@ def _delete_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -382,9 +388,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -409,7 +414,7 @@ def begin_delete( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """The operation to delete a virtual machine. :param resource_group_name: The name of the resource group. @@ -487,9 +492,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -508,9 +516,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -533,11 +540,14 @@ def _convert_to_managed_disks_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._convert_to_managed_disks_initial.metadata['url'] # type: ignore @@ -554,9 +564,8 @@ def _convert_to_managed_disks_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -581,9 +590,9 @@ def begin_convert_to_managed_disks( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop- - deallocated before invoking this operation. + deallocated before invoking this operation. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -644,11 +653,14 @@ def _deallocate_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._deallocate_initial.metadata['url'] # type: ignore @@ -665,9 +677,8 @@ def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -692,9 +703,9 @@ def begin_deallocate( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Shuts down the virtual machine and releases the compute resources. You are not billed for the - compute resources that this virtual machine uses. + compute resources that this virtual machine uses. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -768,9 +779,12 @@ def generalize( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self.generalize.metadata['url'] # type: ignore @@ -787,9 +801,8 @@ def generalize( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -813,7 +826,7 @@ def list( ): # type: (...) -> Iterable["models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified resource group. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -823,11 +836,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + 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 @@ -840,15 +860,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -881,7 +897,7 @@ def list_all( ): # type: (...) -> Iterable["models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified subscription. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineListResult or the result of cls(response) @@ -889,11 +905,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + 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_all.metadata['url'] # type: ignore @@ -905,15 +928,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -948,7 +967,7 @@ def list_available_sizes( ): # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes to which the specified virtual machine can be - resized. + resized. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -960,11 +979,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + 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_available_sizes.metadata['url'] # type: ignore @@ -978,15 +1004,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1019,11 +1041,14 @@ def _power_off_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._power_off_initial.metadata['url'] # type: ignore @@ -1040,9 +1065,8 @@ def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1067,9 +1091,9 @@ def begin_power_off( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with - the same provisioned resources. You are still charged for this virtual machine. + the same provisioned resources. You are still charged for this virtual machine. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1130,11 +1154,14 @@ def _restart_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._restart_initial.metadata['url'] # type: ignore @@ -1151,9 +1178,8 @@ def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1178,7 +1204,7 @@ def begin_restart( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """The operation to restart a virtual machine. :param resource_group_name: The name of the resource group. @@ -1240,11 +1266,14 @@ def _start_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._start_initial.metadata['url'] # type: ignore @@ -1261,9 +1290,8 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1288,7 +1316,7 @@ def begin_start( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """The operation to start a virtual machine. :param resource_group_name: The name of the resource group. @@ -1350,11 +1378,14 @@ def _redeploy_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-04-30-preview" + accept = "application/json" # Construct URL url = self._redeploy_initial.metadata['url'] # type: ignore @@ -1371,9 +1402,8 @@ def _redeploy_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1398,7 +1428,7 @@ def begin_redeploy( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Shuts down the virtual machine, moves it to a new node, and powers it back on. :param resource_group_name: The name of the resource group. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/__init__.py index 20a4019e9c23..cdc7f7a1709a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/__init__.py @@ -10,7 +10,7 @@ __all__ = ['ComputeManagementClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass 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 1e1a2c60870a..a3f24ad7ea95 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,6 +95,7 @@ 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/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_configuration.py index e5703be20603..7c55be6b85ca 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -47,8 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2017-03-30" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-compute/{}'.format(VERSION)) self._configure(**kwargs) @@ -61,6 +61,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) 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 50b12e1ac572..39fc5d8bbecb 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 @@ -4,7 +4,11 @@ "client": { "name": "ComputeManagementClient", "filename": "_compute_management_client", - "description": "Compute Client." + "description": "Compute Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true }, "global_parameters": { "sync_method": { @@ -41,7 +45,10 @@ }, "config": { "credential": true, - "credential_scopes": ["https://management.azure.com/.default"] + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null }, "operation_groups": { "availability_sets": "AvailabilitySetsOperations", diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/__init__.py index c8a8b4817269..9e9459635989 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._compute_management_client_async import ComputeManagementClient +from ._compute_management_client import ComputeManagementClient __all__ = ['ComputeManagementClient'] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/_compute_management_client_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/_compute_management_client.py similarity index 78% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/_compute_management_client_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/_compute_management_client.py index 959047841487..133537d9ab00 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/_compute_management_client_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/_compute_management_client.py @@ -15,23 +15,23 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration_async import ComputeManagementClientConfiguration -from .operations_async import AvailabilitySetsOperations -from .operations_async import VirtualMachineExtensionImagesOperations -from .operations_async import VirtualMachineExtensionsOperations -from .operations_async import VirtualMachinesOperations -from .operations_async import VirtualMachineImagesOperations -from .operations_async import UsageOperations -from .operations_async import VirtualMachineSizesOperations -from .operations_async import ImagesOperations -from .operations_async import ResourceSkusOperations -from .operations_async import VirtualMachineScaleSetsOperations -from .operations_async import VirtualMachineScaleSetExtensionsOperations -from .operations_async import VirtualMachineScaleSetRollingUpgradesOperations -from .operations_async import VirtualMachineScaleSetVMsOperations -from .operations_async import DisksOperations -from .operations_async import SnapshotsOperations -from .operations_async import VirtualMachineRunCommandsOperations +from ._configuration import ComputeManagementClientConfiguration +from .operations import AvailabilitySetsOperations +from .operations import VirtualMachineExtensionImagesOperations +from .operations import VirtualMachineExtensionsOperations +from .operations import VirtualMachinesOperations +from .operations import VirtualMachineImagesOperations +from .operations import UsageOperations +from .operations import VirtualMachineSizesOperations +from .operations import ImagesOperations +from .operations import ResourceSkusOperations +from .operations import VirtualMachineScaleSetsOperations +from .operations import VirtualMachineScaleSetExtensionsOperations +from .operations import VirtualMachineScaleSetRollingUpgradesOperations +from .operations import VirtualMachineScaleSetVMsOperations +from .operations import DisksOperations +from .operations import SnapshotsOperations +from .operations import VirtualMachineRunCommandsOperations from .. import models @@ -39,37 +39,37 @@ class ComputeManagementClient(object): """Compute Client. :ivar availability_sets: AvailabilitySetsOperations operations - :vartype availability_sets: azure.mgmt.compute.v2017_03_30.aio.operations_async.AvailabilitySetsOperations + :vartype availability_sets: azure.mgmt.compute.v2017_03_30.aio.operations.AvailabilitySetsOperations :ivar virtual_machine_extension_images: VirtualMachineExtensionImagesOperations operations - :vartype virtual_machine_extension_images: azure.mgmt.compute.v2017_03_30.aio.operations_async.VirtualMachineExtensionImagesOperations + :vartype virtual_machine_extension_images: azure.mgmt.compute.v2017_03_30.aio.operations.VirtualMachineExtensionImagesOperations :ivar virtual_machine_extensions: VirtualMachineExtensionsOperations operations - :vartype virtual_machine_extensions: azure.mgmt.compute.v2017_03_30.aio.operations_async.VirtualMachineExtensionsOperations + :vartype virtual_machine_extensions: azure.mgmt.compute.v2017_03_30.aio.operations.VirtualMachineExtensionsOperations :ivar virtual_machines: VirtualMachinesOperations operations - :vartype virtual_machines: azure.mgmt.compute.v2017_03_30.aio.operations_async.VirtualMachinesOperations + :vartype virtual_machines: azure.mgmt.compute.v2017_03_30.aio.operations.VirtualMachinesOperations :ivar virtual_machine_images: VirtualMachineImagesOperations operations - :vartype virtual_machine_images: azure.mgmt.compute.v2017_03_30.aio.operations_async.VirtualMachineImagesOperations + :vartype virtual_machine_images: azure.mgmt.compute.v2017_03_30.aio.operations.VirtualMachineImagesOperations :ivar usage: UsageOperations operations - :vartype usage: azure.mgmt.compute.v2017_03_30.aio.operations_async.UsageOperations + :vartype usage: azure.mgmt.compute.v2017_03_30.aio.operations.UsageOperations :ivar virtual_machine_sizes: VirtualMachineSizesOperations operations - :vartype virtual_machine_sizes: azure.mgmt.compute.v2017_03_30.aio.operations_async.VirtualMachineSizesOperations + :vartype virtual_machine_sizes: azure.mgmt.compute.v2017_03_30.aio.operations.VirtualMachineSizesOperations :ivar images: ImagesOperations operations - :vartype images: azure.mgmt.compute.v2017_03_30.aio.operations_async.ImagesOperations + :vartype images: azure.mgmt.compute.v2017_03_30.aio.operations.ImagesOperations :ivar resource_skus: ResourceSkusOperations operations - :vartype resource_skus: azure.mgmt.compute.v2017_03_30.aio.operations_async.ResourceSkusOperations + :vartype resource_skus: azure.mgmt.compute.v2017_03_30.aio.operations.ResourceSkusOperations :ivar virtual_machine_scale_sets: VirtualMachineScaleSetsOperations operations - :vartype virtual_machine_scale_sets: azure.mgmt.compute.v2017_03_30.aio.operations_async.VirtualMachineScaleSetsOperations + :vartype virtual_machine_scale_sets: azure.mgmt.compute.v2017_03_30.aio.operations.VirtualMachineScaleSetsOperations :ivar virtual_machine_scale_set_extensions: VirtualMachineScaleSetExtensionsOperations operations - :vartype virtual_machine_scale_set_extensions: azure.mgmt.compute.v2017_03_30.aio.operations_async.VirtualMachineScaleSetExtensionsOperations + :vartype virtual_machine_scale_set_extensions: azure.mgmt.compute.v2017_03_30.aio.operations.VirtualMachineScaleSetExtensionsOperations :ivar virtual_machine_scale_set_rolling_upgrades: VirtualMachineScaleSetRollingUpgradesOperations operations - :vartype virtual_machine_scale_set_rolling_upgrades: azure.mgmt.compute.v2017_03_30.aio.operations_async.VirtualMachineScaleSetRollingUpgradesOperations + :vartype virtual_machine_scale_set_rolling_upgrades: azure.mgmt.compute.v2017_03_30.aio.operations.VirtualMachineScaleSetRollingUpgradesOperations :ivar virtual_machine_scale_set_vms: VirtualMachineScaleSetVMsOperations operations - :vartype virtual_machine_scale_set_vms: azure.mgmt.compute.v2017_03_30.aio.operations_async.VirtualMachineScaleSetVMsOperations + :vartype virtual_machine_scale_set_vms: azure.mgmt.compute.v2017_03_30.aio.operations.VirtualMachineScaleSetVMsOperations :ivar disks: DisksOperations operations - :vartype disks: azure.mgmt.compute.v2017_03_30.aio.operations_async.DisksOperations + :vartype disks: azure.mgmt.compute.v2017_03_30.aio.operations.DisksOperations :ivar snapshots: SnapshotsOperations operations - :vartype snapshots: azure.mgmt.compute.v2017_03_30.aio.operations_async.SnapshotsOperations + :vartype snapshots: azure.mgmt.compute.v2017_03_30.aio.operations.SnapshotsOperations :ivar virtual_machine_run_commands: VirtualMachineRunCommandsOperations operations - :vartype virtual_machine_run_commands: azure.mgmt.compute.v2017_03_30.aio.operations_async.VirtualMachineRunCommandsOperations + :vartype virtual_machine_run_commands: azure.mgmt.compute.v2017_03_30.aio.operations.VirtualMachineRunCommandsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. @@ -92,6 +92,7 @@ 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/aio/_configuration_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/_configuration.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/_configuration_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/_configuration.py index ae95357d2d8f..8817af7554b3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/_configuration_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -44,8 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2017-03-30" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-compute/{}'.format(VERSION)) self._configure(**kwargs) @@ -57,6 +57,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/__init__.py new file mode 100644 index 000000000000..e754e54122d1 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/__init__.py @@ -0,0 +1,43 @@ +# 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 ._availability_sets_operations import AvailabilitySetsOperations +from ._virtual_machine_extension_images_operations import VirtualMachineExtensionImagesOperations +from ._virtual_machine_extensions_operations import VirtualMachineExtensionsOperations +from ._virtual_machines_operations import VirtualMachinesOperations +from ._virtual_machine_images_operations import VirtualMachineImagesOperations +from ._usage_operations import UsageOperations +from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations +from ._images_operations import ImagesOperations +from ._resource_skus_operations import ResourceSkusOperations +from ._virtual_machine_scale_sets_operations import VirtualMachineScaleSetsOperations +from ._virtual_machine_scale_set_extensions_operations import VirtualMachineScaleSetExtensionsOperations +from ._virtual_machine_scale_set_rolling_upgrades_operations import VirtualMachineScaleSetRollingUpgradesOperations +from ._virtual_machine_scale_set_vms_operations import VirtualMachineScaleSetVMsOperations +from ._disks_operations import DisksOperations +from ._snapshots_operations import SnapshotsOperations +from ._virtual_machine_run_commands_operations import VirtualMachineRunCommandsOperations + +__all__ = [ + 'AvailabilitySetsOperations', + 'VirtualMachineExtensionImagesOperations', + 'VirtualMachineExtensionsOperations', + 'VirtualMachinesOperations', + 'VirtualMachineImagesOperations', + 'UsageOperations', + 'VirtualMachineSizesOperations', + 'ImagesOperations', + 'ResourceSkusOperations', + 'VirtualMachineScaleSetsOperations', + 'VirtualMachineScaleSetExtensionsOperations', + 'VirtualMachineScaleSetRollingUpgradesOperations', + 'VirtualMachineScaleSetVMsOperations', + 'DisksOperations', + 'SnapshotsOperations', + 'VirtualMachineRunCommandsOperations', +] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_availability_sets_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_availability_sets_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_availability_sets_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_availability_sets_operations.py index de6343be344f..dede21467625 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_availability_sets_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_availability_sets_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -62,10 +62,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -83,14 +86,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailabilitySet') 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 @@ -111,7 +112,7 @@ async def delete( resource_group_name: str, availability_set_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> Optional["models.OperationStatusResponse"]: """Delete an availability set. :param resource_group_name: The name of the resource group. @@ -123,10 +124,13 @@ async def delete( :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore @@ -143,9 +147,8 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -182,9 +185,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -201,9 +207,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -227,7 +232,8 @@ def list_by_subscription( ) -> AsyncIterable["models.AvailabilitySetListResult"]: """Lists all availability sets in a subscription. - :param expand: The expand expression to apply to the operation. + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AvailabilitySetListResult or the result of cls(response) @@ -235,11 +241,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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_subscription.metadata['url'] # type: ignore @@ -253,15 +266,11 @@ def prepare_request(next_link=None): if expand is not None: query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -303,11 +312,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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 @@ -320,15 +336,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -362,7 +374,7 @@ def list_available_sizes( **kwargs ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes that can be used to create a new virtual machine in - an existing availability set. + an existing availability set. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -374,11 +386,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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_available_sizes.metadata['url'] # type: ignore @@ -392,15 +411,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_disks_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_disks_operations.py similarity index 87% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_disks_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_disks_operations.py index fae1fd56683a..92161c18e82f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_disks_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_disks_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.Disk": cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('Disk', pipeline_response) @@ -106,14 +106,14 @@ async def begin_create_or_update( disk_name: str, disk: "models.Disk", **kwargs - ) -> "models.Disk": + ) -> 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. + 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.v2017_03_30.models.Disk @@ -123,8 +123,8 @@ async def begin_create_or_update( 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: Disk, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.Disk + :return: An instance of AsyncLROPoller that returns either Disk or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.Disk] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -175,10 +175,13 @@ async def _update_initial( **kwargs ) -> "models.Disk": cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -196,14 +199,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -211,7 +212,6 @@ async def _update_initial( 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('Disk', pipeline_response) @@ -230,14 +230,14 @@ async def begin_update( disk_name: str, disk: "models.DiskUpdate", **kwargs - ) -> "models.Disk": + ) -> 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. + 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.v2017_03_30.models.DiskUpdate @@ -247,8 +247,8 @@ async def begin_update( 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: Disk, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.Disk + :return: An instance of AsyncLROPoller that returns either Disk or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.Disk] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -311,9 +311,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -330,9 +333,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -354,11 +356,14 @@ async def _delete_initial( resource_group_name: str, disk_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -375,9 +380,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -401,14 +405,14 @@ async def begin_delete( resource_group_name: str, disk_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """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. + 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. @@ -416,8 +420,8 @@ async def begin_delete( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -474,11 +478,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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 @@ -491,15 +502,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -538,11 +545,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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 @@ -554,15 +568,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -595,12 +605,15 @@ async def _grant_access_initial( disk_name: str, grant_access_data: "models.GrantAccessData", **kwargs - ) -> "models.AccessUri": - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> 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 = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._grant_access_initial.metadata['url'] # type: ignore @@ -618,14 +631,12 @@ async def _grant_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -649,17 +660,17 @@ async def begin_grant_access( disk_name: str, grant_access_data: "models.GrantAccessData", **kwargs - ) -> "models.AccessUri": + ) -> 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. + 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. + operation. :type grant_access_data: ~azure.mgmt.compute.v2017_03_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. @@ -667,8 +678,8 @@ async def begin_grant_access( 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: AccessUri, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.AccessUri + :return: An instance of AsyncLROPoller that returns either AccessUri or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.AccessUri] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -716,11 +727,14 @@ async def _revoke_access_initial( resource_group_name: str, disk_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._revoke_access_initial.metadata['url'] # type: ignore @@ -737,9 +751,8 @@ async def _revoke_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -763,14 +776,14 @@ async def begin_revoke_access( resource_group_name: str, disk_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """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. + 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. @@ -778,8 +791,8 @@ async def begin_revoke_access( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_images_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_images_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_images_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_images_operations.py index 829f275da3fd..0e8ca831e7a1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_images_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_images_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.Image": cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'Image') 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('Image', pipeline_response) @@ -106,7 +106,7 @@ async def begin_create_or_update( image_name: str, parameters: "models.Image", **kwargs - ) -> "models.Image": + ) -> AsyncLROPoller["models.Image"]: """Create or update an image. :param resource_group_name: The name of the resource group. @@ -121,8 +121,8 @@ async def begin_create_or_update( 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: Image, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.Image + :return: An instance of AsyncLROPoller that returns either Image or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.Image] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -170,11 +170,14 @@ async def _delete_initial( resource_group_name: str, image_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -191,9 +194,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -217,7 +219,7 @@ async def begin_delete( resource_group_name: str, image_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Deletes an Image. :param resource_group_name: The name of the resource group. @@ -230,8 +232,8 @@ async def begin_delete( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -294,9 +296,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -315,9 +320,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -349,11 +353,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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 @@ -366,15 +377,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -406,7 +413,7 @@ def list( **kwargs ) -> AsyncIterable["models.ImageListResult"]: """Gets the list of Images in the subscription. Use nextLink property in the response to get the - next page of Images. Do this till nextLink is null to fetch all the Images. + next page of Images. Do this till nextLink is null to fetch all the Images. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ImageListResult or the result of cls(response) @@ -414,11 +421,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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 @@ -430,15 +444,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_resource_skus_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_resource_skus_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_resource_skus_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_resource_skus_operations.py index 978484732ba9..7ff260671c50 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_resource_skus_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_resource_skus_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -53,11 +53,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceSkusResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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 @@ -69,15 +76,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_snapshots_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_snapshots_operations.py similarity index 87% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_snapshots_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_snapshots_operations.py index d42e949fc78e..0cd1e4bc9e88 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_snapshots_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_snapshots_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.Snapshot": cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('Snapshot', pipeline_response) @@ -106,14 +106,14 @@ async def begin_create_or_update( snapshot_name: str, snapshot: "models.Snapshot", **kwargs - ) -> "models.Snapshot": + ) -> 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. + 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.v2017_03_30.models.Snapshot @@ -123,8 +123,8 @@ async def begin_create_or_update( 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: Snapshot, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.Snapshot + :return: An instance of AsyncLROPoller that returns either Snapshot or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.Snapshot] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -175,10 +175,13 @@ async def _update_initial( **kwargs ) -> "models.Snapshot": cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -196,14 +199,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -211,7 +212,6 @@ async def _update_initial( 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('Snapshot', pipeline_response) @@ -230,14 +230,14 @@ async def begin_update( snapshot_name: str, snapshot: "models.SnapshotUpdate", **kwargs - ) -> "models.Snapshot": + ) -> 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. + 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.v2017_03_30.models.SnapshotUpdate @@ -247,8 +247,8 @@ async def begin_update( 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: Snapshot, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.Snapshot + :return: An instance of AsyncLROPoller that returns either Snapshot or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.Snapshot] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -311,9 +311,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -330,9 +333,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -354,11 +356,14 @@ async def _delete_initial( resource_group_name: str, snapshot_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -375,9 +380,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -401,14 +405,14 @@ async def begin_delete( resource_group_name: str, snapshot_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """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. + 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. @@ -416,8 +420,8 @@ async def begin_delete( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -474,11 +478,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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 @@ -491,15 +502,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -538,11 +545,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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 @@ -554,15 +568,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -595,12 +605,15 @@ async def _grant_access_initial( snapshot_name: str, grant_access_data: "models.GrantAccessData", **kwargs - ) -> "models.AccessUri": - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> 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 = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._grant_access_initial.metadata['url'] # type: ignore @@ -618,14 +631,12 @@ async def _grant_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -649,17 +660,17 @@ async def begin_grant_access( snapshot_name: str, grant_access_data: "models.GrantAccessData", **kwargs - ) -> "models.AccessUri": + ) -> 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. + 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. + operation. :type grant_access_data: ~azure.mgmt.compute.v2017_03_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. @@ -667,8 +678,8 @@ async def begin_grant_access( 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: AccessUri, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.AccessUri + :return: An instance of AsyncLROPoller that returns either AccessUri or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.AccessUri] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -716,11 +727,14 @@ async def _revoke_access_initial( resource_group_name: str, snapshot_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._revoke_access_initial.metadata['url'] # type: ignore @@ -737,9 +751,8 @@ async def _revoke_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -763,14 +776,14 @@ async def begin_revoke_access( resource_group_name: str, snapshot_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """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. + 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. @@ -778,8 +791,8 @@ async def begin_revoke_access( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_usage_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_usage_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_usage_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_usage_operations.py index f6dfe7630592..fc64ae9e6c35 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_usage_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_usage_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -47,7 +47,7 @@ def list( **kwargs ) -> AsyncIterable["models.ListUsagesResult"]: """Gets, for the specified location, the current compute resource usage information as well as the - limits for compute resources under the subscription. + limits for compute resources under the subscription. :param location: The location for which resource usage is queried. :type location: str @@ -57,11 +57,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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 @@ -74,15 +81,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_virtual_machine_extension_images_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_extension_images_operations.py similarity index 92% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_virtual_machine_extension_images_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_extension_images_operations.py index d7c88d6090d1..503d6247663f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_virtual_machine_extension_images_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_extension_images_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -64,9 +64,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -85,9 +88,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -122,9 +124,12 @@ async def list_types( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.list_types.metadata['url'] # type: ignore @@ -141,9 +146,8 @@ async def list_types( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -190,9 +194,12 @@ async def list_versions( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.list_versions.metadata['url'] # type: ignore @@ -216,9 +223,8 @@ async def list_versions( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_virtual_machine_extensions_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_extensions_operations.py similarity index 90% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_virtual_machine_extensions_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_extensions_operations.py index 4280fa6f2630..7499cfb904ea 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_virtual_machine_extensions_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_extensions_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachineExtension": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -73,14 +76,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtension') 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 @@ -88,7 +89,6 @@ async def _create_or_update_initial( 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('VirtualMachineExtension', pipeline_response) @@ -108,18 +108,18 @@ async def begin_create_or_update( vm_extension_name: str, extension_parameters: "models.VirtualMachineExtension", **kwargs - ) -> "models.VirtualMachineExtension": + ) -> AsyncLROPoller["models.VirtualMachineExtension"]: """The operation to create or update the extension. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_name: The name of the virtual machine where the extension should be created or - updated. + updated. :type vm_name: str :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Create Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineExtension :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. @@ -127,8 +127,8 @@ async def begin_create_or_update( 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: VirtualMachineExtension, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineExtension + :return: An instance of AsyncLROPoller that returns either VirtualMachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -181,10 +181,13 @@ async def _update_initial( **kwargs ) -> "models.VirtualMachineExtension": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -203,14 +206,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtensionUpdate') 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 @@ -233,7 +234,7 @@ async def begin_update( vm_extension_name: str, extension_parameters: "models.VirtualMachineExtensionUpdate", **kwargs - ) -> "models.VirtualMachineExtension": + ) -> AsyncLROPoller["models.VirtualMachineExtension"]: """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -243,7 +244,7 @@ async def begin_update( :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Update Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineExtensionUpdate :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. @@ -251,8 +252,8 @@ async def begin_update( 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: VirtualMachineExtension, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineExtension + :return: An instance of AsyncLROPoller that returns either VirtualMachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -302,11 +303,14 @@ async def _delete_initial( vm_name: str, vm_extension_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -324,9 +328,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -351,7 +354,7 @@ async def begin_delete( vm_name: str, vm_extension_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -366,8 +369,8 @@ async def begin_delete( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -434,9 +437,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -456,9 +462,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_virtual_machine_images_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_images_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_virtual_machine_images_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_images_operations.py index 6d98ec33274b..5499938b02ef 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_virtual_machine_images_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_images_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -67,9 +67,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -89,9 +92,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -142,9 +144,12 @@ async def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -169,9 +174,8 @@ async def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -206,9 +210,12 @@ async def list_offers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.list_offers.metadata['url'] # type: ignore @@ -225,9 +232,8 @@ async def list_offers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -259,9 +265,12 @@ async def list_publishers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.list_publishers.metadata['url'] # type: ignore @@ -277,9 +286,8 @@ async def list_publishers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -317,9 +325,12 @@ async def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.list_skus.metadata['url'] # type: ignore @@ -337,9 +348,8 @@ async def list_skus( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_virtual_machine_run_commands_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_run_commands_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_virtual_machine_run_commands_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_run_commands_operations.py index 09d4639378d2..ec1757a7bf54 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_virtual_machine_run_commands_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_run_commands_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,11 +56,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json, text/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 @@ -73,15 +80,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -126,9 +129,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandDocument"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json, text/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -145,9 +151,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_virtual_machine_scale_set_extensions_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_extensions_operations.py similarity index 90% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_virtual_machine_scale_set_extensions_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_extensions_operations.py index 3959eae0745f..a364f48ce323 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_virtual_machine_scale_set_extensions_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,10 +52,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachineScaleSetExtension": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -74,14 +77,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineScaleSetExtension') 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 @@ -89,7 +90,6 @@ async def _create_or_update_initial( 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('VirtualMachineScaleSetExtension', pipeline_response) @@ -109,18 +109,18 @@ async def begin_create_or_update( vmss_extension_name: str, extension_parameters: "models.VirtualMachineScaleSetExtension", **kwargs - ) -> "models.VirtualMachineScaleSetExtension": + ) -> AsyncLROPoller["models.VirtualMachineScaleSetExtension"]: """The operation to create or update an extension. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_scale_set_name: The name of the VM scale set where the extension should be create or - updated. + updated. :type vm_scale_set_name: str :param vmss_extension_name: The name of the VM scale set extension. :type vmss_extension_name: str :param extension_parameters: Parameters supplied to the Create VM scale set Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetExtension :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. @@ -128,8 +128,8 @@ async def begin_create_or_update( 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: VirtualMachineScaleSetExtension, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetExtension + :return: An instance of AsyncLROPoller that returns either VirtualMachineScaleSetExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -179,11 +179,14 @@ async def _delete_initial( vm_scale_set_name: str, vmss_extension_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -201,9 +204,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -228,7 +230,7 @@ async def begin_delete( vm_scale_set_name: str, vmss_extension_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -243,8 +245,8 @@ async def begin_delete( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -311,9 +313,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -333,9 +338,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -370,11 +374,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtensionListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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 @@ -388,15 +399,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_virtual_machine_scale_set_rolling_upgrades_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_virtual_machine_scale_set_rolling_upgrades_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 164aaf989958..d41b76a35d62 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_virtual_machine_scale_set_rolling_upgrades_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -47,11 +47,14 @@ async def _cancel_initial( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._cancel_initial.metadata['url'] # type: ignore @@ -68,9 +71,8 @@ async def _cancel_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -94,7 +96,7 @@ async def begin_cancel( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Cancels the current virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -107,8 +109,8 @@ async def begin_cancel( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -155,11 +157,14 @@ async def _start_os_upgrade_initial( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._start_os_upgrade_initial.metadata['url'] # type: ignore @@ -176,9 +181,8 @@ async def _start_os_upgrade_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -202,10 +206,10 @@ async def begin_start_os_upgrade( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Starts a rolling upgrade to move all virtual machine scale set instances to the latest - available Platform Image OS version. Instances which are already running the latest available - OS version are not affected. + available Platform Image OS version. Instances which are already running the latest available + OS version are not affected. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -217,8 +221,8 @@ async def begin_start_os_upgrade( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -278,9 +282,12 @@ async def get_latest( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RollingUpgradeStatusInfo"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.get_latest.metadata['url'] # type: ignore @@ -297,9 +304,8 @@ async def get_latest( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_virtual_machine_scale_set_vms_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_vms_operations.py similarity index 87% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_virtual_machine_scale_set_vms_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_vms_operations.py index acc7091204f5..7b8d29593c33 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_virtual_machine_scale_set_vms_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -49,11 +49,14 @@ async def _reimage_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._reimage_initial.metadata['url'] # type: ignore @@ -71,9 +74,8 @@ async def _reimage_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -98,7 +100,7 @@ async def begin_reimage( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -113,8 +115,8 @@ async def begin_reimage( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -163,11 +165,14 @@ async def _reimage_all_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._reimage_all_initial.metadata['url'] # type: ignore @@ -185,9 +190,8 @@ async def _reimage_all_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -212,9 +216,9 @@ async def begin_reimage_all( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. - This operation is only supported for managed disks. + This operation is only supported for managed disks. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -228,8 +232,8 @@ async def begin_reimage_all( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -278,11 +282,14 @@ async def _deallocate_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._deallocate_initial.metadata['url'] # type: ignore @@ -300,9 +307,8 @@ async def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -327,10 +333,10 @@ async def begin_deallocate( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and - releases the compute resources it uses. You are not billed for the compute resources of this - virtual machine once it is deallocated. + releases the compute resources it uses. You are not billed for the compute resources of this + virtual machine once it is deallocated. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -344,8 +350,8 @@ async def begin_deallocate( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -394,11 +400,14 @@ async def _delete_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -416,9 +425,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -443,7 +451,7 @@ async def begin_delete( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Deletes a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -458,8 +466,8 @@ async def begin_delete( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -523,9 +531,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -543,9 +554,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -583,9 +593,12 @@ async def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -603,9 +616,8 @@ async def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -637,11 +649,14 @@ def list( :type resource_group_name: str :param virtual_machine_scale_set_name: The name of the VM scale set. :type virtual_machine_scale_set_name: str - :param filter: The filter to apply to the operation. + :param filter: The filter to apply to the operation. Allowed values are + 'startswith(instanceView/statuses/code, 'PowerState') eq true', 'properties/latestModelApplied + eq true', 'properties/latestModelApplied eq false'. :type filter: str - :param select: The list parameters. + :param select: The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. :type select: str - :param expand: The expand expression to apply to the operation. + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetVMListResult or the result of cls(response) @@ -649,11 +664,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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 @@ -673,15 +695,11 @@ def prepare_request(next_link=None): query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -714,11 +732,14 @@ async def _power_off_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._power_off_initial.metadata['url'] # type: ignore @@ -736,9 +757,8 @@ async def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -763,10 +783,10 @@ async def begin_power_off( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached - and you are getting charged for the resources. Instead, use deallocate to release resources and - avoid charges. + and you are getting charged for the resources. Instead, use deallocate to release resources and + avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -780,8 +800,8 @@ async def begin_power_off( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -830,11 +850,14 @@ async def _restart_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._restart_initial.metadata['url'] # type: ignore @@ -852,9 +875,8 @@ async def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -879,7 +901,7 @@ async def begin_restart( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Restarts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -894,8 +916,8 @@ async def begin_restart( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -944,11 +966,14 @@ async def _start_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._start_initial.metadata['url'] # type: ignore @@ -966,9 +991,8 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -993,7 +1017,7 @@ async def begin_start( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Starts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1008,8 +1032,8 @@ async def begin_start( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_virtual_machine_scale_sets_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_sets_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_virtual_machine_scale_sets_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_sets_operations.py index 079bac6ea750..b55fc36d6990 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_virtual_machine_scale_sets_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_sets_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachineScaleSet": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSet') 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('VirtualMachineScaleSet', pipeline_response) @@ -106,7 +106,7 @@ async def begin_create_or_update( vm_scale_set_name: str, parameters: "models.VirtualMachineScaleSet", **kwargs - ) -> "models.VirtualMachineScaleSet": + ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -121,8 +121,8 @@ async def begin_create_or_update( 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: VirtualMachineScaleSet, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSet + :return: An instance of AsyncLROPoller that returns either VirtualMachineScaleSet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -173,10 +173,13 @@ async def _update_initial( **kwargs ) -> "models.VirtualMachineScaleSet": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -194,14 +197,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSetUpdate') 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 @@ -223,7 +224,7 @@ async def begin_update( vm_scale_set_name: str, parameters: "models.VirtualMachineScaleSetUpdate", **kwargs - ) -> "models.VirtualMachineScaleSet": + ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: """Update a VM scale set. :param resource_group_name: The name of the resource group. @@ -238,8 +239,8 @@ async def begin_update( 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: VirtualMachineScaleSet, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSet + :return: An instance of AsyncLROPoller that returns either VirtualMachineScaleSet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -287,11 +288,14 @@ async def _delete_initial( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -308,9 +312,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -334,7 +337,7 @@ async def begin_delete( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Deletes a VM scale set. :param resource_group_name: The name of the resource group. @@ -347,8 +350,8 @@ async def begin_delete( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -408,9 +411,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -427,9 +433,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -452,12 +457,15 @@ async def _deallocate_initial( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._deallocate_initial.metadata['url'] # type: ignore @@ -475,9 +483,8 @@ async def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -485,7 +492,6 @@ async def _deallocate_initial( body_content = None 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 @@ -509,10 +515,10 @@ async def begin_deallocate( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and - releases the compute resources. You are not billed for the compute resources that this virtual - machine scale set deallocates. + releases the compute resources. You are not billed for the compute resources that this virtual + machine scale set deallocates. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -526,8 +532,8 @@ async def begin_deallocate( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -576,12 +582,15 @@ async def _delete_instances_initial( vm_scale_set_name: str, vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._delete_instances_initial.metadata['url'] # type: ignore @@ -599,14 +608,12 @@ async def _delete_instances_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -630,7 +637,7 @@ async def begin_delete_instances( vm_scale_set_name: str, vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Deletes virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -645,8 +652,8 @@ async def begin_delete_instances( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -707,9 +714,12 @@ async def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -726,9 +736,8 @@ async def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -760,11 +769,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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 @@ -777,15 +793,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -817,8 +829,8 @@ def list_all( **kwargs ) -> AsyncIterable["models.VirtualMachineScaleSetListWithLinkResult"]: """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource - group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this - till nextLink is null to fetch all the VM Scale Sets. + group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this + till nextLink is null to fetch all the VM Scale Sets. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetListWithLinkResult or the result of cls(response) @@ -826,11 +838,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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_all.metadata['url'] # type: ignore @@ -842,15 +861,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -884,7 +899,7 @@ def list_skus( **kwargs ) -> AsyncIterable["models.VirtualMachineScaleSetListSkusResult"]: """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM - instances allowed for each SKU. + instances allowed for each SKU. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -896,11 +911,18 @@ def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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_skus.metadata['url'] # type: ignore @@ -914,15 +936,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -955,12 +973,15 @@ async def _power_off_initial( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._power_off_initial.metadata['url'] # type: ignore @@ -978,9 +999,8 @@ async def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -988,7 +1008,6 @@ async def _power_off_initial( body_content = None 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 @@ -1012,10 +1031,10 @@ async def begin_power_off( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still - attached and you are getting charged for the resources. Instead, use deallocate to release - resources and avoid charges. + attached and you are getting charged for the resources. Instead, use deallocate to release + resources and avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1029,8 +1048,8 @@ async def begin_power_off( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1079,12 +1098,15 @@ async def _restart_initial( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._restart_initial.metadata['url'] # type: ignore @@ -1102,9 +1124,8 @@ async def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1112,7 +1133,6 @@ async def _restart_initial( body_content = None 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 @@ -1136,7 +1156,7 @@ async def begin_restart( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Restarts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1151,8 +1171,8 @@ async def begin_restart( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1201,12 +1221,15 @@ async def _start_initial( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._start_initial.metadata['url'] # type: ignore @@ -1224,9 +1247,8 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1234,7 +1256,6 @@ async def _start_initial( body_content = None 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 @@ -1258,7 +1279,7 @@ async def begin_start( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Starts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1273,8 +1294,8 @@ async def begin_start( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1323,12 +1344,15 @@ async def _update_instances_initial( vm_scale_set_name: str, vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_instances_initial.metadata['url'] # type: ignore @@ -1346,14 +1370,12 @@ async def _update_instances_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -1377,7 +1399,7 @@ async def begin_update_instances( vm_scale_set_name: str, vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. :param resource_group_name: The name of the resource group. @@ -1392,8 +1414,8 @@ async def begin_update_instances( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1442,12 +1464,15 @@ async def _reimage_initial( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._reimage_initial.metadata['url'] # type: ignore @@ -1465,9 +1490,8 @@ async def _reimage_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1475,7 +1499,6 @@ async def _reimage_initial( body_content = None 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 @@ -1499,7 +1522,7 @@ async def begin_reimage( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1514,8 +1537,8 @@ async def begin_reimage( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1564,12 +1587,15 @@ async def _reimage_all_initial( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._reimage_all_initial.metadata['url'] # type: ignore @@ -1587,9 +1613,8 @@ async def _reimage_all_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1597,7 +1622,6 @@ async def _reimage_all_initial( body_content = None 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 @@ -1621,9 +1645,9 @@ async def begin_reimage_all( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This - operation is only supported for managed disks. + operation is only supported for managed disks. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1637,8 +1661,8 @@ async def begin_reimage_all( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_virtual_machine_sizes_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_sizes_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_virtual_machine_sizes_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_sizes_operations.py index 83577ded9ce6..4209dafb1b1a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_virtual_machine_sizes_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_sizes_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,11 +56,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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 @@ -73,15 +80,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_virtual_machines_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machines_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_virtual_machines_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machines_operations.py index 80ba7a3688b0..aadf168bded7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/_virtual_machines_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machines_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -64,9 +64,12 @@ async def get_extensions( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.get_extensions.metadata['url'] # type: ignore @@ -85,9 +88,8 @@ async def get_extensions( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -119,11 +121,18 @@ def list_by_location( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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_location.metadata['url'] # type: ignore @@ -136,15 +145,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -177,12 +182,15 @@ async def _capture_initial( vm_name: str, parameters: "models.VirtualMachineCaptureParameters", **kwargs - ) -> "models.VirtualMachineCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.VirtualMachineCaptureResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._capture_initial.metadata['url'] # type: ignore @@ -200,14 +208,12 @@ async def _capture_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineCaptureParameters') 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 @@ -231,9 +237,9 @@ async def begin_capture( vm_name: str, parameters: "models.VirtualMachineCaptureParameters", **kwargs - ) -> "models.VirtualMachineCaptureResult": + ) -> AsyncLROPoller["models.VirtualMachineCaptureResult"]: """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used - to create similar VMs. + to create similar VMs. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -247,8 +253,8 @@ async def begin_capture( 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: VirtualMachineCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineCaptureResult + :return: An instance of AsyncLROPoller that returns either VirtualMachineCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineCaptureResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -299,10 +305,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachine": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -320,14 +329,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachine') 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 @@ -335,7 +342,6 @@ async def _create_or_update_initial( 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('VirtualMachine', pipeline_response) @@ -354,7 +360,7 @@ async def begin_create_or_update( vm_name: str, parameters: "models.VirtualMachine", **kwargs - ) -> "models.VirtualMachine": + ) -> AsyncLROPoller["models.VirtualMachine"]: """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -369,8 +375,8 @@ async def begin_create_or_update( 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: VirtualMachine, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachine + :return: An instance of AsyncLROPoller that returns either VirtualMachine or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.VirtualMachine] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -418,11 +424,14 @@ async def _delete_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -439,9 +448,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -465,7 +473,7 @@ async def begin_delete( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """The operation to delete a virtual machine. :param resource_group_name: The name of the resource group. @@ -478,8 +486,8 @@ async def begin_delete( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -542,9 +550,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -563,9 +574,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -600,9 +610,12 @@ async def instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.instance_view.metadata['url'] # type: ignore @@ -619,9 +632,8 @@ async def instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -643,11 +655,14 @@ async def _convert_to_managed_disks_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._convert_to_managed_disks_initial.metadata['url'] # type: ignore @@ -664,9 +679,8 @@ async def _convert_to_managed_disks_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -690,9 +704,9 @@ async def begin_convert_to_managed_disks( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop- - deallocated before invoking this operation. + deallocated before invoking this operation. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -704,8 +718,8 @@ async def begin_convert_to_managed_disks( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -752,11 +766,14 @@ async def _deallocate_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._deallocate_initial.metadata['url'] # type: ignore @@ -773,9 +790,8 @@ async def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -799,9 +815,9 @@ async def begin_deallocate( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Shuts down the virtual machine and releases the compute resources. You are not billed for the - compute resources that this virtual machine uses. + compute resources that this virtual machine uses. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -813,8 +829,8 @@ async def begin_deallocate( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -874,9 +890,12 @@ async def generalize( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.generalize.metadata['url'] # type: ignore @@ -893,9 +912,8 @@ async def generalize( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -918,7 +936,7 @@ def list( **kwargs ) -> AsyncIterable["models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified resource group. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -928,11 +946,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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 @@ -945,15 +970,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -985,7 +1006,7 @@ def list_all( **kwargs ) -> AsyncIterable["models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified subscription. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineListResult or the result of cls(response) @@ -993,11 +1014,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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_all.metadata['url'] # type: ignore @@ -1009,15 +1037,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1051,7 +1075,7 @@ def list_available_sizes( **kwargs ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes to which the specified virtual machine can be - resized. + resized. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1063,11 +1087,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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_available_sizes.metadata['url'] # type: ignore @@ -1081,15 +1112,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1121,11 +1148,14 @@ async def _power_off_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._power_off_initial.metadata['url'] # type: ignore @@ -1142,9 +1172,8 @@ async def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1168,9 +1197,9 @@ async def begin_power_off( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with - the same provisioned resources. You are still charged for this virtual machine. + the same provisioned resources. You are still charged for this virtual machine. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1182,8 +1211,8 @@ async def begin_power_off( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1230,11 +1259,14 @@ async def _restart_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._restart_initial.metadata['url'] # type: ignore @@ -1251,9 +1283,8 @@ async def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1277,7 +1308,7 @@ async def begin_restart( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """The operation to restart a virtual machine. :param resource_group_name: The name of the resource group. @@ -1290,8 +1321,8 @@ async def begin_restart( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1338,11 +1369,14 @@ async def _start_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._start_initial.metadata['url'] # type: ignore @@ -1359,9 +1393,8 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1385,7 +1418,7 @@ async def begin_start( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """The operation to start a virtual machine. :param resource_group_name: The name of the resource group. @@ -1398,8 +1431,8 @@ async def begin_start( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1446,11 +1479,14 @@ async def _redeploy_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._redeploy_initial.metadata['url'] # type: ignore @@ -1467,9 +1503,8 @@ async def _redeploy_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1493,7 +1528,7 @@ async def begin_redeploy( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Shuts down the virtual machine, moves it to a new node, and powers it back on. :param resource_group_name: The name of the resource group. @@ -1506,8 +1541,8 @@ async def begin_redeploy( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1554,11 +1589,14 @@ async def _perform_maintenance_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._perform_maintenance_initial.metadata['url'] # type: ignore @@ -1575,9 +1613,8 @@ async def _perform_maintenance_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1601,7 +1638,7 @@ async def begin_perform_maintenance( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """The operation to perform maintenance on a virtual machine. :param resource_group_name: The name of the resource group. @@ -1614,8 +1651,8 @@ async def begin_perform_maintenance( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1663,12 +1700,15 @@ async def _run_command_initial( vm_name: str, parameters: "models.RunCommandInput", **kwargs - ) -> "models.RunCommandResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.RunCommandResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" # Construct URL url = self._run_command_initial.metadata['url'] # type: ignore @@ -1686,14 +1726,12 @@ async def _run_command_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RunCommandInput') 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 @@ -1717,7 +1755,7 @@ async def begin_run_command( vm_name: str, parameters: "models.RunCommandInput", **kwargs - ) -> "models.RunCommandResult": + ) -> AsyncLROPoller["models.RunCommandResult"]: """Run command on the VM. :param resource_group_name: The name of the resource group. @@ -1732,8 +1770,8 @@ async def begin_run_command( 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: RunCommandResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_03_30.models.RunCommandResult + :return: An instance of AsyncLROPoller that returns either RunCommandResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_03_30.models.RunCommandResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/__init__.py deleted file mode 100644 index 44d8b3b555f4..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations_async/__init__.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 ._availability_sets_operations_async import AvailabilitySetsOperations -from ._virtual_machine_extension_images_operations_async import VirtualMachineExtensionImagesOperations -from ._virtual_machine_extensions_operations_async import VirtualMachineExtensionsOperations -from ._virtual_machines_operations_async import VirtualMachinesOperations -from ._virtual_machine_images_operations_async import VirtualMachineImagesOperations -from ._usage_operations_async import UsageOperations -from ._virtual_machine_sizes_operations_async import VirtualMachineSizesOperations -from ._images_operations_async import ImagesOperations -from ._resource_skus_operations_async import ResourceSkusOperations -from ._virtual_machine_scale_sets_operations_async import VirtualMachineScaleSetsOperations -from ._virtual_machine_scale_set_extensions_operations_async import VirtualMachineScaleSetExtensionsOperations -from ._virtual_machine_scale_set_rolling_upgrades_operations_async import VirtualMachineScaleSetRollingUpgradesOperations -from ._virtual_machine_scale_set_vms_operations_async import VirtualMachineScaleSetVMsOperations -from ._disks_operations_async import DisksOperations -from ._snapshots_operations_async import SnapshotsOperations -from ._virtual_machine_run_commands_operations_async import VirtualMachineRunCommandsOperations - -__all__ = [ - 'AvailabilitySetsOperations', - 'VirtualMachineExtensionImagesOperations', - 'VirtualMachineExtensionsOperations', - 'VirtualMachinesOperations', - 'VirtualMachineImagesOperations', - 'UsageOperations', - 'VirtualMachineSizesOperations', - 'ImagesOperations', - 'ResourceSkusOperations', - 'VirtualMachineScaleSetsOperations', - 'VirtualMachineScaleSetExtensionsOperations', - 'VirtualMachineScaleSetRollingUpgradesOperations', - 'VirtualMachineScaleSetVMsOperations', - 'DisksOperations', - 'SnapshotsOperations', - 'VirtualMachineRunCommandsOperations', -] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/_compute_management_client_enums.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/_compute_management_client_enums.py index e5b868f5156b..ed8ba1f80425 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/_compute_management_client_enums.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/_compute_management_client_enums.py @@ -6,35 +6,53 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum +from enum import Enum, EnumMeta +from six import with_metaclass -class AccessLevel(str, Enum): +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) - none = "None" - read = "Read" + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) -class CachingTypes(str, Enum): + +class AccessLevel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + NONE = "None" + READ = "Read" + +class CachingTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the caching requirements. :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **None** :code:`
`:code:`
` **ReadOnly** :code:`
`:code:`
` **ReadWrite** :code:`
`:code:`
` Default: **None for Standard storage. ReadOnly for Premium storage** """ - none = "None" - read_only = "ReadOnly" - read_write = "ReadWrite" + NONE = "None" + READ_ONLY = "ReadOnly" + READ_WRITE = "ReadWrite" -class DiskCreateOption(str, Enum): +class DiskCreateOption(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """This enumerates the possible sources of a disk's creation. """ - empty = "Empty" - attach = "Attach" - from_image = "FromImage" - import_enum = "Import" - copy = "Copy" + EMPTY = "Empty" + ATTACH = "Attach" + FROM_IMAGE = "FromImage" + IMPORT_ENUM = "Import" + COPY = "Copy" -class DiskCreateOptionTypes(str, Enum): +class DiskCreateOptionTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies how the virtual machine should be created.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` **Attach** \u2013 This value is used when you are using a specialized disk to create the virtual machine.:code:`
`:code:`
` **FromImage** \u2013 @@ -43,107 +61,107 @@ class DiskCreateOptionTypes(str, Enum): marketplace image, you also use the plan element previously described. """ - from_image = "FromImage" - empty = "Empty" - attach = "Attach" + FROM_IMAGE = "FromImage" + EMPTY = "Empty" + ATTACH = "Attach" -class IPVersion(str, Enum): +class IPVersion(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. """ - i_pv4 = "IPv4" - i_pv6 = "IPv6" + I_PV4 = "IPv4" + I_PV6 = "IPv6" -class MaintenanceOperationResultCodeTypes(str, Enum): +class MaintenanceOperationResultCodeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The Last Maintenance Operation Result Code. """ - none = "None" - retry_later = "RetryLater" - maintenance_aborted = "MaintenanceAborted" - maintenance_completed = "MaintenanceCompleted" + NONE = "None" + RETRY_LATER = "RetryLater" + MAINTENANCE_ABORTED = "MaintenanceAborted" + MAINTENANCE_COMPLETED = "MaintenanceCompleted" -class OperatingSystemStateTypes(str, Enum): +class OperatingSystemStateTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The OS State. """ - generalized = "Generalized" - specialized = "Specialized" + GENERALIZED = "Generalized" + SPECIALIZED = "Specialized" -class OperatingSystemTypes(str, Enum): +class OperatingSystemTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The operating system of the osDiskImage. """ - windows = "Windows" - linux = "Linux" + WINDOWS = "Windows" + LINUX = "Linux" -class ProtocolTypes(str, Enum): +class ProtocolTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the protocol of listener. :code:`
`:code:`
` Possible values are: :code:`
`\ **http** :code:`
`:code:`
` **https** """ - http = "Http" - https = "Https" + HTTP = "Http" + HTTPS = "Https" -class ResourceSkuCapacityScaleType(str, Enum): +class ResourceSkuCapacityScaleType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The scale type applicable to the sku. """ - automatic = "Automatic" - manual = "Manual" - none = "None" + AUTOMATIC = "Automatic" + MANUAL = "Manual" + NONE = "None" -class ResourceSkuRestrictionsReasonCode(str, Enum): +class ResourceSkuRestrictionsReasonCode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The reason for restriction. """ - quota_id = "QuotaId" - not_available_for_subscription = "NotAvailableForSubscription" + QUOTA_ID = "QuotaId" + NOT_AVAILABLE_FOR_SUBSCRIPTION = "NotAvailableForSubscription" -class RollingUpgradeActionType(str, Enum): +class RollingUpgradeActionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The last action performed on the rolling upgrade. """ - start = "Start" - cancel = "Cancel" + START = "Start" + CANCEL = "Cancel" -class RollingUpgradeStatusCode(str, Enum): +class RollingUpgradeStatusCode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Code indicating the current status of the upgrade. """ - rolling_forward = "RollingForward" - cancelled = "Cancelled" - completed = "Completed" - faulted = "Faulted" + ROLLING_FORWARD = "RollingForward" + CANCELLED = "Cancelled" + COMPLETED = "Completed" + FAULTED = "Faulted" -class SettingNames(str, Enum): +class SettingNames(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon. """ - auto_logon = "AutoLogon" - first_logon_commands = "FirstLogonCommands" + AUTO_LOGON = "AutoLogon" + FIRST_LOGON_COMMANDS = "FirstLogonCommands" -class StatusLevelTypes(str, Enum): +class StatusLevelTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The level code. """ - info = "Info" - warning = "Warning" - error = "Error" + INFO = "Info" + WARNING = "Warning" + ERROR = "Error" -class StorageAccountTypes(str, Enum): +class StorageAccountTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the storage account type for the managed disk. Possible values are: Standard_LRS or Premium_LRS. NOTE: Managed OS disk storage account type can only be set when you create the scale set. """ - standard_lrs = "Standard_LRS" - premium_lrs = "Premium_LRS" + STANDARD_LRS = "Standard_LRS" + PREMIUM_LRS = "Premium_LRS" -class UpgradeMode(str, Enum): +class UpgradeMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the mode of an upgrade to virtual machines in the scale set.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` **Manual** - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade @@ -151,18 +169,18 @@ class UpgradeMode(str, Enum): automatically updated at the same time. """ - automatic = "Automatic" - manual = "Manual" - rolling = "Rolling" + AUTOMATIC = "Automatic" + MANUAL = "Manual" + ROLLING = "Rolling" -class VirtualMachineScaleSetSkuScaleType(str, Enum): +class VirtualMachineScaleSetSkuScaleType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The scale type applicable to the sku. """ - automatic = "Automatic" - none = "None" + AUTOMATIC = "Automatic" + NONE = "None" -class VirtualMachineSizeTypes(str, Enum): +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 `_. @@ -176,100 +194,100 @@ class VirtualMachineSizeTypes(str, Enum): `_ """ - basic_a0 = "Basic_A0" - basic_a1 = "Basic_A1" - basic_a2 = "Basic_A2" - basic_a3 = "Basic_A3" - basic_a4 = "Basic_A4" - standard_a0 = "Standard_A0" - standard_a1 = "Standard_A1" - standard_a2 = "Standard_A2" - standard_a3 = "Standard_A3" - standard_a4 = "Standard_A4" - standard_a5 = "Standard_A5" - standard_a6 = "Standard_A6" - standard_a7 = "Standard_A7" - standard_a8 = "Standard_A8" - standard_a9 = "Standard_A9" - standard_a10 = "Standard_A10" - standard_a11 = "Standard_A11" - standard_a1_v2 = "Standard_A1_v2" - standard_a2_v2 = "Standard_A2_v2" - standard_a4_v2 = "Standard_A4_v2" - standard_a8_v2 = "Standard_A8_v2" - standard_a2_m_v2 = "Standard_A2m_v2" - standard_a4_m_v2 = "Standard_A4m_v2" - standard_a8_m_v2 = "Standard_A8m_v2" - standard_d1 = "Standard_D1" - standard_d2 = "Standard_D2" - standard_d3 = "Standard_D3" - standard_d4 = "Standard_D4" - standard_d11 = "Standard_D11" - standard_d12 = "Standard_D12" - standard_d13 = "Standard_D13" - standard_d14 = "Standard_D14" - standard_d1_v2 = "Standard_D1_v2" - standard_d2_v2 = "Standard_D2_v2" - standard_d3_v2 = "Standard_D3_v2" - standard_d4_v2 = "Standard_D4_v2" - standard_d5_v2 = "Standard_D5_v2" - standard_d11_v2 = "Standard_D11_v2" - standard_d12_v2 = "Standard_D12_v2" - standard_d13_v2 = "Standard_D13_v2" - standard_d14_v2 = "Standard_D14_v2" - standard_d15_v2 = "Standard_D15_v2" - standard_ds1 = "Standard_DS1" - standard_ds2 = "Standard_DS2" - standard_ds3 = "Standard_DS3" - standard_ds4 = "Standard_DS4" - standard_ds11 = "Standard_DS11" - standard_ds12 = "Standard_DS12" - standard_ds13 = "Standard_DS13" - standard_ds14 = "Standard_DS14" - standard_ds1_v2 = "Standard_DS1_v2" - standard_ds2_v2 = "Standard_DS2_v2" - standard_ds3_v2 = "Standard_DS3_v2" - standard_ds4_v2 = "Standard_DS4_v2" - standard_ds5_v2 = "Standard_DS5_v2" - standard_ds11_v2 = "Standard_DS11_v2" - standard_ds12_v2 = "Standard_DS12_v2" - standard_ds13_v2 = "Standard_DS13_v2" - standard_ds14_v2 = "Standard_DS14_v2" - standard_ds15_v2 = "Standard_DS15_v2" - standard_f1 = "Standard_F1" - standard_f2 = "Standard_F2" - standard_f4 = "Standard_F4" - standard_f8 = "Standard_F8" - standard_f16 = "Standard_F16" - standard_f1_s = "Standard_F1s" - standard_f2_s = "Standard_F2s" - standard_f4_s = "Standard_F4s" - standard_f8_s = "Standard_F8s" - standard_f16_s = "Standard_F16s" - standard_g1 = "Standard_G1" - standard_g2 = "Standard_G2" - standard_g3 = "Standard_G3" - standard_g4 = "Standard_G4" - standard_g5 = "Standard_G5" - standard_gs1 = "Standard_GS1" - standard_gs2 = "Standard_GS2" - standard_gs3 = "Standard_GS3" - standard_gs4 = "Standard_GS4" - standard_gs5 = "Standard_GS5" - standard_h8 = "Standard_H8" - standard_h16 = "Standard_H16" - standard_h8_m = "Standard_H8m" - standard_h16_m = "Standard_H16m" - standard_h16_r = "Standard_H16r" - standard_h16_mr = "Standard_H16mr" - standard_l4_s = "Standard_L4s" - standard_l8_s = "Standard_L8s" - standard_l16_s = "Standard_L16s" - standard_l32_s = "Standard_L32s" - standard_nc6 = "Standard_NC6" - standard_nc12 = "Standard_NC12" - standard_nc24 = "Standard_NC24" - standard_nc24_r = "Standard_NC24r" - standard_nv6 = "Standard_NV6" - standard_nv12 = "Standard_NV12" - standard_nv24 = "Standard_NV24" + BASIC_A0 = "Basic_A0" + BASIC_A1 = "Basic_A1" + BASIC_A2 = "Basic_A2" + BASIC_A3 = "Basic_A3" + BASIC_A4 = "Basic_A4" + STANDARD_A0 = "Standard_A0" + STANDARD_A1 = "Standard_A1" + STANDARD_A2 = "Standard_A2" + STANDARD_A3 = "Standard_A3" + STANDARD_A4 = "Standard_A4" + STANDARD_A5 = "Standard_A5" + STANDARD_A6 = "Standard_A6" + STANDARD_A7 = "Standard_A7" + STANDARD_A8 = "Standard_A8" + STANDARD_A9 = "Standard_A9" + STANDARD_A10 = "Standard_A10" + STANDARD_A11 = "Standard_A11" + STANDARD_A1_V2 = "Standard_A1_v2" + STANDARD_A2_V2 = "Standard_A2_v2" + STANDARD_A4_V2 = "Standard_A4_v2" + STANDARD_A8_V2 = "Standard_A8_v2" + STANDARD_A2_M_V2 = "Standard_A2m_v2" + STANDARD_A4_M_V2 = "Standard_A4m_v2" + STANDARD_A8_M_V2 = "Standard_A8m_v2" + STANDARD_D1 = "Standard_D1" + STANDARD_D2 = "Standard_D2" + STANDARD_D3 = "Standard_D3" + STANDARD_D4 = "Standard_D4" + STANDARD_D11 = "Standard_D11" + STANDARD_D12 = "Standard_D12" + STANDARD_D13 = "Standard_D13" + STANDARD_D14 = "Standard_D14" + STANDARD_D1_V2 = "Standard_D1_v2" + STANDARD_D2_V2 = "Standard_D2_v2" + STANDARD_D3_V2 = "Standard_D3_v2" + STANDARD_D4_V2 = "Standard_D4_v2" + STANDARD_D5_V2 = "Standard_D5_v2" + STANDARD_D11_V2 = "Standard_D11_v2" + STANDARD_D12_V2 = "Standard_D12_v2" + STANDARD_D13_V2 = "Standard_D13_v2" + STANDARD_D14_V2 = "Standard_D14_v2" + STANDARD_D15_V2 = "Standard_D15_v2" + STANDARD_DS1 = "Standard_DS1" + STANDARD_DS2 = "Standard_DS2" + STANDARD_DS3 = "Standard_DS3" + STANDARD_DS4 = "Standard_DS4" + STANDARD_DS11 = "Standard_DS11" + STANDARD_DS12 = "Standard_DS12" + STANDARD_DS13 = "Standard_DS13" + STANDARD_DS14 = "Standard_DS14" + STANDARD_DS1_V2 = "Standard_DS1_v2" + STANDARD_DS2_V2 = "Standard_DS2_v2" + STANDARD_DS3_V2 = "Standard_DS3_v2" + STANDARD_DS4_V2 = "Standard_DS4_v2" + STANDARD_DS5_V2 = "Standard_DS5_v2" + STANDARD_DS11_V2 = "Standard_DS11_v2" + STANDARD_DS12_V2 = "Standard_DS12_v2" + STANDARD_DS13_V2 = "Standard_DS13_v2" + STANDARD_DS14_V2 = "Standard_DS14_v2" + STANDARD_DS15_V2 = "Standard_DS15_v2" + STANDARD_F1 = "Standard_F1" + STANDARD_F2 = "Standard_F2" + STANDARD_F4 = "Standard_F4" + STANDARD_F8 = "Standard_F8" + STANDARD_F16 = "Standard_F16" + STANDARD_F1_S = "Standard_F1s" + STANDARD_F2_S = "Standard_F2s" + STANDARD_F4_S = "Standard_F4s" + STANDARD_F8_S = "Standard_F8s" + STANDARD_F16_S = "Standard_F16s" + STANDARD_G1 = "Standard_G1" + STANDARD_G2 = "Standard_G2" + STANDARD_G3 = "Standard_G3" + STANDARD_G4 = "Standard_G4" + STANDARD_G5 = "Standard_G5" + STANDARD_GS1 = "Standard_GS1" + STANDARD_GS2 = "Standard_GS2" + STANDARD_GS3 = "Standard_GS3" + STANDARD_GS4 = "Standard_GS4" + STANDARD_GS5 = "Standard_GS5" + STANDARD_H8 = "Standard_H8" + STANDARD_H16 = "Standard_H16" + STANDARD_H8_M = "Standard_H8m" + STANDARD_H16_M = "Standard_H16m" + STANDARD_H16_R = "Standard_H16r" + STANDARD_H16_MR = "Standard_H16mr" + STANDARD_L4_S = "Standard_L4s" + STANDARD_L8_S = "Standard_L8s" + STANDARD_L16_S = "Standard_L16s" + STANDARD_L32_S = "Standard_L32s" + STANDARD_NC6 = "Standard_NC6" + STANDARD_NC12 = "Standard_NC12" + STANDARD_NC24 = "Standard_NC24" + STANDARD_NC24_R = "Standard_NC24r" + STANDARD_NV6 = "Standard_NV6" + STANDARD_NV12 = "Standard_NV12" + STANDARD_NV24 = "Standard_NV24" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_availability_sets_operations.py index 9ad118faea4e..08999c7e2797 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_availability_sets_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -67,10 +67,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -88,14 +91,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailabilitySet') 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 @@ -117,7 +118,7 @@ def delete( availability_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" + # type: (...) -> Optional["models.OperationStatusResponse"] """Delete an availability set. :param resource_group_name: The name of the resource group. @@ -129,10 +130,13 @@ def delete( :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore @@ -149,9 +153,8 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -189,9 +192,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -208,9 +214,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -235,7 +240,8 @@ def list_by_subscription( # type: (...) -> Iterable["models.AvailabilitySetListResult"] """Lists all availability sets in a subscription. - :param expand: The expand expression to apply to the operation. + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AvailabilitySetListResult or the result of cls(response) @@ -243,11 +249,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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_subscription.metadata['url'] # type: ignore @@ -261,15 +274,11 @@ def prepare_request(next_link=None): if expand is not None: query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -312,11 +321,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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 @@ -329,15 +345,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -372,7 +384,7 @@ def list_available_sizes( ): # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes that can be used to create a new virtual machine in - an existing availability set. + an existing availability set. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -384,11 +396,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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_available_sizes.metadata['url'] # type: ignore @@ -402,15 +421,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_disks_operations.py index be92615ab52b..59eb7c89c61c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_disks_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.Disk" cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('Disk', pipeline_response) @@ -112,14 +112,14 @@ def begin_create_or_update( disk, # type: "models.Disk" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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.v2017_03_30.models.Disk @@ -182,10 +182,13 @@ def _update_initial( ): # type: (...) -> "models.Disk" cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -203,14 +206,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -218,7 +219,6 @@ def _update_initial( 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('Disk', pipeline_response) @@ -238,14 +238,14 @@ def begin_update( disk, # type: "models.DiskUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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.v2017_03_30.models.DiskUpdate @@ -320,9 +320,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -339,9 +342,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -364,11 +366,14 @@ def _delete_initial( disk_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -385,9 +390,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -412,14 +416,14 @@ def begin_delete( disk_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """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. + 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. @@ -486,11 +490,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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 @@ -503,15 +514,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -551,11 +558,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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 @@ -567,15 +581,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -609,12 +619,15 @@ def _grant_access_initial( grant_access_data, # type: "models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> "models.AccessUri" - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # 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 = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._grant_access_initial.metadata['url'] # type: ignore @@ -632,14 +645,12 @@ def _grant_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -664,17 +675,17 @@ def begin_grant_access( grant_access_data, # type: "models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. + operation. :type grant_access_data: ~azure.mgmt.compute.v2017_03_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. @@ -732,11 +743,14 @@ def _revoke_access_initial( disk_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._revoke_access_initial.metadata['url'] # type: ignore @@ -753,9 +767,8 @@ def _revoke_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -780,14 +793,14 @@ def begin_revoke_access( disk_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """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. + 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. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_images_operations.py index 41740c4e6e75..2957e467a875 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_images_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.Image" cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'Image') 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('Image', pipeline_response) @@ -112,7 +112,7 @@ def begin_create_or_update( parameters, # type: "models.Image" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Image"] """Create or update an image. :param resource_group_name: The name of the resource group. @@ -177,11 +177,14 @@ def _delete_initial( image_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -198,9 +201,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -225,7 +227,7 @@ def begin_delete( image_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Deletes an Image. :param resource_group_name: The name of the resource group. @@ -303,9 +305,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -324,9 +329,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -359,11 +363,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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 @@ -376,15 +387,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -417,7 +424,7 @@ def list( ): # type: (...) -> Iterable["models.ImageListResult"] """Gets the list of Images in the subscription. Use nextLink property in the response to get the - next page of Images. Do this till nextLink is null to fetch all the Images. + next page of Images. Do this till nextLink is null to fetch all the Images. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ImageListResult or the result of cls(response) @@ -425,11 +432,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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 @@ -441,15 +455,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_resource_skus_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_resource_skus_operations.py index b14b856b7766..fc94215b7672 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_resource_skus_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_resource_skus_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -58,11 +58,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceSkusResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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 @@ -74,15 +81,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_snapshots_operations.py index 75a13cc768dd..44a8d24033e0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_snapshots_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.Snapshot" cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('Snapshot', pipeline_response) @@ -112,14 +112,14 @@ def begin_create_or_update( snapshot, # type: "models.Snapshot" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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.v2017_03_30.models.Snapshot @@ -182,10 +182,13 @@ def _update_initial( ): # type: (...) -> "models.Snapshot" cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -203,14 +206,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -218,7 +219,6 @@ def _update_initial( 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('Snapshot', pipeline_response) @@ -238,14 +238,14 @@ def begin_update( snapshot, # type: "models.SnapshotUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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.v2017_03_30.models.SnapshotUpdate @@ -320,9 +320,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -339,9 +342,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -364,11 +366,14 @@ def _delete_initial( snapshot_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -385,9 +390,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -412,14 +416,14 @@ def begin_delete( snapshot_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """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. + 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. @@ -486,11 +490,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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 @@ -503,15 +514,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -551,11 +558,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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 @@ -567,15 +581,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -609,12 +619,15 @@ def _grant_access_initial( grant_access_data, # type: "models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> "models.AccessUri" - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # 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 = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._grant_access_initial.metadata['url'] # type: ignore @@ -632,14 +645,12 @@ def _grant_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -664,17 +675,17 @@ def begin_grant_access( grant_access_data, # type: "models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. + operation. :type grant_access_data: ~azure.mgmt.compute.v2017_03_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. @@ -732,11 +743,14 @@ def _revoke_access_initial( snapshot_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._revoke_access_initial.metadata['url'] # type: ignore @@ -753,9 +767,8 @@ def _revoke_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -780,14 +793,14 @@ def begin_revoke_access( snapshot_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """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. + 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. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_usage_operations.py index ad0f31b3e516..645db95df24e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_usage_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,7 +52,7 @@ def list( ): # type: (...) -> Iterable["models.ListUsagesResult"] """Gets, for the specified location, the current compute resource usage information as well as the - limits for compute resources under the subscription. + limits for compute resources under the subscription. :param location: The location for which resource usage is queried. :type location: str @@ -62,11 +62,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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 @@ -79,15 +86,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_extension_images_operations.py index 90380b039f38..301f85a9888c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_extension_images_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -69,9 +69,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -90,9 +93,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -128,9 +130,12 @@ def list_types( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.list_types.metadata['url'] # type: ignore @@ -147,9 +152,8 @@ def list_types( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -197,9 +201,12 @@ def list_versions( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.list_versions.metadata['url'] # type: ignore @@ -223,9 +230,8 @@ def list_versions( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_extensions_operations.py index 1e4ff95788b2..cd5837bb0d61 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_extensions_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachineExtension" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -78,14 +81,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtension') 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 @@ -93,7 +94,6 @@ def _create_or_update_initial( 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('VirtualMachineExtension', pipeline_response) @@ -114,18 +114,18 @@ def begin_create_or_update( extension_parameters, # type: "models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineExtension"] """The operation to create or update the extension. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_name: The name of the virtual machine where the extension should be created or - updated. + updated. :type vm_name: str :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Create Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineExtension :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. @@ -188,10 +188,13 @@ def _update_initial( ): # type: (...) -> "models.VirtualMachineExtension" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -210,14 +213,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtensionUpdate') 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 @@ -241,7 +242,7 @@ def begin_update( extension_parameters, # type: "models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineExtension"] """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -251,7 +252,7 @@ def begin_update( :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Update Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineExtensionUpdate :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. @@ -311,11 +312,14 @@ def _delete_initial( vm_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -333,9 +337,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -361,7 +364,7 @@ def begin_delete( vm_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -445,9 +448,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -467,9 +473,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_images_operations.py index 047e5e7ac6ee..862ae1f65213 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_images_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -72,9 +72,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -94,9 +97,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -148,9 +150,12 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -175,9 +180,8 @@ def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -213,9 +217,12 @@ def list_offers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.list_offers.metadata['url'] # type: ignore @@ -232,9 +239,8 @@ def list_offers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -267,9 +273,12 @@ def list_publishers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.list_publishers.metadata['url'] # type: ignore @@ -285,9 +294,8 @@ def list_publishers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -326,9 +334,12 @@ def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.list_skus.metadata['url'] # type: ignore @@ -346,9 +357,8 @@ def list_skus( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_run_commands_operations.py index e315f458e74a..5028014cb7e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_run_commands_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -61,11 +61,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json, text/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 @@ -78,15 +85,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -132,9 +135,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandDocument"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json, text/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -151,9 +157,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_extensions_operations.py index b43c6366d62e..72c319368ab8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_extensions_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -57,10 +57,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachineScaleSetExtension" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -79,14 +82,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineScaleSetExtension') 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 @@ -94,7 +95,6 @@ def _create_or_update_initial( 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('VirtualMachineScaleSetExtension', pipeline_response) @@ -115,18 +115,18 @@ def begin_create_or_update( extension_parameters, # type: "models.VirtualMachineScaleSetExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineScaleSetExtension"] """The operation to create or update an extension. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_scale_set_name: The name of the VM scale set where the extension should be create or - updated. + updated. :type vm_scale_set_name: str :param vmss_extension_name: The name of the VM scale set extension. :type vmss_extension_name: str :param extension_parameters: Parameters supplied to the Create VM scale set Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetExtension :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. @@ -186,11 +186,14 @@ def _delete_initial( vmss_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -208,9 +211,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -236,7 +238,7 @@ def begin_delete( vmss_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -320,9 +322,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -342,9 +347,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -380,11 +384,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtensionListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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 @@ -398,15 +409,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 4f05a7c32164..eff2c2909706 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod @@ -52,11 +52,14 @@ def _cancel_initial( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._cancel_initial.metadata['url'] # type: ignore @@ -73,9 +76,8 @@ def _cancel_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -100,7 +102,7 @@ def begin_cancel( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Cancels the current virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -162,11 +164,14 @@ def _start_os_upgrade_initial( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._start_os_upgrade_initial.metadata['url'] # type: ignore @@ -183,9 +188,8 @@ def _start_os_upgrade_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -210,10 +214,10 @@ def begin_start_os_upgrade( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Starts a rolling upgrade to move all virtual machine scale set instances to the latest - available Platform Image OS version. Instances which are already running the latest available - OS version are not affected. + available Platform Image OS version. Instances which are already running the latest available + OS version are not affected. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -287,9 +291,12 @@ def get_latest( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RollingUpgradeStatusInfo"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.get_latest.metadata['url'] # type: ignore @@ -306,9 +313,8 @@ def get_latest( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_vms_operations.py index 024a45b23e22..5f1dfab9d7f5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_vms_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -54,11 +54,14 @@ def _reimage_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._reimage_initial.metadata['url'] # type: ignore @@ -76,9 +79,8 @@ def _reimage_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -104,7 +106,7 @@ def begin_reimage( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -170,11 +172,14 @@ def _reimage_all_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._reimage_all_initial.metadata['url'] # type: ignore @@ -192,9 +197,8 @@ def _reimage_all_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -220,9 +224,9 @@ def begin_reimage_all( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. - This operation is only supported for managed disks. + This operation is only supported for managed disks. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -287,11 +291,14 @@ def _deallocate_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._deallocate_initial.metadata['url'] # type: ignore @@ -309,9 +316,8 @@ def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -337,10 +343,10 @@ def begin_deallocate( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and - releases the compute resources it uses. You are not billed for the compute resources of this - virtual machine once it is deallocated. + releases the compute resources it uses. You are not billed for the compute resources of this + virtual machine once it is deallocated. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -405,11 +411,14 @@ def _delete_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -427,9 +436,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -455,7 +463,7 @@ def begin_delete( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Deletes a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -536,9 +544,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -556,9 +567,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -597,9 +607,12 @@ def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -617,9 +630,8 @@ def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -652,11 +664,14 @@ def list( :type resource_group_name: str :param virtual_machine_scale_set_name: The name of the VM scale set. :type virtual_machine_scale_set_name: str - :param filter: The filter to apply to the operation. + :param filter: The filter to apply to the operation. Allowed values are + 'startswith(instanceView/statuses/code, 'PowerState') eq true', 'properties/latestModelApplied + eq true', 'properties/latestModelApplied eq false'. :type filter: str - :param select: The list parameters. + :param select: The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. :type select: str - :param expand: The expand expression to apply to the operation. + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetVMListResult or the result of cls(response) @@ -664,11 +679,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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 @@ -688,15 +710,11 @@ def prepare_request(next_link=None): query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -730,11 +748,14 @@ def _power_off_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._power_off_initial.metadata['url'] # type: ignore @@ -752,9 +773,8 @@ def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -780,10 +800,10 @@ def begin_power_off( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached - and you are getting charged for the resources. Instead, use deallocate to release resources and - avoid charges. + and you are getting charged for the resources. Instead, use deallocate to release resources and + avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -848,11 +868,14 @@ def _restart_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._restart_initial.metadata['url'] # type: ignore @@ -870,9 +893,8 @@ def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -898,7 +920,7 @@ def begin_restart( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Restarts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -964,11 +986,14 @@ def _start_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._start_initial.metadata['url'] # type: ignore @@ -986,9 +1011,8 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1014,7 +1038,7 @@ def begin_start( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Starts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_sets_operations.py index ff508d5c9394..f3c5dcbf1d68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_sets_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachineScaleSet" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSet') 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('VirtualMachineScaleSet', pipeline_response) @@ -112,7 +112,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualMachineScaleSet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -180,10 +180,13 @@ def _update_initial( ): # type: (...) -> "models.VirtualMachineScaleSet" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -201,14 +204,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSetUpdate') 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 @@ -231,7 +232,7 @@ def begin_update( parameters, # type: "models.VirtualMachineScaleSetUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] """Update a VM scale set. :param resource_group_name: The name of the resource group. @@ -296,11 +297,14 @@ def _delete_initial( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -317,9 +321,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -344,7 +347,7 @@ def begin_delete( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Deletes a VM scale set. :param resource_group_name: The name of the resource group. @@ -419,9 +422,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -438,9 +444,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -464,12 +469,15 @@ def _deallocate_initial( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._deallocate_initial.metadata['url'] # type: ignore @@ -487,9 +495,8 @@ def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -497,7 +504,6 @@ def _deallocate_initial( body_content = None 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 @@ -522,10 +528,10 @@ def begin_deallocate( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and - releases the compute resources. You are not billed for the compute resources that this virtual - machine scale set deallocates. + releases the compute resources. You are not billed for the compute resources that this virtual + machine scale set deallocates. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -590,12 +596,15 @@ def _delete_instances_initial( vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._delete_instances_initial.metadata['url'] # type: ignore @@ -613,14 +622,12 @@ def _delete_instances_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -645,7 +652,7 @@ def begin_delete_instances( vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Deletes virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -723,9 +730,12 @@ def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -742,9 +752,8 @@ def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -777,11 +786,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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 @@ -794,15 +810,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -835,8 +847,8 @@ def list_all( ): # type: (...) -> Iterable["models.VirtualMachineScaleSetListWithLinkResult"] """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource - group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this - till nextLink is null to fetch all the VM Scale Sets. + group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this + till nextLink is null to fetch all the VM Scale Sets. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetListWithLinkResult or the result of cls(response) @@ -844,11 +856,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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_all.metadata['url'] # type: ignore @@ -860,15 +879,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -903,7 +918,7 @@ def list_skus( ): # type: (...) -> Iterable["models.VirtualMachineScaleSetListSkusResult"] """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM - instances allowed for each SKU. + instances allowed for each SKU. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -915,11 +930,18 @@ def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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_skus.metadata['url'] # type: ignore @@ -933,15 +955,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -975,12 +993,15 @@ def _power_off_initial( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._power_off_initial.metadata['url'] # type: ignore @@ -998,9 +1019,8 @@ def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1008,7 +1028,6 @@ def _power_off_initial( body_content = None 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 @@ -1033,10 +1052,10 @@ def begin_power_off( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still - attached and you are getting charged for the resources. Instead, use deallocate to release - resources and avoid charges. + attached and you are getting charged for the resources. Instead, use deallocate to release + resources and avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1101,12 +1120,15 @@ def _restart_initial( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._restart_initial.metadata['url'] # type: ignore @@ -1124,9 +1146,8 @@ def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1134,7 +1155,6 @@ def _restart_initial( body_content = None 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 @@ -1159,7 +1179,7 @@ def begin_restart( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Restarts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1225,12 +1245,15 @@ def _start_initial( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._start_initial.metadata['url'] # type: ignore @@ -1248,9 +1271,8 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1258,7 +1280,6 @@ def _start_initial( body_content = None 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 @@ -1283,7 +1304,7 @@ def begin_start( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Starts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1349,12 +1370,15 @@ def _update_instances_initial( vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_instances_initial.metadata['url'] # type: ignore @@ -1372,14 +1396,12 @@ def _update_instances_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -1404,7 +1426,7 @@ def begin_update_instances( vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. :param resource_group_name: The name of the resource group. @@ -1470,12 +1492,15 @@ def _reimage_initial( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._reimage_initial.metadata['url'] # type: ignore @@ -1493,9 +1518,8 @@ def _reimage_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1503,7 +1527,6 @@ def _reimage_initial( body_content = None 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 @@ -1528,7 +1551,7 @@ def begin_reimage( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1594,12 +1617,15 @@ def _reimage_all_initial( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._reimage_all_initial.metadata['url'] # type: ignore @@ -1617,9 +1643,8 @@ def _reimage_all_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1627,7 +1652,6 @@ def _reimage_all_initial( body_content = None 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 @@ -1652,9 +1676,9 @@ def begin_reimage_all( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This - operation is only supported for managed disks. + operation is only supported for managed disks. :param resource_group_name: The name of the resource group. :type resource_group_name: str diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_sizes_operations.py index d32baae64783..83f7e9877982 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_sizes_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -61,11 +61,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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 @@ -78,15 +85,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machines_operations.py index 8962f57d57b0..5fe8d366f407 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machines_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -69,9 +69,12 @@ def get_extensions( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.get_extensions.metadata['url'] # type: ignore @@ -90,9 +93,8 @@ def get_extensions( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -125,11 +127,18 @@ def list_by_location( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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_location.metadata['url'] # type: ignore @@ -142,15 +151,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -184,12 +189,15 @@ def _capture_initial( parameters, # type: "models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._capture_initial.metadata['url'] # type: ignore @@ -207,14 +215,12 @@ def _capture_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineCaptureParameters') 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 @@ -239,9 +245,9 @@ def begin_capture( parameters, # type: "models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineCaptureResult"] """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used - to create similar VMs. + to create similar VMs. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -308,10 +314,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachine" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -329,14 +338,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachine') 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 @@ -344,7 +351,6 @@ def _create_or_update_initial( 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('VirtualMachine', pipeline_response) @@ -364,7 +370,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualMachine" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachine"] """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -429,11 +435,14 @@ def _delete_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -450,9 +459,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -477,7 +485,7 @@ def begin_delete( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """The operation to delete a virtual machine. :param resource_group_name: The name of the resource group. @@ -555,9 +563,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -576,9 +587,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -614,9 +624,12 @@ def instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.instance_view.metadata['url'] # type: ignore @@ -633,9 +646,8 @@ def instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -658,11 +670,14 @@ def _convert_to_managed_disks_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._convert_to_managed_disks_initial.metadata['url'] # type: ignore @@ -679,9 +694,8 @@ def _convert_to_managed_disks_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -706,9 +720,9 @@ def begin_convert_to_managed_disks( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop- - deallocated before invoking this operation. + deallocated before invoking this operation. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -769,11 +783,14 @@ def _deallocate_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._deallocate_initial.metadata['url'] # type: ignore @@ -790,9 +807,8 @@ def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -817,9 +833,9 @@ def begin_deallocate( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Shuts down the virtual machine and releases the compute resources. You are not billed for the - compute resources that this virtual machine uses. + compute resources that this virtual machine uses. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -893,9 +909,12 @@ def generalize( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self.generalize.metadata['url'] # type: ignore @@ -912,9 +931,8 @@ def generalize( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -938,7 +956,7 @@ def list( ): # type: (...) -> Iterable["models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified resource group. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -948,11 +966,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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 @@ -965,15 +990,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1006,7 +1027,7 @@ def list_all( ): # type: (...) -> Iterable["models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified subscription. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineListResult or the result of cls(response) @@ -1014,11 +1035,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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_all.metadata['url'] # type: ignore @@ -1030,15 +1058,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1073,7 +1097,7 @@ def list_available_sizes( ): # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes to which the specified virtual machine can be - resized. + resized. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1085,11 +1109,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-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_available_sizes.metadata['url'] # type: ignore @@ -1103,15 +1134,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1144,11 +1171,14 @@ def _power_off_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._power_off_initial.metadata['url'] # type: ignore @@ -1165,9 +1195,8 @@ def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1192,9 +1221,9 @@ def begin_power_off( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with - the same provisioned resources. You are still charged for this virtual machine. + the same provisioned resources. You are still charged for this virtual machine. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1255,11 +1284,14 @@ def _restart_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._restart_initial.metadata['url'] # type: ignore @@ -1276,9 +1308,8 @@ def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1303,7 +1334,7 @@ def begin_restart( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """The operation to restart a virtual machine. :param resource_group_name: The name of the resource group. @@ -1365,11 +1396,14 @@ def _start_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._start_initial.metadata['url'] # type: ignore @@ -1386,9 +1420,8 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1413,7 +1446,7 @@ def begin_start( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """The operation to start a virtual machine. :param resource_group_name: The name of the resource group. @@ -1475,11 +1508,14 @@ def _redeploy_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._redeploy_initial.metadata['url'] # type: ignore @@ -1496,9 +1532,8 @@ def _redeploy_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1523,7 +1558,7 @@ def begin_redeploy( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Shuts down the virtual machine, moves it to a new node, and powers it back on. :param resource_group_name: The name of the resource group. @@ -1585,11 +1620,14 @@ def _perform_maintenance_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" + accept = "application/json" # Construct URL url = self._perform_maintenance_initial.metadata['url'] # type: ignore @@ -1606,9 +1644,8 @@ def _perform_maintenance_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1633,7 +1670,7 @@ def begin_perform_maintenance( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """The operation to perform maintenance on a virtual machine. :param resource_group_name: The name of the resource group. @@ -1696,12 +1733,15 @@ def _run_command_initial( parameters, # type: "models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> "models.RunCommandResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" # Construct URL url = self._run_command_initial.metadata['url'] # type: ignore @@ -1719,14 +1759,12 @@ def _run_command_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RunCommandInput') 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 @@ -1751,7 +1789,7 @@ def begin_run_command( parameters, # type: "models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RunCommandResult"] """Run command on the VM. :param resource_group_name: The name of the resource group. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/__init__.py index 20a4019e9c23..cdc7f7a1709a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/__init__.py @@ -10,7 +10,7 @@ __all__ = ['ComputeManagementClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass 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 7cb9074b59da..66122fb73dba 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 @@ -32,7 +32,6 @@ class ComputeManagementClient(object): :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. :type subscription_id: str :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -50,6 +49,7 @@ 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/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_configuration.py index c5815615c85a..7de63496e446 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -47,8 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2017-09-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-compute/{}'.format(VERSION)) self._configure(**kwargs) @@ -61,6 +61,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) 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 a43fd151609e..6e224feb3f20 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 @@ -4,7 +4,11 @@ "client": { "name": "ComputeManagementClient", "filename": "_compute_management_client", - "description": "Compute Client." + "description": "Compute Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": false }, "global_parameters": { "sync_method": { @@ -41,7 +45,10 @@ }, "config": { "credential": true, - "credential_scopes": ["https://management.azure.com/.default"] + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null }, "operation_groups": { "resource_skus": "ResourceSkusOperations" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/__init__.py index c8a8b4817269..9e9459635989 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._compute_management_client_async import ComputeManagementClient +from ._compute_management_client import ComputeManagementClient __all__ = ['ComputeManagementClient'] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/_compute_management_client_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/_compute_management_client.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/_compute_management_client_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/_compute_management_client.py index 817ceec59bd9..9ec019284e19 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/_compute_management_client_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/_compute_management_client.py @@ -15,8 +15,8 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration_async import ComputeManagementClientConfiguration -from .operations_async import ResourceSkusOperations +from ._configuration import ComputeManagementClientConfiguration +from .operations import ResourceSkusOperations from .. import models @@ -24,13 +24,12 @@ class ComputeManagementClient(object): """Compute Client. :ivar resource_skus: ResourceSkusOperations operations - :vartype resource_skus: azure.mgmt.compute.v2017_09_01.aio.operations_async.ResourceSkusOperations + :vartype resource_skus: azure.mgmt.compute.v2017_09_01.aio.operations.ResourceSkusOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. :type subscription_id: str :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -47,6 +46,7 @@ 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/aio/_configuration_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/_configuration.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/_configuration_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/_configuration.py index ebd9579c77d3..8b7f44c88cde 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/_configuration_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -44,8 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2017-09-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-compute/{}'.format(VERSION)) self._configure(**kwargs) @@ -57,6 +57,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/operations_async/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/operations/__init__.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/operations_async/__init__.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/operations/__init__.py index a23395bbba25..46d684b6a0cc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/operations_async/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/operations/__init__.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._resource_skus_operations_async import ResourceSkusOperations +from ._resource_skus_operations import ResourceSkusOperations __all__ = [ 'ResourceSkusOperations', diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/operations_async/_resource_skus_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/operations/_resource_skus_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/operations_async/_resource_skus_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/operations/_resource_skus_operations.py index 48d369cf3702..76b2028461d8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/operations_async/_resource_skus_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/operations/_resource_skus_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -53,11 +53,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceSkusResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-09-01" + 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 @@ -69,15 +76,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/_compute_management_client_enums.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/_compute_management_client_enums.py index e34b0cbf9f58..7675dc0dd449 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/_compute_management_client_enums.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/_compute_management_client_enums.py @@ -6,26 +6,44 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum +from enum import Enum, EnumMeta +from six import with_metaclass -class ResourceSkuCapacityScaleType(str, Enum): +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class ResourceSkuCapacityScaleType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The scale type applicable to the sku. """ - automatic = "Automatic" - manual = "Manual" - none = "None" + AUTOMATIC = "Automatic" + MANUAL = "Manual" + NONE = "None" -class ResourceSkuRestrictionsReasonCode(str, Enum): +class ResourceSkuRestrictionsReasonCode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The reason for restriction. """ - quota_id = "QuotaId" - not_available_for_subscription = "NotAvailableForSubscription" + QUOTA_ID = "QuotaId" + NOT_AVAILABLE_FOR_SUBSCRIPTION = "NotAvailableForSubscription" -class ResourceSkuRestrictionsType(str, Enum): +class ResourceSkuRestrictionsType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The type of restrictions. """ - location = "Location" - zone = "Zone" + LOCATION = "Location" + ZONE = "Zone" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/operations/_resource_skus_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/operations/_resource_skus_operations.py index d9c8d6a36609..ce7d60f1d985 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/operations/_resource_skus_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/operations/_resource_skus_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -58,11 +58,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceSkusResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-09-01" + 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 @@ -74,15 +81,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/__init__.py index 20a4019e9c23..cdc7f7a1709a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/__init__.py @@ -10,7 +10,7 @@ __all__ = ['ComputeManagementClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass 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 9a9611a8c9f6..7a360591eb8b 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,6 +92,7 @@ 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/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_configuration.py index 468c46045ad5..67d043079baa 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -47,8 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2017-12-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-compute/{}'.format(VERSION)) self._configure(**kwargs) @@ -61,6 +61,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) 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 135137c640d6..f1fe3390c053 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 @@ -4,7 +4,11 @@ "client": { "name": "ComputeManagementClient", "filename": "_compute_management_client", - "description": "Compute Client." + "description": "Compute Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true }, "global_parameters": { "sync_method": { @@ -41,7 +45,10 @@ }, "config": { "credential": true, - "credential_scopes": ["https://management.azure.com/.default"] + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null }, "operation_groups": { "operations": "Operations", diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/__init__.py index c8a8b4817269..9e9459635989 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._compute_management_client_async import ComputeManagementClient +from ._compute_management_client import ComputeManagementClient __all__ = ['ComputeManagementClient'] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/_compute_management_client_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/_compute_management_client.py similarity index 78% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/_compute_management_client_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/_compute_management_client.py index f5512d5eb9c0..0754de1374fe 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/_compute_management_client_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/_compute_management_client.py @@ -15,22 +15,22 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration_async import ComputeManagementClientConfiguration -from .operations_async import Operations -from .operations_async import AvailabilitySetsOperations -from .operations_async import VirtualMachineExtensionImagesOperations -from .operations_async import VirtualMachineExtensionsOperations -from .operations_async import VirtualMachinesOperations -from .operations_async import VirtualMachineImagesOperations -from .operations_async import UsageOperations -from .operations_async import VirtualMachineSizesOperations -from .operations_async import ImagesOperations -from .operations_async import VirtualMachineScaleSetsOperations -from .operations_async import VirtualMachineScaleSetExtensionsOperations -from .operations_async import VirtualMachineScaleSetRollingUpgradesOperations -from .operations_async import VirtualMachineScaleSetVMsOperations -from .operations_async import LogAnalyticsOperations -from .operations_async import VirtualMachineRunCommandsOperations +from ._configuration import ComputeManagementClientConfiguration +from .operations import Operations +from .operations import AvailabilitySetsOperations +from .operations import VirtualMachineExtensionImagesOperations +from .operations import VirtualMachineExtensionsOperations +from .operations import VirtualMachinesOperations +from .operations import VirtualMachineImagesOperations +from .operations import UsageOperations +from .operations import VirtualMachineSizesOperations +from .operations import ImagesOperations +from .operations import VirtualMachineScaleSetsOperations +from .operations import VirtualMachineScaleSetExtensionsOperations +from .operations import VirtualMachineScaleSetRollingUpgradesOperations +from .operations import VirtualMachineScaleSetVMsOperations +from .operations import LogAnalyticsOperations +from .operations import VirtualMachineRunCommandsOperations from .. import models @@ -38,35 +38,35 @@ class ComputeManagementClient(object): """Compute Client. :ivar operations: Operations operations - :vartype operations: azure.mgmt.compute.v2017_12_01.aio.operations_async.Operations + :vartype operations: azure.mgmt.compute.v2017_12_01.aio.operations.Operations :ivar availability_sets: AvailabilitySetsOperations operations - :vartype availability_sets: azure.mgmt.compute.v2017_12_01.aio.operations_async.AvailabilitySetsOperations + :vartype availability_sets: azure.mgmt.compute.v2017_12_01.aio.operations.AvailabilitySetsOperations :ivar virtual_machine_extension_images: VirtualMachineExtensionImagesOperations operations - :vartype virtual_machine_extension_images: azure.mgmt.compute.v2017_12_01.aio.operations_async.VirtualMachineExtensionImagesOperations + :vartype virtual_machine_extension_images: azure.mgmt.compute.v2017_12_01.aio.operations.VirtualMachineExtensionImagesOperations :ivar virtual_machine_extensions: VirtualMachineExtensionsOperations operations - :vartype virtual_machine_extensions: azure.mgmt.compute.v2017_12_01.aio.operations_async.VirtualMachineExtensionsOperations + :vartype virtual_machine_extensions: azure.mgmt.compute.v2017_12_01.aio.operations.VirtualMachineExtensionsOperations :ivar virtual_machines: VirtualMachinesOperations operations - :vartype virtual_machines: azure.mgmt.compute.v2017_12_01.aio.operations_async.VirtualMachinesOperations + :vartype virtual_machines: azure.mgmt.compute.v2017_12_01.aio.operations.VirtualMachinesOperations :ivar virtual_machine_images: VirtualMachineImagesOperations operations - :vartype virtual_machine_images: azure.mgmt.compute.v2017_12_01.aio.operations_async.VirtualMachineImagesOperations + :vartype virtual_machine_images: azure.mgmt.compute.v2017_12_01.aio.operations.VirtualMachineImagesOperations :ivar usage: UsageOperations operations - :vartype usage: azure.mgmt.compute.v2017_12_01.aio.operations_async.UsageOperations + :vartype usage: azure.mgmt.compute.v2017_12_01.aio.operations.UsageOperations :ivar virtual_machine_sizes: VirtualMachineSizesOperations operations - :vartype virtual_machine_sizes: azure.mgmt.compute.v2017_12_01.aio.operations_async.VirtualMachineSizesOperations + :vartype virtual_machine_sizes: azure.mgmt.compute.v2017_12_01.aio.operations.VirtualMachineSizesOperations :ivar images: ImagesOperations operations - :vartype images: azure.mgmt.compute.v2017_12_01.aio.operations_async.ImagesOperations + :vartype images: azure.mgmt.compute.v2017_12_01.aio.operations.ImagesOperations :ivar virtual_machine_scale_sets: VirtualMachineScaleSetsOperations operations - :vartype virtual_machine_scale_sets: azure.mgmt.compute.v2017_12_01.aio.operations_async.VirtualMachineScaleSetsOperations + :vartype virtual_machine_scale_sets: azure.mgmt.compute.v2017_12_01.aio.operations.VirtualMachineScaleSetsOperations :ivar virtual_machine_scale_set_extensions: VirtualMachineScaleSetExtensionsOperations operations - :vartype virtual_machine_scale_set_extensions: azure.mgmt.compute.v2017_12_01.aio.operations_async.VirtualMachineScaleSetExtensionsOperations + :vartype virtual_machine_scale_set_extensions: azure.mgmt.compute.v2017_12_01.aio.operations.VirtualMachineScaleSetExtensionsOperations :ivar virtual_machine_scale_set_rolling_upgrades: VirtualMachineScaleSetRollingUpgradesOperations operations - :vartype virtual_machine_scale_set_rolling_upgrades: azure.mgmt.compute.v2017_12_01.aio.operations_async.VirtualMachineScaleSetRollingUpgradesOperations + :vartype virtual_machine_scale_set_rolling_upgrades: azure.mgmt.compute.v2017_12_01.aio.operations.VirtualMachineScaleSetRollingUpgradesOperations :ivar virtual_machine_scale_set_vms: VirtualMachineScaleSetVMsOperations operations - :vartype virtual_machine_scale_set_vms: azure.mgmt.compute.v2017_12_01.aio.operations_async.VirtualMachineScaleSetVMsOperations + :vartype virtual_machine_scale_set_vms: azure.mgmt.compute.v2017_12_01.aio.operations.VirtualMachineScaleSetVMsOperations :ivar log_analytics: LogAnalyticsOperations operations - :vartype log_analytics: azure.mgmt.compute.v2017_12_01.aio.operations_async.LogAnalyticsOperations + :vartype log_analytics: azure.mgmt.compute.v2017_12_01.aio.operations.LogAnalyticsOperations :ivar virtual_machine_run_commands: VirtualMachineRunCommandsOperations operations - :vartype virtual_machine_run_commands: azure.mgmt.compute.v2017_12_01.aio.operations_async.VirtualMachineRunCommandsOperations + :vartype virtual_machine_run_commands: azure.mgmt.compute.v2017_12_01.aio.operations.VirtualMachineRunCommandsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. @@ -89,6 +89,7 @@ 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/aio/_configuration_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/_configuration.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/_configuration_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/_configuration.py index 3317be957d69..6eadfb4648bd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/_configuration_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -44,8 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2017-12-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-compute/{}'.format(VERSION)) self._configure(**kwargs) @@ -57,6 +57,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/__init__.py new file mode 100644 index 000000000000..3ad29360b8dc --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/__init__.py @@ -0,0 +1,41 @@ +# 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 ._operations import Operations +from ._availability_sets_operations import AvailabilitySetsOperations +from ._virtual_machine_extension_images_operations import VirtualMachineExtensionImagesOperations +from ._virtual_machine_extensions_operations import VirtualMachineExtensionsOperations +from ._virtual_machines_operations import VirtualMachinesOperations +from ._virtual_machine_images_operations import VirtualMachineImagesOperations +from ._usage_operations import UsageOperations +from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations +from ._images_operations import ImagesOperations +from ._virtual_machine_scale_sets_operations import VirtualMachineScaleSetsOperations +from ._virtual_machine_scale_set_extensions_operations import VirtualMachineScaleSetExtensionsOperations +from ._virtual_machine_scale_set_rolling_upgrades_operations import VirtualMachineScaleSetRollingUpgradesOperations +from ._virtual_machine_scale_set_vms_operations import VirtualMachineScaleSetVMsOperations +from ._log_analytics_operations import LogAnalyticsOperations +from ._virtual_machine_run_commands_operations import VirtualMachineRunCommandsOperations + +__all__ = [ + 'Operations', + 'AvailabilitySetsOperations', + 'VirtualMachineExtensionImagesOperations', + 'VirtualMachineExtensionsOperations', + 'VirtualMachinesOperations', + 'VirtualMachineImagesOperations', + 'UsageOperations', + 'VirtualMachineSizesOperations', + 'ImagesOperations', + 'VirtualMachineScaleSetsOperations', + 'VirtualMachineScaleSetExtensionsOperations', + 'VirtualMachineScaleSetRollingUpgradesOperations', + 'VirtualMachineScaleSetVMsOperations', + 'LogAnalyticsOperations', + 'VirtualMachineRunCommandsOperations', +] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_availability_sets_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_availability_sets_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_availability_sets_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_availability_sets_operations.py index 21a7d03620b0..d815173acb89 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_availability_sets_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_availability_sets_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -62,10 +62,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -83,14 +86,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailabilitySet') 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 @@ -127,10 +128,13 @@ async def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -148,14 +152,12 @@ async def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailabilitySetUpdate') 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 @@ -176,7 +178,7 @@ async def delete( resource_group_name: str, availability_set_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> Optional["models.OperationStatusResponse"]: """Delete an availability set. :param resource_group_name: The name of the resource group. @@ -188,10 +190,13 @@ async def delete( :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore @@ -208,9 +213,8 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -247,9 +251,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -266,9 +273,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -292,7 +298,8 @@ def list_by_subscription( ) -> AsyncIterable["models.AvailabilitySetListResult"]: """Lists all availability sets in a subscription. - :param expand: The expand expression to apply to the operation. + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AvailabilitySetListResult or the result of cls(response) @@ -300,11 +307,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + 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_subscription.metadata['url'] # type: ignore @@ -318,15 +332,11 @@ def prepare_request(next_link=None): if expand is not None: query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -368,11 +378,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + 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 @@ -385,15 +402,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -427,7 +440,7 @@ def list_available_sizes( **kwargs ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes that can be used to create a new virtual machine in - an existing availability set. + an existing availability set. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -439,11 +452,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + 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_available_sizes.metadata['url'] # type: ignore @@ -457,15 +477,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_images_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_images_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_images_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_images_operations.py index e7329171d6ba..84591edcb840 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_images_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_images_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.Image": cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'Image') 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('Image', pipeline_response) @@ -106,7 +106,7 @@ async def begin_create_or_update( image_name: str, parameters: "models.Image", **kwargs - ) -> "models.Image": + ) -> AsyncLROPoller["models.Image"]: """Create or update an image. :param resource_group_name: The name of the resource group. @@ -121,8 +121,8 @@ async def begin_create_or_update( 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: Image, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.Image + :return: An instance of AsyncLROPoller that returns either Image or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.Image] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -173,10 +173,13 @@ async def _update_initial( **kwargs ) -> "models.Image": cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -194,14 +197,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ImageUpdate') 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 @@ -209,7 +210,6 @@ async def _update_initial( 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('Image', pipeline_response) @@ -228,7 +228,7 @@ async def begin_update( image_name: str, parameters: "models.ImageUpdate", **kwargs - ) -> "models.Image": + ) -> AsyncLROPoller["models.Image"]: """Update an image. :param resource_group_name: The name of the resource group. @@ -243,8 +243,8 @@ async def begin_update( 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: Image, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.Image + :return: An instance of AsyncLROPoller that returns either Image or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.Image] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -292,11 +292,14 @@ async def _delete_initial( resource_group_name: str, image_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -313,9 +316,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -339,7 +341,7 @@ async def begin_delete( resource_group_name: str, image_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Deletes an Image. :param resource_group_name: The name of the resource group. @@ -352,8 +354,8 @@ async def begin_delete( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -416,9 +418,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -437,9 +442,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -471,11 +475,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + 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 @@ -488,15 +499,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -528,7 +535,7 @@ def list( **kwargs ) -> AsyncIterable["models.ImageListResult"]: """Gets the list of Images in the subscription. Use nextLink property in the response to get the - next page of Images. Do this till nextLink is null to fetch all the Images. + next page of Images. Do this till nextLink is null to fetch all the Images. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ImageListResult or the result of cls(response) @@ -536,11 +543,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + 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 @@ -552,15 +566,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_log_analytics_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_log_analytics_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_log_analytics_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_log_analytics_operations.py index fe3b423b45af..af2f2f8af735 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_log_analytics_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_log_analytics_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -47,12 +47,15 @@ async def _export_request_rate_by_interval_initial( location: str, parameters: "models.RequestRateByIntervalInput", **kwargs - ) -> "models.LogAnalyticsOperationResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.LogAnalyticsOperationResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._export_request_rate_by_interval_initial.metadata['url'] # type: ignore @@ -69,14 +72,12 @@ async def _export_request_rate_by_interval_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RequestRateByIntervalInput') 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 @@ -99,9 +100,9 @@ async def begin_export_request_rate_by_interval( location: str, parameters: "models.RequestRateByIntervalInput", **kwargs - ) -> "models.LogAnalyticsOperationResult": + ) -> AsyncLROPoller["models.LogAnalyticsOperationResult"]: """Export logs that show Api requests made by this subscription in the given time window to show - throttling activities. + throttling activities. :param location: The location upon which virtual-machine-sizes is queried. :type location: str @@ -113,8 +114,8 @@ async def begin_export_request_rate_by_interval( 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: LogAnalyticsOperationResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.LogAnalyticsOperationResult + :return: An instance of AsyncLROPoller that returns either LogAnalyticsOperationResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.LogAnalyticsOperationResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -161,12 +162,15 @@ async def _export_throttled_requests_initial( location: str, parameters: "models.LogAnalyticsInputBase", **kwargs - ) -> "models.LogAnalyticsOperationResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.LogAnalyticsOperationResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._export_throttled_requests_initial.metadata['url'] # type: ignore @@ -183,14 +187,12 @@ async def _export_throttled_requests_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LogAnalyticsInputBase') 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 @@ -213,9 +215,9 @@ async def begin_export_throttled_requests( location: str, parameters: "models.LogAnalyticsInputBase", **kwargs - ) -> "models.LogAnalyticsOperationResult": + ) -> AsyncLROPoller["models.LogAnalyticsOperationResult"]: """Export logs that show total throttled Api requests for this subscription in the given time - window. + window. :param location: The location upon which virtual-machine-sizes is queried. :type location: str @@ -227,8 +229,8 @@ async def begin_export_throttled_requests( 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: LogAnalyticsOperationResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.LogAnalyticsOperationResult + :return: An instance of AsyncLROPoller that returns either LogAnalyticsOperationResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.LogAnalyticsOperationResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_operations.py similarity index 87% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_operations.py index 8c3163b5b60a..d3e47f367e9d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -53,11 +53,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeOperationListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + 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 @@ -65,15 +72,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_usage_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_usage_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_usage_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_usage_operations.py index 8ff843f6cd82..dc662d8d9c6a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_usage_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_usage_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -47,7 +47,7 @@ def list( **kwargs ) -> AsyncIterable["models.ListUsagesResult"]: """Gets, for the specified location, the current compute resource usage information as well as the - limits for compute resources under the subscription. + limits for compute resources under the subscription. :param location: The location for which resource usage is queried. :type location: str @@ -57,11 +57,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + 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 @@ -74,15 +81,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_virtual_machine_extension_images_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_extension_images_operations.py similarity index 92% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_virtual_machine_extension_images_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_extension_images_operations.py index 14840fc1ee81..ddd9a7c02415 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_virtual_machine_extension_images_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -64,9 +64,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -85,9 +88,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -122,9 +124,12 @@ async def list_types( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.list_types.metadata['url'] # type: ignore @@ -141,9 +146,8 @@ async def list_types( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -190,9 +194,12 @@ async def list_versions( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.list_versions.metadata['url'] # type: ignore @@ -216,9 +223,8 @@ async def list_versions( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_virtual_machine_extensions_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_extensions_operations.py similarity index 90% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_virtual_machine_extensions_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_extensions_operations.py index 504114b789da..6672480b9bfe 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_virtual_machine_extensions_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_extensions_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachineExtension": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -73,14 +76,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtension') 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 @@ -88,7 +89,6 @@ async def _create_or_update_initial( 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('VirtualMachineExtension', pipeline_response) @@ -108,18 +108,18 @@ async def begin_create_or_update( vm_extension_name: str, extension_parameters: "models.VirtualMachineExtension", **kwargs - ) -> "models.VirtualMachineExtension": + ) -> AsyncLROPoller["models.VirtualMachineExtension"]: """The operation to create or update the extension. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_name: The name of the virtual machine where the extension should be created or - updated. + updated. :type vm_name: str :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Create Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineExtension :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. @@ -127,8 +127,8 @@ async def begin_create_or_update( 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: VirtualMachineExtension, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineExtension + :return: An instance of AsyncLROPoller that returns either VirtualMachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -181,10 +181,13 @@ async def _update_initial( **kwargs ) -> "models.VirtualMachineExtension": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -203,14 +206,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtensionUpdate') 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 @@ -233,7 +234,7 @@ async def begin_update( vm_extension_name: str, extension_parameters: "models.VirtualMachineExtensionUpdate", **kwargs - ) -> "models.VirtualMachineExtension": + ) -> AsyncLROPoller["models.VirtualMachineExtension"]: """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -243,7 +244,7 @@ async def begin_update( :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Update Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineExtensionUpdate :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. @@ -251,8 +252,8 @@ async def begin_update( 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: VirtualMachineExtension, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineExtension + :return: An instance of AsyncLROPoller that returns either VirtualMachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -302,11 +303,14 @@ async def _delete_initial( vm_name: str, vm_extension_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -324,9 +328,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -351,7 +354,7 @@ async def begin_delete( vm_name: str, vm_extension_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -366,8 +369,8 @@ async def begin_delete( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -434,9 +437,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -456,9 +462,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_virtual_machine_images_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_images_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_virtual_machine_images_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_images_operations.py index 87c03098b7db..84f2585df617 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_virtual_machine_images_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_images_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -67,9 +67,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -89,9 +92,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -142,9 +144,12 @@ async def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -169,9 +174,8 @@ async def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -206,9 +210,12 @@ async def list_offers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.list_offers.metadata['url'] # type: ignore @@ -225,9 +232,8 @@ async def list_offers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -259,9 +265,12 @@ async def list_publishers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.list_publishers.metadata['url'] # type: ignore @@ -277,9 +286,8 @@ async def list_publishers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -317,9 +325,12 @@ async def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.list_skus.metadata['url'] # type: ignore @@ -337,9 +348,8 @@ async def list_skus( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_virtual_machine_run_commands_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_run_commands_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_virtual_machine_run_commands_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_run_commands_operations.py index 7b978c17f252..18c31db2efc7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_virtual_machine_run_commands_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,11 +56,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json, text/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 @@ -73,15 +80,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -126,9 +129,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandDocument"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json, text/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -145,9 +151,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_virtual_machine_scale_set_extensions_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py similarity index 90% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_virtual_machine_scale_set_extensions_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index eaaa2cc6a6bb..e9b7cca79d06 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_virtual_machine_scale_set_extensions_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,10 +52,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachineScaleSetExtension": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -74,14 +77,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineScaleSetExtension') 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 @@ -89,7 +90,6 @@ async def _create_or_update_initial( 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('VirtualMachineScaleSetExtension', pipeline_response) @@ -109,18 +109,18 @@ async def begin_create_or_update( vmss_extension_name: str, extension_parameters: "models.VirtualMachineScaleSetExtension", **kwargs - ) -> "models.VirtualMachineScaleSetExtension": + ) -> AsyncLROPoller["models.VirtualMachineScaleSetExtension"]: """The operation to create or update an extension. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_scale_set_name: The name of the VM scale set where the extension should be create or - updated. + updated. :type vm_scale_set_name: str :param vmss_extension_name: The name of the VM scale set extension. :type vmss_extension_name: str :param extension_parameters: Parameters supplied to the Create VM scale set Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetExtension :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. @@ -128,8 +128,8 @@ async def begin_create_or_update( 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: VirtualMachineScaleSetExtension, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetExtension + :return: An instance of AsyncLROPoller that returns either VirtualMachineScaleSetExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -179,11 +179,14 @@ async def _delete_initial( vm_scale_set_name: str, vmss_extension_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -201,9 +204,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -228,7 +230,7 @@ async def begin_delete( vm_scale_set_name: str, vmss_extension_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -243,8 +245,8 @@ async def begin_delete( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -311,9 +313,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -333,9 +338,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -370,11 +374,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtensionListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + 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 @@ -388,15 +399,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_virtual_machine_scale_set_rolling_upgrades_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_virtual_machine_scale_set_rolling_upgrades_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 8afc16f41943..68d208ab5727 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_virtual_machine_scale_set_rolling_upgrades_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -47,11 +47,14 @@ async def _cancel_initial( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._cancel_initial.metadata['url'] # type: ignore @@ -68,9 +71,8 @@ async def _cancel_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -94,7 +96,7 @@ async def begin_cancel( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Cancels the current virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -107,8 +109,8 @@ async def begin_cancel( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -155,11 +157,14 @@ async def _start_os_upgrade_initial( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._start_os_upgrade_initial.metadata['url'] # type: ignore @@ -176,9 +181,8 @@ async def _start_os_upgrade_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -202,10 +206,10 @@ async def begin_start_os_upgrade( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Starts a rolling upgrade to move all virtual machine scale set instances to the latest - available Platform Image OS version. Instances which are already running the latest available - OS version are not affected. + available Platform Image OS version. Instances which are already running the latest available + OS version are not affected. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -217,8 +221,8 @@ async def begin_start_os_upgrade( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -278,9 +282,12 @@ async def get_latest( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RollingUpgradeStatusInfo"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.get_latest.metadata['url'] # type: ignore @@ -297,9 +304,8 @@ async def get_latest( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_virtual_machine_scale_set_vms_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_vms_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_virtual_machine_scale_set_vms_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index 824775c1e4d5..ee7bb58211c6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_virtual_machine_scale_set_vms_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -49,11 +49,14 @@ async def _reimage_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._reimage_initial.metadata['url'] # type: ignore @@ -71,9 +74,8 @@ async def _reimage_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -98,7 +100,7 @@ async def begin_reimage( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -113,8 +115,8 @@ async def begin_reimage( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -163,11 +165,14 @@ async def _reimage_all_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._reimage_all_initial.metadata['url'] # type: ignore @@ -185,9 +190,8 @@ async def _reimage_all_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -212,9 +216,9 @@ async def begin_reimage_all( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. - This operation is only supported for managed disks. + This operation is only supported for managed disks. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -228,8 +232,8 @@ async def begin_reimage_all( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -278,11 +282,14 @@ async def _deallocate_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._deallocate_initial.metadata['url'] # type: ignore @@ -300,9 +307,8 @@ async def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -327,10 +333,10 @@ async def begin_deallocate( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and - releases the compute resources it uses. You are not billed for the compute resources of this - virtual machine once it is deallocated. + releases the compute resources it uses. You are not billed for the compute resources of this + virtual machine once it is deallocated. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -344,8 +350,8 @@ async def begin_deallocate( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -397,10 +403,13 @@ async def _update_initial( **kwargs ) -> "models.VirtualMachineScaleSetVM": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -419,14 +428,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSetVM') 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 @@ -434,7 +441,6 @@ async def _update_initial( 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('VirtualMachineScaleSetVM', pipeline_response) @@ -454,13 +460,13 @@ async def begin_update( instance_id: str, parameters: "models.VirtualMachineScaleSetVM", **kwargs - ) -> "models.VirtualMachineScaleSetVM": + ) -> AsyncLROPoller["models.VirtualMachineScaleSetVM"]: """Updates a virtual machine of a VM scale set. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_scale_set_name: The name of the VM scale set where the extension should be create or - updated. + updated. :type vm_scale_set_name: str :param instance_id: The instance ID of the virtual machine. :type instance_id: str @@ -472,8 +478,8 @@ async def begin_update( 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: VirtualMachineScaleSetVM, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetVM + :return: An instance of AsyncLROPoller that returns either VirtualMachineScaleSetVM or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetVM] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -523,11 +529,14 @@ async def _delete_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -545,9 +554,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -572,7 +580,7 @@ async def begin_delete( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Deletes a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -587,8 +595,8 @@ async def begin_delete( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -652,9 +660,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -672,9 +683,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -712,9 +722,12 @@ async def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -732,9 +745,8 @@ async def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -766,11 +778,14 @@ def list( :type resource_group_name: str :param virtual_machine_scale_set_name: The name of the VM scale set. :type virtual_machine_scale_set_name: str - :param filter: The filter to apply to the operation. + :param filter: The filter to apply to the operation. Allowed values are + 'startswith(instanceView/statuses/code, 'PowerState') eq true', 'properties/latestModelApplied + eq true', 'properties/latestModelApplied eq false'. :type filter: str - :param select: The list parameters. + :param select: The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. :type select: str - :param expand: The expand expression to apply to the operation. + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetVMListResult or the result of cls(response) @@ -778,11 +793,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + 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 @@ -802,15 +824,11 @@ def prepare_request(next_link=None): query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -843,11 +861,14 @@ async def _power_off_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._power_off_initial.metadata['url'] # type: ignore @@ -865,9 +886,8 @@ async def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -892,10 +912,10 @@ async def begin_power_off( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached - and you are getting charged for the resources. Instead, use deallocate to release resources and - avoid charges. + and you are getting charged for the resources. Instead, use deallocate to release resources and + avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -909,8 +929,8 @@ async def begin_power_off( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -959,11 +979,14 @@ async def _restart_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._restart_initial.metadata['url'] # type: ignore @@ -981,9 +1004,8 @@ async def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1008,7 +1030,7 @@ async def begin_restart( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Restarts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1023,8 +1045,8 @@ async def begin_restart( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1073,11 +1095,14 @@ async def _start_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._start_initial.metadata['url'] # type: ignore @@ -1095,9 +1120,8 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1122,7 +1146,7 @@ async def begin_start( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Starts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1137,8 +1161,8 @@ async def begin_start( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1187,11 +1211,14 @@ async def _redeploy_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._redeploy_initial.metadata['url'] # type: ignore @@ -1209,9 +1236,8 @@ async def _redeploy_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1236,9 +1262,9 @@ async def begin_redeploy( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and - powers it back on. + powers it back on. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1252,8 +1278,8 @@ async def begin_redeploy( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1302,11 +1328,14 @@ async def _perform_maintenance_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._perform_maintenance_initial.metadata['url'] # type: ignore @@ -1324,9 +1353,8 @@ async def _perform_maintenance_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1351,7 +1379,7 @@ async def begin_perform_maintenance( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Performs maintenance on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1366,8 +1394,8 @@ async def begin_perform_maintenance( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_virtual_machine_scale_sets_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_sets_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_virtual_machine_scale_sets_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_sets_operations.py index f51043c99c21..adcca08f9357 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_virtual_machine_scale_sets_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachineScaleSet": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSet') 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('VirtualMachineScaleSet', pipeline_response) @@ -106,7 +106,7 @@ async def begin_create_or_update( vm_scale_set_name: str, parameters: "models.VirtualMachineScaleSet", **kwargs - ) -> "models.VirtualMachineScaleSet": + ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -121,8 +121,8 @@ async def begin_create_or_update( 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: VirtualMachineScaleSet, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSet + :return: An instance of AsyncLROPoller that returns either VirtualMachineScaleSet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -173,10 +173,13 @@ async def _update_initial( **kwargs ) -> "models.VirtualMachineScaleSet": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -194,14 +197,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSetUpdate') 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 @@ -223,7 +224,7 @@ async def begin_update( vm_scale_set_name: str, parameters: "models.VirtualMachineScaleSetUpdate", **kwargs - ) -> "models.VirtualMachineScaleSet": + ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: """Update a VM scale set. :param resource_group_name: The name of the resource group. @@ -238,8 +239,8 @@ async def begin_update( 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: VirtualMachineScaleSet, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSet + :return: An instance of AsyncLROPoller that returns either VirtualMachineScaleSet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -287,11 +288,14 @@ async def _delete_initial( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -308,9 +312,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -334,7 +337,7 @@ async def begin_delete( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Deletes a VM scale set. :param resource_group_name: The name of the resource group. @@ -347,8 +350,8 @@ async def begin_delete( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -408,9 +411,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -427,9 +433,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -452,12 +457,15 @@ async def _deallocate_initial( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._deallocate_initial.metadata['url'] # type: ignore @@ -475,9 +483,8 @@ async def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -485,7 +492,6 @@ async def _deallocate_initial( body_content = None 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 @@ -509,10 +515,10 @@ async def begin_deallocate( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and - releases the compute resources. You are not billed for the compute resources that this virtual - machine scale set deallocates. + releases the compute resources. You are not billed for the compute resources that this virtual + machine scale set deallocates. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -526,8 +532,8 @@ async def begin_deallocate( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -576,12 +582,15 @@ async def _delete_instances_initial( vm_scale_set_name: str, vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._delete_instances_initial.metadata['url'] # type: ignore @@ -599,14 +608,12 @@ async def _delete_instances_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -630,7 +637,7 @@ async def begin_delete_instances( vm_scale_set_name: str, vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Deletes virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -645,8 +652,8 @@ async def begin_delete_instances( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -707,9 +714,12 @@ async def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -726,9 +736,8 @@ async def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -760,11 +769,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + 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 @@ -777,15 +793,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -817,8 +829,8 @@ def list_all( **kwargs ) -> AsyncIterable["models.VirtualMachineScaleSetListWithLinkResult"]: """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource - group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this - till nextLink is null to fetch all the VM Scale Sets. + group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this + till nextLink is null to fetch all the VM Scale Sets. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetListWithLinkResult or the result of cls(response) @@ -826,11 +838,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + 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_all.metadata['url'] # type: ignore @@ -842,15 +861,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -884,7 +899,7 @@ def list_skus( **kwargs ) -> AsyncIterable["models.VirtualMachineScaleSetListSkusResult"]: """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM - instances allowed for each SKU. + instances allowed for each SKU. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -896,11 +911,18 @@ def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + 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_skus.metadata['url'] # type: ignore @@ -914,15 +936,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -967,11 +985,18 @@ def get_os_upgrade_history( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListOSUpgradeHistory"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + 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.get_os_upgrade_history.metadata['url'] # type: ignore @@ -985,15 +1010,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1026,12 +1047,15 @@ async def _power_off_initial( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._power_off_initial.metadata['url'] # type: ignore @@ -1049,9 +1073,8 @@ async def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1059,7 +1082,6 @@ async def _power_off_initial( body_content = None 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 @@ -1083,10 +1105,10 @@ async def begin_power_off( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still - attached and you are getting charged for the resources. Instead, use deallocate to release - resources and avoid charges. + attached and you are getting charged for the resources. Instead, use deallocate to release + resources and avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1100,8 +1122,8 @@ async def begin_power_off( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1150,12 +1172,15 @@ async def _restart_initial( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._restart_initial.metadata['url'] # type: ignore @@ -1173,9 +1198,8 @@ async def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1183,7 +1207,6 @@ async def _restart_initial( body_content = None 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 @@ -1207,7 +1230,7 @@ async def begin_restart( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Restarts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1222,8 +1245,8 @@ async def begin_restart( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1272,12 +1295,15 @@ async def _start_initial( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._start_initial.metadata['url'] # type: ignore @@ -1295,9 +1321,8 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1305,7 +1330,6 @@ async def _start_initial( body_content = None 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 @@ -1329,7 +1353,7 @@ async def begin_start( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Starts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1344,8 +1368,8 @@ async def begin_start( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1394,12 +1418,15 @@ async def _redeploy_initial( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._redeploy_initial.metadata['url'] # type: ignore @@ -1417,9 +1444,8 @@ async def _redeploy_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1427,7 +1453,6 @@ async def _redeploy_initial( body_content = None 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 @@ -1451,9 +1476,9 @@ async def begin_redeploy( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, - and powers them back on. + and powers them back on. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1467,8 +1492,8 @@ async def begin_redeploy( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1517,12 +1542,15 @@ async def _perform_maintenance_initial( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._perform_maintenance_initial.metadata['url'] # type: ignore @@ -1540,9 +1568,8 @@ async def _perform_maintenance_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1550,7 +1577,6 @@ async def _perform_maintenance_initial( body_content = None 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 @@ -1574,11 +1600,11 @@ async def begin_perform_maintenance( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances - which are not eligible for perform maintenance will be failed. Please refer to best practices - for more details: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual- - machine-scale-sets-maintenance-notifications. + which are not eligible for perform maintenance will be failed. Please refer to best practices + for more details: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual- + machine-scale-sets-maintenance-notifications. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1592,8 +1618,8 @@ async def begin_perform_maintenance( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1642,12 +1668,15 @@ async def _update_instances_initial( vm_scale_set_name: str, vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_instances_initial.metadata['url'] # type: ignore @@ -1665,14 +1694,12 @@ async def _update_instances_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -1696,7 +1723,7 @@ async def begin_update_instances( vm_scale_set_name: str, vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. :param resource_group_name: The name of the resource group. @@ -1711,8 +1738,8 @@ async def begin_update_instances( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1761,12 +1788,15 @@ async def _reimage_initial( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._reimage_initial.metadata['url'] # type: ignore @@ -1784,9 +1814,8 @@ async def _reimage_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1794,7 +1823,6 @@ async def _reimage_initial( body_content = None 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 @@ -1818,7 +1846,7 @@ async def begin_reimage( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1833,8 +1861,8 @@ async def begin_reimage( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1883,12 +1911,15 @@ async def _reimage_all_initial( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._reimage_all_initial.metadata['url'] # type: ignore @@ -1906,9 +1937,8 @@ async def _reimage_all_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1916,7 +1946,6 @@ async def _reimage_all_initial( body_content = None 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 @@ -1940,9 +1969,9 @@ async def begin_reimage_all( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This - operation is only supported for managed disks. + operation is only supported for managed disks. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1956,8 +1985,8 @@ async def begin_reimage_all( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2023,9 +2052,12 @@ async def force_recovery_service_fabric_platform_update_domain_walk( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RecoveryWalkResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.force_recovery_service_fabric_platform_update_domain_walk.metadata['url'] # type: ignore @@ -2043,9 +2075,8 @@ async def force_recovery_service_fabric_platform_update_domain_walk( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_virtual_machine_sizes_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_sizes_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_virtual_machine_sizes_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_sizes_operations.py index 827db2839662..fba192be46c5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_virtual_machine_sizes_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_sizes_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,11 +56,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + 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 @@ -73,15 +80,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_virtual_machines_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machines_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_virtual_machines_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machines_operations.py index 456c3a22de99..4fe031ebdc97 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/_virtual_machines_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machines_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -64,9 +64,12 @@ async def get_extensions( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.get_extensions.metadata['url'] # type: ignore @@ -85,9 +88,8 @@ async def get_extensions( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -119,11 +121,18 @@ def list_by_location( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + 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_location.metadata['url'] # type: ignore @@ -136,15 +145,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -177,12 +182,15 @@ async def _capture_initial( vm_name: str, parameters: "models.VirtualMachineCaptureParameters", **kwargs - ) -> "models.VirtualMachineCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.VirtualMachineCaptureResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._capture_initial.metadata['url'] # type: ignore @@ -200,14 +208,12 @@ async def _capture_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineCaptureParameters') 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 @@ -231,9 +237,9 @@ async def begin_capture( vm_name: str, parameters: "models.VirtualMachineCaptureParameters", **kwargs - ) -> "models.VirtualMachineCaptureResult": + ) -> AsyncLROPoller["models.VirtualMachineCaptureResult"]: """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used - to create similar VMs. + to create similar VMs. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -247,8 +253,8 @@ async def begin_capture( 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: VirtualMachineCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineCaptureResult + :return: An instance of AsyncLROPoller that returns either VirtualMachineCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineCaptureResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -299,10 +305,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachine": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -320,14 +329,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachine') 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 @@ -335,7 +342,6 @@ async def _create_or_update_initial( 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('VirtualMachine', pipeline_response) @@ -354,7 +360,7 @@ async def begin_create_or_update( vm_name: str, parameters: "models.VirtualMachine", **kwargs - ) -> "models.VirtualMachine": + ) -> AsyncLROPoller["models.VirtualMachine"]: """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -369,8 +375,8 @@ async def begin_create_or_update( 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: VirtualMachine, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachine + :return: An instance of AsyncLROPoller that returns either VirtualMachine or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.VirtualMachine] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -421,10 +427,13 @@ async def _update_initial( **kwargs ) -> "models.VirtualMachine": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -442,14 +451,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineUpdate') 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 @@ -457,7 +464,6 @@ async def _update_initial( 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('VirtualMachine', pipeline_response) @@ -476,7 +482,7 @@ async def begin_update( vm_name: str, parameters: "models.VirtualMachineUpdate", **kwargs - ) -> "models.VirtualMachine": + ) -> AsyncLROPoller["models.VirtualMachine"]: """The operation to update a virtual machine. :param resource_group_name: The name of the resource group. @@ -491,8 +497,8 @@ async def begin_update( 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: VirtualMachine, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachine + :return: An instance of AsyncLROPoller that returns either VirtualMachine or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.VirtualMachine] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -540,11 +546,14 @@ async def _delete_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -561,9 +570,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -587,7 +595,7 @@ async def begin_delete( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """The operation to delete a virtual machine. :param resource_group_name: The name of the resource group. @@ -600,8 +608,8 @@ async def begin_delete( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -664,9 +672,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -685,9 +696,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -722,9 +732,12 @@ async def instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.instance_view.metadata['url'] # type: ignore @@ -741,9 +754,8 @@ async def instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -765,11 +777,14 @@ async def _convert_to_managed_disks_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._convert_to_managed_disks_initial.metadata['url'] # type: ignore @@ -786,9 +801,8 @@ async def _convert_to_managed_disks_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -812,9 +826,9 @@ async def begin_convert_to_managed_disks( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop- - deallocated before invoking this operation. + deallocated before invoking this operation. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -826,8 +840,8 @@ async def begin_convert_to_managed_disks( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -874,11 +888,14 @@ async def _deallocate_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._deallocate_initial.metadata['url'] # type: ignore @@ -895,9 +912,8 @@ async def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -921,9 +937,9 @@ async def begin_deallocate( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Shuts down the virtual machine and releases the compute resources. You are not billed for the - compute resources that this virtual machine uses. + compute resources that this virtual machine uses. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -935,8 +951,8 @@ async def begin_deallocate( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -996,9 +1012,12 @@ async def generalize( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.generalize.metadata['url'] # type: ignore @@ -1015,9 +1034,8 @@ async def generalize( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1040,7 +1058,7 @@ def list( **kwargs ) -> AsyncIterable["models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified resource group. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1050,11 +1068,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + 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 @@ -1067,15 +1092,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1107,7 +1128,7 @@ def list_all( **kwargs ) -> AsyncIterable["models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified subscription. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineListResult or the result of cls(response) @@ -1115,11 +1136,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + 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_all.metadata['url'] # type: ignore @@ -1131,15 +1159,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1173,7 +1197,7 @@ def list_available_sizes( **kwargs ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes to which the specified virtual machine can be - resized. + resized. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1185,11 +1209,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + 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_available_sizes.metadata['url'] # type: ignore @@ -1203,15 +1234,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1243,11 +1270,14 @@ async def _power_off_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._power_off_initial.metadata['url'] # type: ignore @@ -1264,9 +1294,8 @@ async def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1290,9 +1319,9 @@ async def begin_power_off( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with - the same provisioned resources. You are still charged for this virtual machine. + the same provisioned resources. You are still charged for this virtual machine. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1304,8 +1333,8 @@ async def begin_power_off( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1352,11 +1381,14 @@ async def _restart_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._restart_initial.metadata['url'] # type: ignore @@ -1373,9 +1405,8 @@ async def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1399,7 +1430,7 @@ async def begin_restart( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """The operation to restart a virtual machine. :param resource_group_name: The name of the resource group. @@ -1412,8 +1443,8 @@ async def begin_restart( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1460,11 +1491,14 @@ async def _start_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._start_initial.metadata['url'] # type: ignore @@ -1481,9 +1515,8 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1507,7 +1540,7 @@ async def begin_start( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """The operation to start a virtual machine. :param resource_group_name: The name of the resource group. @@ -1520,8 +1553,8 @@ async def begin_start( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1568,11 +1601,14 @@ async def _redeploy_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._redeploy_initial.metadata['url'] # type: ignore @@ -1589,9 +1625,8 @@ async def _redeploy_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1615,7 +1650,7 @@ async def begin_redeploy( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """Shuts down the virtual machine, moves it to a new node, and powers it back on. :param resource_group_name: The name of the resource group. @@ -1628,8 +1663,8 @@ async def begin_redeploy( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1676,11 +1711,14 @@ async def _perform_maintenance_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._perform_maintenance_initial.metadata['url'] # type: ignore @@ -1697,9 +1735,8 @@ async def _perform_maintenance_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1723,7 +1760,7 @@ async def begin_perform_maintenance( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> AsyncLROPoller["models.OperationStatusResponse"]: """The operation to perform maintenance on a virtual machine. :param resource_group_name: The name of the resource group. @@ -1736,8 +1773,8 @@ async def begin_perform_maintenance( 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: OperationStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse + :return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1785,12 +1822,15 @@ async def _run_command_initial( vm_name: str, parameters: "models.RunCommandInput", **kwargs - ) -> "models.RunCommandResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.RunCommandResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" # Construct URL url = self._run_command_initial.metadata['url'] # type: ignore @@ -1808,14 +1848,12 @@ async def _run_command_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RunCommandInput') 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 @@ -1839,7 +1877,7 @@ async def begin_run_command( vm_name: str, parameters: "models.RunCommandInput", **kwargs - ) -> "models.RunCommandResult": + ) -> AsyncLROPoller["models.RunCommandResult"]: """Run command on the VM. :param resource_group_name: The name of the resource group. @@ -1854,8 +1892,8 @@ async def begin_run_command( 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: RunCommandResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2017_12_01.models.RunCommandResult + :return: An instance of AsyncLROPoller that returns either RunCommandResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2017_12_01.models.RunCommandResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/__init__.py deleted file mode 100644 index 2b1d1ed01c19..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations_async/__init__.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 ._operations_async import Operations -from ._availability_sets_operations_async import AvailabilitySetsOperations -from ._virtual_machine_extension_images_operations_async import VirtualMachineExtensionImagesOperations -from ._virtual_machine_extensions_operations_async import VirtualMachineExtensionsOperations -from ._virtual_machines_operations_async import VirtualMachinesOperations -from ._virtual_machine_images_operations_async import VirtualMachineImagesOperations -from ._usage_operations_async import UsageOperations -from ._virtual_machine_sizes_operations_async import VirtualMachineSizesOperations -from ._images_operations_async import ImagesOperations -from ._virtual_machine_scale_sets_operations_async import VirtualMachineScaleSetsOperations -from ._virtual_machine_scale_set_extensions_operations_async import VirtualMachineScaleSetExtensionsOperations -from ._virtual_machine_scale_set_rolling_upgrades_operations_async import VirtualMachineScaleSetRollingUpgradesOperations -from ._virtual_machine_scale_set_vms_operations_async import VirtualMachineScaleSetVMsOperations -from ._log_analytics_operations_async import LogAnalyticsOperations -from ._virtual_machine_run_commands_operations_async import VirtualMachineRunCommandsOperations - -__all__ = [ - 'Operations', - 'AvailabilitySetsOperations', - 'VirtualMachineExtensionImagesOperations', - 'VirtualMachineExtensionsOperations', - 'VirtualMachinesOperations', - 'VirtualMachineImagesOperations', - 'UsageOperations', - 'VirtualMachineSizesOperations', - 'ImagesOperations', - 'VirtualMachineScaleSetsOperations', - 'VirtualMachineScaleSetExtensionsOperations', - 'VirtualMachineScaleSetRollingUpgradesOperations', - 'VirtualMachineScaleSetVMsOperations', - 'LogAnalyticsOperations', - 'VirtualMachineRunCommandsOperations', -] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/_compute_management_client_enums.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/_compute_management_client_enums.py index 9b962cc3bd22..c8be275fd9ff 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/_compute_management_client_enums.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/_compute_management_client_enums.py @@ -6,20 +6,38 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum - -class CachingTypes(str, Enum): +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class CachingTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the caching requirements. :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **None** :code:`
`:code:`
` **ReadOnly** :code:`
`:code:`
` **ReadWrite** :code:`
`:code:`
` Default: **None for Standard storage. ReadOnly for Premium storage** """ - none = "None" - read_only = "ReadOnly" - read_write = "ReadWrite" + NONE = "None" + READ_ONLY = "ReadOnly" + READ_WRITE = "ReadWrite" -class DiskCreateOptionTypes(str, Enum): +class DiskCreateOptionTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies how the virtual machine should be created.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` **Attach** \u2013 This value is used when you are using a specialized disk to create the virtual machine.:code:`
`:code:`
` **FromImage** \u2013 @@ -28,112 +46,112 @@ class DiskCreateOptionTypes(str, Enum): marketplace image, you also use the plan element previously described. """ - from_image = "FromImage" - empty = "Empty" - attach = "Attach" + FROM_IMAGE = "FromImage" + EMPTY = "Empty" + ATTACH = "Attach" -class IntervalInMins(str, Enum): +class IntervalInMins(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Interval value in minutes used to create LogAnalytics call rate logs. """ - three_mins = "ThreeMins" - five_mins = "FiveMins" - thirty_mins = "ThirtyMins" - sixty_mins = "SixtyMins" + THREE_MINS = "ThreeMins" + FIVE_MINS = "FiveMins" + THIRTY_MINS = "ThirtyMins" + SIXTY_MINS = "SixtyMins" -class IPVersion(str, Enum): +class IPVersion(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. """ - i_pv4 = "IPv4" - i_pv6 = "IPv6" + I_PV4 = "IPv4" + I_PV6 = "IPv6" -class MaintenanceOperationResultCodeTypes(str, Enum): +class MaintenanceOperationResultCodeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The Last Maintenance Operation Result Code. """ - none = "None" - retry_later = "RetryLater" - maintenance_aborted = "MaintenanceAborted" - maintenance_completed = "MaintenanceCompleted" + NONE = "None" + RETRY_LATER = "RetryLater" + MAINTENANCE_ABORTED = "MaintenanceAborted" + MAINTENANCE_COMPLETED = "MaintenanceCompleted" -class OperatingSystemStateTypes(str, Enum): +class OperatingSystemStateTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The OS State. """ - generalized = "Generalized" - specialized = "Specialized" + GENERALIZED = "Generalized" + SPECIALIZED = "Specialized" -class OperatingSystemTypes(str, Enum): +class OperatingSystemTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The operating system of the osDiskImage. """ - windows = "Windows" - linux = "Linux" + WINDOWS = "Windows" + LINUX = "Linux" -class ProtocolTypes(str, Enum): +class ProtocolTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the protocol of listener. :code:`
`:code:`
` Possible values are: :code:`
`\ **http** :code:`
`:code:`
` **https** """ - http = "Http" - https = "Https" + HTTP = "Http" + HTTPS = "Https" -class ResourceIdentityType(str, Enum): +class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The type of identity used for the virtual machine. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine. """ - system_assigned = "SystemAssigned" - user_assigned = "UserAssigned" - system_assigned_user_assigned = "SystemAssigned, UserAssigned" - none = "None" + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned, UserAssigned" + NONE = "None" -class RollingUpgradeActionType(str, Enum): +class RollingUpgradeActionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The last action performed on the rolling upgrade. """ - start = "Start" - cancel = "Cancel" + START = "Start" + CANCEL = "Cancel" -class RollingUpgradeStatusCode(str, Enum): +class RollingUpgradeStatusCode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Code indicating the current status of the upgrade. """ - rolling_forward = "RollingForward" - cancelled = "Cancelled" - completed = "Completed" - faulted = "Faulted" + ROLLING_FORWARD = "RollingForward" + CANCELLED = "Cancelled" + COMPLETED = "Completed" + FAULTED = "Faulted" -class SettingNames(str, Enum): +class SettingNames(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon. """ - auto_logon = "AutoLogon" - first_logon_commands = "FirstLogonCommands" + AUTO_LOGON = "AutoLogon" + FIRST_LOGON_COMMANDS = "FirstLogonCommands" -class StatusLevelTypes(str, Enum): +class StatusLevelTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The level code. """ - info = "Info" - warning = "Warning" - error = "Error" + INFO = "Info" + WARNING = "Warning" + ERROR = "Error" -class StorageAccountTypes(str, Enum): +class StorageAccountTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the storage account type for the managed disk. Possible values are: Standard_LRS or Premium_LRS. NOTE: Managed OS disk storage account type can only be set when you create the scale set. """ - standard_lrs = "Standard_LRS" - premium_lrs = "Premium_LRS" + STANDARD_LRS = "Standard_LRS" + PREMIUM_LRS = "Premium_LRS" -class UpgradeMode(str, Enum): +class UpgradeMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the mode of an upgrade to virtual machines in the scale set.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` **Manual** - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade @@ -141,51 +159,51 @@ class UpgradeMode(str, Enum): automatically updated at the same time. """ - automatic = "Automatic" - manual = "Manual" - rolling = "Rolling" + AUTOMATIC = "Automatic" + MANUAL = "Manual" + ROLLING = "Rolling" -class UpgradeOperationInvoker(str, Enum): +class UpgradeOperationInvoker(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Invoker of the Upgrade Operation """ - unknown = "Unknown" - user = "User" - platform = "Platform" + UNKNOWN = "Unknown" + USER = "User" + PLATFORM = "Platform" -class UpgradeState(str, Enum): +class UpgradeState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Code indicating the current status of the upgrade. """ - rolling_forward = "RollingForward" - cancelled = "Cancelled" - completed = "Completed" - faulted = "Faulted" + ROLLING_FORWARD = "RollingForward" + CANCELLED = "Cancelled" + COMPLETED = "Completed" + FAULTED = "Faulted" -class VirtualMachineEvictionPolicyTypes(str, Enum): +class VirtualMachineEvictionPolicyTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the eviction policy for virtual machines in a low priority scale set. :code:`
`:code:`
`Minimum api-version: 2017-10-30-preview """ - deallocate = "Deallocate" - delete = "Delete" + DEALLOCATE = "Deallocate" + DELETE = "Delete" -class VirtualMachinePriorityTypes(str, Enum): +class VirtualMachinePriorityTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the priority for the virtual machines in the scale set. :code:`
`:code:`
`Minimum api-version: 2017-10-30-preview """ - regular = "Regular" - low = "Low" + REGULAR = "Regular" + LOW = "Low" -class VirtualMachineScaleSetSkuScaleType(str, Enum): +class VirtualMachineScaleSetSkuScaleType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The scale type applicable to the sku. """ - automatic = "Automatic" - none = "None" + AUTOMATIC = "Automatic" + NONE = "None" -class VirtualMachineSizeTypes(str, Enum): +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 `_. @@ -199,169 +217,169 @@ class VirtualMachineSizeTypes(str, Enum): `_ """ - basic_a0 = "Basic_A0" - basic_a1 = "Basic_A1" - basic_a2 = "Basic_A2" - basic_a3 = "Basic_A3" - basic_a4 = "Basic_A4" - standard_a0 = "Standard_A0" - standard_a1 = "Standard_A1" - standard_a2 = "Standard_A2" - standard_a3 = "Standard_A3" - standard_a4 = "Standard_A4" - standard_a5 = "Standard_A5" - standard_a6 = "Standard_A6" - standard_a7 = "Standard_A7" - standard_a8 = "Standard_A8" - standard_a9 = "Standard_A9" - standard_a10 = "Standard_A10" - standard_a11 = "Standard_A11" - standard_a1_v2 = "Standard_A1_v2" - standard_a2_v2 = "Standard_A2_v2" - standard_a4_v2 = "Standard_A4_v2" - standard_a8_v2 = "Standard_A8_v2" - standard_a2_m_v2 = "Standard_A2m_v2" - standard_a4_m_v2 = "Standard_A4m_v2" - standard_a8_m_v2 = "Standard_A8m_v2" - standard_b1_s = "Standard_B1s" - standard_b1_ms = "Standard_B1ms" - standard_b2_s = "Standard_B2s" - standard_b2_ms = "Standard_B2ms" - standard_b4_ms = "Standard_B4ms" - standard_b8_ms = "Standard_B8ms" - standard_d1 = "Standard_D1" - standard_d2 = "Standard_D2" - standard_d3 = "Standard_D3" - standard_d4 = "Standard_D4" - standard_d11 = "Standard_D11" - standard_d12 = "Standard_D12" - standard_d13 = "Standard_D13" - standard_d14 = "Standard_D14" - standard_d1_v2 = "Standard_D1_v2" - standard_d2_v2 = "Standard_D2_v2" - standard_d3_v2 = "Standard_D3_v2" - standard_d4_v2 = "Standard_D4_v2" - standard_d5_v2 = "Standard_D5_v2" - standard_d2_v3 = "Standard_D2_v3" - standard_d4_v3 = "Standard_D4_v3" - standard_d8_v3 = "Standard_D8_v3" - standard_d16_v3 = "Standard_D16_v3" - standard_d32_v3 = "Standard_D32_v3" - standard_d64_v3 = "Standard_D64_v3" - standard_d2_s_v3 = "Standard_D2s_v3" - standard_d4_s_v3 = "Standard_D4s_v3" - standard_d8_s_v3 = "Standard_D8s_v3" - standard_d16_s_v3 = "Standard_D16s_v3" - standard_d32_s_v3 = "Standard_D32s_v3" - standard_d64_s_v3 = "Standard_D64s_v3" - standard_d11_v2 = "Standard_D11_v2" - standard_d12_v2 = "Standard_D12_v2" - standard_d13_v2 = "Standard_D13_v2" - standard_d14_v2 = "Standard_D14_v2" - standard_d15_v2 = "Standard_D15_v2" - standard_ds1 = "Standard_DS1" - standard_ds2 = "Standard_DS2" - standard_ds3 = "Standard_DS3" - standard_ds4 = "Standard_DS4" - standard_ds11 = "Standard_DS11" - standard_ds12 = "Standard_DS12" - standard_ds13 = "Standard_DS13" - standard_ds14 = "Standard_DS14" - standard_ds1_v2 = "Standard_DS1_v2" - standard_ds2_v2 = "Standard_DS2_v2" - standard_ds3_v2 = "Standard_DS3_v2" - standard_ds4_v2 = "Standard_DS4_v2" - standard_ds5_v2 = "Standard_DS5_v2" - standard_ds11_v2 = "Standard_DS11_v2" - standard_ds12_v2 = "Standard_DS12_v2" - standard_ds13_v2 = "Standard_DS13_v2" - standard_ds14_v2 = "Standard_DS14_v2" - standard_ds15_v2 = "Standard_DS15_v2" - standard_ds13_4_v2 = "Standard_DS13-4_v2" - standard_ds13_2_v2 = "Standard_DS13-2_v2" - standard_ds14_8_v2 = "Standard_DS14-8_v2" - standard_ds14_4_v2 = "Standard_DS14-4_v2" - standard_e2_v3 = "Standard_E2_v3" - standard_e4_v3 = "Standard_E4_v3" - standard_e8_v3 = "Standard_E8_v3" - standard_e16_v3 = "Standard_E16_v3" - standard_e32_v3 = "Standard_E32_v3" - standard_e64_v3 = "Standard_E64_v3" - standard_e2_s_v3 = "Standard_E2s_v3" - standard_e4_s_v3 = "Standard_E4s_v3" - standard_e8_s_v3 = "Standard_E8s_v3" - standard_e16_s_v3 = "Standard_E16s_v3" - standard_e32_s_v3 = "Standard_E32s_v3" - standard_e64_s_v3 = "Standard_E64s_v3" - standard_e32_16_v3 = "Standard_E32-16_v3" - standard_e32_8_s_v3 = "Standard_E32-8s_v3" - standard_e64_32_s_v3 = "Standard_E64-32s_v3" - standard_e64_16_s_v3 = "Standard_E64-16s_v3" - standard_f1 = "Standard_F1" - standard_f2 = "Standard_F2" - standard_f4 = "Standard_F4" - standard_f8 = "Standard_F8" - standard_f16 = "Standard_F16" - standard_f1_s = "Standard_F1s" - standard_f2_s = "Standard_F2s" - standard_f4_s = "Standard_F4s" - standard_f8_s = "Standard_F8s" - standard_f16_s = "Standard_F16s" - standard_f2_s_v2 = "Standard_F2s_v2" - standard_f4_s_v2 = "Standard_F4s_v2" - standard_f8_s_v2 = "Standard_F8s_v2" - standard_f16_s_v2 = "Standard_F16s_v2" - standard_f32_s_v2 = "Standard_F32s_v2" - standard_f64_s_v2 = "Standard_F64s_v2" - standard_f72_s_v2 = "Standard_F72s_v2" - standard_g1 = "Standard_G1" - standard_g2 = "Standard_G2" - standard_g3 = "Standard_G3" - standard_g4 = "Standard_G4" - standard_g5 = "Standard_G5" - standard_gs1 = "Standard_GS1" - standard_gs2 = "Standard_GS2" - standard_gs3 = "Standard_GS3" - standard_gs4 = "Standard_GS4" - standard_gs5 = "Standard_GS5" - standard_gs4_8 = "Standard_GS4-8" - standard_gs4_4 = "Standard_GS4-4" - standard_gs5_16 = "Standard_GS5-16" - standard_gs5_8 = "Standard_GS5-8" - standard_h8 = "Standard_H8" - standard_h16 = "Standard_H16" - standard_h8_m = "Standard_H8m" - standard_h16_m = "Standard_H16m" - standard_h16_r = "Standard_H16r" - standard_h16_mr = "Standard_H16mr" - standard_l4_s = "Standard_L4s" - standard_l8_s = "Standard_L8s" - standard_l16_s = "Standard_L16s" - standard_l32_s = "Standard_L32s" - standard_m64_s = "Standard_M64s" - standard_m64_ms = "Standard_M64ms" - standard_m128_s = "Standard_M128s" - standard_m128_ms = "Standard_M128ms" - standard_m64_32_ms = "Standard_M64-32ms" - standard_m64_16_ms = "Standard_M64-16ms" - standard_m128_64_ms = "Standard_M128-64ms" - standard_m128_32_ms = "Standard_M128-32ms" - standard_nc6 = "Standard_NC6" - standard_nc12 = "Standard_NC12" - standard_nc24 = "Standard_NC24" - standard_nc24_r = "Standard_NC24r" - standard_nc6_s_v2 = "Standard_NC6s_v2" - standard_nc12_s_v2 = "Standard_NC12s_v2" - standard_nc24_s_v2 = "Standard_NC24s_v2" - standard_nc24_rs_v2 = "Standard_NC24rs_v2" - standard_nc6_s_v3 = "Standard_NC6s_v3" - standard_nc12_s_v3 = "Standard_NC12s_v3" - standard_nc24_s_v3 = "Standard_NC24s_v3" - standard_nc24_rs_v3 = "Standard_NC24rs_v3" - standard_nd6_s = "Standard_ND6s" - standard_nd12_s = "Standard_ND12s" - standard_nd24_s = "Standard_ND24s" - standard_nd24_rs = "Standard_ND24rs" - standard_nv6 = "Standard_NV6" - standard_nv12 = "Standard_NV12" - standard_nv24 = "Standard_NV24" + BASIC_A0 = "Basic_A0" + BASIC_A1 = "Basic_A1" + BASIC_A2 = "Basic_A2" + BASIC_A3 = "Basic_A3" + BASIC_A4 = "Basic_A4" + STANDARD_A0 = "Standard_A0" + STANDARD_A1 = "Standard_A1" + STANDARD_A2 = "Standard_A2" + STANDARD_A3 = "Standard_A3" + STANDARD_A4 = "Standard_A4" + STANDARD_A5 = "Standard_A5" + STANDARD_A6 = "Standard_A6" + STANDARD_A7 = "Standard_A7" + STANDARD_A8 = "Standard_A8" + STANDARD_A9 = "Standard_A9" + STANDARD_A10 = "Standard_A10" + STANDARD_A11 = "Standard_A11" + STANDARD_A1_V2 = "Standard_A1_v2" + STANDARD_A2_V2 = "Standard_A2_v2" + STANDARD_A4_V2 = "Standard_A4_v2" + STANDARD_A8_V2 = "Standard_A8_v2" + STANDARD_A2_M_V2 = "Standard_A2m_v2" + STANDARD_A4_M_V2 = "Standard_A4m_v2" + STANDARD_A8_M_V2 = "Standard_A8m_v2" + STANDARD_B1_S = "Standard_B1s" + STANDARD_B1_MS = "Standard_B1ms" + STANDARD_B2_S = "Standard_B2s" + STANDARD_B2_MS = "Standard_B2ms" + STANDARD_B4_MS = "Standard_B4ms" + STANDARD_B8_MS = "Standard_B8ms" + STANDARD_D1 = "Standard_D1" + STANDARD_D2 = "Standard_D2" + STANDARD_D3 = "Standard_D3" + STANDARD_D4 = "Standard_D4" + STANDARD_D11 = "Standard_D11" + STANDARD_D12 = "Standard_D12" + STANDARD_D13 = "Standard_D13" + STANDARD_D14 = "Standard_D14" + STANDARD_D1_V2 = "Standard_D1_v2" + STANDARD_D2_V2 = "Standard_D2_v2" + STANDARD_D3_V2 = "Standard_D3_v2" + STANDARD_D4_V2 = "Standard_D4_v2" + STANDARD_D5_V2 = "Standard_D5_v2" + STANDARD_D2_V3 = "Standard_D2_v3" + STANDARD_D4_V3 = "Standard_D4_v3" + STANDARD_D8_V3 = "Standard_D8_v3" + STANDARD_D16_V3 = "Standard_D16_v3" + STANDARD_D32_V3 = "Standard_D32_v3" + STANDARD_D64_V3 = "Standard_D64_v3" + STANDARD_D2_S_V3 = "Standard_D2s_v3" + STANDARD_D4_S_V3 = "Standard_D4s_v3" + STANDARD_D8_S_V3 = "Standard_D8s_v3" + STANDARD_D16_S_V3 = "Standard_D16s_v3" + STANDARD_D32_S_V3 = "Standard_D32s_v3" + STANDARD_D64_S_V3 = "Standard_D64s_v3" + STANDARD_D11_V2 = "Standard_D11_v2" + STANDARD_D12_V2 = "Standard_D12_v2" + STANDARD_D13_V2 = "Standard_D13_v2" + STANDARD_D14_V2 = "Standard_D14_v2" + STANDARD_D15_V2 = "Standard_D15_v2" + STANDARD_DS1 = "Standard_DS1" + STANDARD_DS2 = "Standard_DS2" + STANDARD_DS3 = "Standard_DS3" + STANDARD_DS4 = "Standard_DS4" + STANDARD_DS11 = "Standard_DS11" + STANDARD_DS12 = "Standard_DS12" + STANDARD_DS13 = "Standard_DS13" + STANDARD_DS14 = "Standard_DS14" + STANDARD_DS1_V2 = "Standard_DS1_v2" + STANDARD_DS2_V2 = "Standard_DS2_v2" + STANDARD_DS3_V2 = "Standard_DS3_v2" + STANDARD_DS4_V2 = "Standard_DS4_v2" + STANDARD_DS5_V2 = "Standard_DS5_v2" + STANDARD_DS11_V2 = "Standard_DS11_v2" + STANDARD_DS12_V2 = "Standard_DS12_v2" + STANDARD_DS13_V2 = "Standard_DS13_v2" + STANDARD_DS14_V2 = "Standard_DS14_v2" + STANDARD_DS15_V2 = "Standard_DS15_v2" + STANDARD_DS13_4_V2 = "Standard_DS13-4_v2" + STANDARD_DS13_2_V2 = "Standard_DS13-2_v2" + STANDARD_DS14_8_V2 = "Standard_DS14-8_v2" + STANDARD_DS14_4_V2 = "Standard_DS14-4_v2" + STANDARD_E2_V3 = "Standard_E2_v3" + STANDARD_E4_V3 = "Standard_E4_v3" + STANDARD_E8_V3 = "Standard_E8_v3" + STANDARD_E16_V3 = "Standard_E16_v3" + STANDARD_E32_V3 = "Standard_E32_v3" + STANDARD_E64_V3 = "Standard_E64_v3" + STANDARD_E2_S_V3 = "Standard_E2s_v3" + STANDARD_E4_S_V3 = "Standard_E4s_v3" + STANDARD_E8_S_V3 = "Standard_E8s_v3" + STANDARD_E16_S_V3 = "Standard_E16s_v3" + STANDARD_E32_S_V3 = "Standard_E32s_v3" + STANDARD_E64_S_V3 = "Standard_E64s_v3" + STANDARD_E32_16_V3 = "Standard_E32-16_v3" + STANDARD_E32_8_S_V3 = "Standard_E32-8s_v3" + STANDARD_E64_32_S_V3 = "Standard_E64-32s_v3" + STANDARD_E64_16_S_V3 = "Standard_E64-16s_v3" + STANDARD_F1 = "Standard_F1" + STANDARD_F2 = "Standard_F2" + STANDARD_F4 = "Standard_F4" + STANDARD_F8 = "Standard_F8" + STANDARD_F16 = "Standard_F16" + STANDARD_F1_S = "Standard_F1s" + STANDARD_F2_S = "Standard_F2s" + STANDARD_F4_S = "Standard_F4s" + STANDARD_F8_S = "Standard_F8s" + STANDARD_F16_S = "Standard_F16s" + STANDARD_F2_S_V2 = "Standard_F2s_v2" + STANDARD_F4_S_V2 = "Standard_F4s_v2" + STANDARD_F8_S_V2 = "Standard_F8s_v2" + STANDARD_F16_S_V2 = "Standard_F16s_v2" + STANDARD_F32_S_V2 = "Standard_F32s_v2" + STANDARD_F64_S_V2 = "Standard_F64s_v2" + STANDARD_F72_S_V2 = "Standard_F72s_v2" + STANDARD_G1 = "Standard_G1" + STANDARD_G2 = "Standard_G2" + STANDARD_G3 = "Standard_G3" + STANDARD_G4 = "Standard_G4" + STANDARD_G5 = "Standard_G5" + STANDARD_GS1 = "Standard_GS1" + STANDARD_GS2 = "Standard_GS2" + STANDARD_GS3 = "Standard_GS3" + STANDARD_GS4 = "Standard_GS4" + STANDARD_GS5 = "Standard_GS5" + STANDARD_GS4_8 = "Standard_GS4-8" + STANDARD_GS4_4 = "Standard_GS4-4" + STANDARD_GS5_16 = "Standard_GS5-16" + STANDARD_GS5_8 = "Standard_GS5-8" + STANDARD_H8 = "Standard_H8" + STANDARD_H16 = "Standard_H16" + STANDARD_H8_M = "Standard_H8m" + STANDARD_H16_M = "Standard_H16m" + STANDARD_H16_R = "Standard_H16r" + STANDARD_H16_MR = "Standard_H16mr" + STANDARD_L4_S = "Standard_L4s" + STANDARD_L8_S = "Standard_L8s" + STANDARD_L16_S = "Standard_L16s" + STANDARD_L32_S = "Standard_L32s" + STANDARD_M64_S = "Standard_M64s" + STANDARD_M64_MS = "Standard_M64ms" + STANDARD_M128_S = "Standard_M128s" + STANDARD_M128_MS = "Standard_M128ms" + STANDARD_M64_32_MS = "Standard_M64-32ms" + STANDARD_M64_16_MS = "Standard_M64-16ms" + STANDARD_M128_64_MS = "Standard_M128-64ms" + STANDARD_M128_32_MS = "Standard_M128-32ms" + STANDARD_NC6 = "Standard_NC6" + STANDARD_NC12 = "Standard_NC12" + STANDARD_NC24 = "Standard_NC24" + STANDARD_NC24_R = "Standard_NC24r" + STANDARD_NC6_S_V2 = "Standard_NC6s_v2" + STANDARD_NC12_S_V2 = "Standard_NC12s_v2" + STANDARD_NC24_S_V2 = "Standard_NC24s_v2" + STANDARD_NC24_RS_V2 = "Standard_NC24rs_v2" + STANDARD_NC6_S_V3 = "Standard_NC6s_v3" + STANDARD_NC12_S_V3 = "Standard_NC12s_v3" + STANDARD_NC24_S_V3 = "Standard_NC24s_v3" + STANDARD_NC24_RS_V3 = "Standard_NC24rs_v3" + STANDARD_ND6_S = "Standard_ND6s" + STANDARD_ND12_S = "Standard_ND12s" + STANDARD_ND24_S = "Standard_ND24s" + STANDARD_ND24_RS = "Standard_ND24rs" + STANDARD_NV6 = "Standard_NV6" + STANDARD_NV12 = "Standard_NV12" + STANDARD_NV24 = "Standard_NV24" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_availability_sets_operations.py index 8f156d903b13..3947c78c0965 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_availability_sets_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -67,10 +67,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -88,14 +91,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailabilitySet') 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 @@ -133,10 +134,13 @@ def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -154,14 +158,12 @@ def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailabilitySetUpdate') 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 @@ -183,7 +185,7 @@ def delete( availability_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" + # type: (...) -> Optional["models.OperationStatusResponse"] """Delete an availability set. :param resource_group_name: The name of the resource group. @@ -195,10 +197,13 @@ def delete( :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore @@ -215,9 +220,8 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -255,9 +259,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -274,9 +281,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -301,7 +307,8 @@ def list_by_subscription( # type: (...) -> Iterable["models.AvailabilitySetListResult"] """Lists all availability sets in a subscription. - :param expand: The expand expression to apply to the operation. + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AvailabilitySetListResult or the result of cls(response) @@ -309,11 +316,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + 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_subscription.metadata['url'] # type: ignore @@ -327,15 +341,11 @@ def prepare_request(next_link=None): if expand is not None: query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -378,11 +388,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + 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 @@ -395,15 +412,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -438,7 +451,7 @@ def list_available_sizes( ): # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes that can be used to create a new virtual machine in - an existing availability set. + an existing availability set. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -450,11 +463,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + 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_available_sizes.metadata['url'] # type: ignore @@ -468,15 +488,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_images_operations.py index 683d817a5247..f7883de12a4e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_images_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.Image" cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'Image') 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('Image', pipeline_response) @@ -112,7 +112,7 @@ def begin_create_or_update( parameters, # type: "models.Image" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Image"] """Create or update an image. :param resource_group_name: The name of the resource group. @@ -180,10 +180,13 @@ def _update_initial( ): # type: (...) -> "models.Image" cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -201,14 +204,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ImageUpdate') 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 @@ -216,7 +217,6 @@ def _update_initial( 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('Image', pipeline_response) @@ -236,7 +236,7 @@ def begin_update( parameters, # type: "models.ImageUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Image"] """Update an image. :param resource_group_name: The name of the resource group. @@ -301,11 +301,14 @@ def _delete_initial( image_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -322,9 +325,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -349,7 +351,7 @@ def begin_delete( image_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Deletes an Image. :param resource_group_name: The name of the resource group. @@ -427,9 +429,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -448,9 +453,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -483,11 +487,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + 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 @@ -500,15 +511,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -541,7 +548,7 @@ def list( ): # type: (...) -> Iterable["models.ImageListResult"] """Gets the list of Images in the subscription. Use nextLink property in the response to get the - next page of Images. Do this till nextLink is null to fetch all the Images. + next page of Images. Do this till nextLink is null to fetch all the Images. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ImageListResult or the result of cls(response) @@ -549,11 +556,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + 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 @@ -565,15 +579,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_log_analytics_operations.py index 8ed9eced2015..c2ebc332ba1b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_log_analytics_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod @@ -52,12 +52,15 @@ def _export_request_rate_by_interval_initial( parameters, # type: "models.RequestRateByIntervalInput" **kwargs # type: Any ): - # type: (...) -> "models.LogAnalyticsOperationResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._export_request_rate_by_interval_initial.metadata['url'] # type: ignore @@ -74,14 +77,12 @@ def _export_request_rate_by_interval_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RequestRateByIntervalInput') 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 @@ -105,9 +106,9 @@ def begin_export_request_rate_by_interval( parameters, # type: "models.RequestRateByIntervalInput" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LogAnalyticsOperationResult"] """Export logs that show Api requests made by this subscription in the given time window to show - throttling activities. + throttling activities. :param location: The location upon which virtual-machine-sizes is queried. :type location: str @@ -168,12 +169,15 @@ def _export_throttled_requests_initial( parameters, # type: "models.LogAnalyticsInputBase" **kwargs # type: Any ): - # type: (...) -> "models.LogAnalyticsOperationResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._export_throttled_requests_initial.metadata['url'] # type: ignore @@ -190,14 +194,12 @@ def _export_throttled_requests_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LogAnalyticsInputBase') 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 @@ -221,9 +223,9 @@ def begin_export_throttled_requests( parameters, # type: "models.LogAnalyticsInputBase" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LogAnalyticsOperationResult"] """Export logs that show total throttled Api requests for this subscription in the given time - window. + window. :param location: The location upon which virtual-machine-sizes is queried. :type location: str diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_operations.py index ff9bfa3c5da9..70571ce82704 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -58,11 +58,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeOperationListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + 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 @@ -70,15 +77,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_usage_operations.py index a9c7113fbee8..0ebc0aa6bc26 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_usage_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,7 +52,7 @@ def list( ): # type: (...) -> Iterable["models.ListUsagesResult"] """Gets, for the specified location, the current compute resource usage information as well as the - limits for compute resources under the subscription. + limits for compute resources under the subscription. :param location: The location for which resource usage is queried. :type location: str @@ -62,11 +62,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + 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 @@ -79,15 +86,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_extension_images_operations.py index 73307f42c501..24c7d71a9905 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_extension_images_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -69,9 +69,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -90,9 +93,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -128,9 +130,12 @@ def list_types( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.list_types.metadata['url'] # type: ignore @@ -147,9 +152,8 @@ def list_types( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -197,9 +201,12 @@ def list_versions( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.list_versions.metadata['url'] # type: ignore @@ -223,9 +230,8 @@ def list_versions( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_extensions_operations.py index 5c7e387d1200..f8933d5aa9d4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_extensions_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachineExtension" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -78,14 +81,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtension') 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 @@ -93,7 +94,6 @@ def _create_or_update_initial( 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('VirtualMachineExtension', pipeline_response) @@ -114,18 +114,18 @@ def begin_create_or_update( extension_parameters, # type: "models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineExtension"] """The operation to create or update the extension. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_name: The name of the virtual machine where the extension should be created or - updated. + updated. :type vm_name: str :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Create Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineExtension :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. @@ -188,10 +188,13 @@ def _update_initial( ): # type: (...) -> "models.VirtualMachineExtension" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -210,14 +213,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtensionUpdate') 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 @@ -241,7 +242,7 @@ def begin_update( extension_parameters, # type: "models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineExtension"] """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -251,7 +252,7 @@ def begin_update( :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Update Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineExtensionUpdate :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. @@ -311,11 +312,14 @@ def _delete_initial( vm_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -333,9 +337,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -361,7 +364,7 @@ def begin_delete( vm_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -445,9 +448,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -467,9 +473,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_images_operations.py index 4665226bc527..fa6d5c0ad310 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_images_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -72,9 +72,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -94,9 +97,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -148,9 +150,12 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -175,9 +180,8 @@ def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -213,9 +217,12 @@ def list_offers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.list_offers.metadata['url'] # type: ignore @@ -232,9 +239,8 @@ def list_offers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -267,9 +273,12 @@ def list_publishers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.list_publishers.metadata['url'] # type: ignore @@ -285,9 +294,8 @@ def list_publishers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -326,9 +334,12 @@ def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.list_skus.metadata['url'] # type: ignore @@ -346,9 +357,8 @@ def list_skus( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_run_commands_operations.py index f672bf153201..b7c14f970db2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_run_commands_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -61,11 +61,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json, text/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 @@ -78,15 +85,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -132,9 +135,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandDocument"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json, text/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -151,9 +157,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_extensions_operations.py index 43ce43f76118..9b478cd1e2fe 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -57,10 +57,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachineScaleSetExtension" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -79,14 +82,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineScaleSetExtension') 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 @@ -94,7 +95,6 @@ def _create_or_update_initial( 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('VirtualMachineScaleSetExtension', pipeline_response) @@ -115,18 +115,18 @@ def begin_create_or_update( extension_parameters, # type: "models.VirtualMachineScaleSetExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineScaleSetExtension"] """The operation to create or update an extension. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_scale_set_name: The name of the VM scale set where the extension should be create or - updated. + updated. :type vm_scale_set_name: str :param vmss_extension_name: The name of the VM scale set extension. :type vmss_extension_name: str :param extension_parameters: Parameters supplied to the Create VM scale set Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetExtension :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. @@ -186,11 +186,14 @@ def _delete_initial( vmss_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -208,9 +211,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -236,7 +238,7 @@ def begin_delete( vmss_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -320,9 +322,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -342,9 +347,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -380,11 +384,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtensionListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + 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 @@ -398,15 +409,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index e20875c8d771..c2b2244e22cd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod @@ -52,11 +52,14 @@ def _cancel_initial( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._cancel_initial.metadata['url'] # type: ignore @@ -73,9 +76,8 @@ def _cancel_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -100,7 +102,7 @@ def begin_cancel( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Cancels the current virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -162,11 +164,14 @@ def _start_os_upgrade_initial( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._start_os_upgrade_initial.metadata['url'] # type: ignore @@ -183,9 +188,8 @@ def _start_os_upgrade_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -210,10 +214,10 @@ def begin_start_os_upgrade( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Starts a rolling upgrade to move all virtual machine scale set instances to the latest - available Platform Image OS version. Instances which are already running the latest available - OS version are not affected. + available Platform Image OS version. Instances which are already running the latest available + OS version are not affected. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -287,9 +291,12 @@ def get_latest( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RollingUpgradeStatusInfo"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.get_latest.metadata['url'] # type: ignore @@ -306,9 +313,8 @@ def get_latest( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_vms_operations.py index 1afbcef87708..af0c14cfd33a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -54,11 +54,14 @@ def _reimage_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._reimage_initial.metadata['url'] # type: ignore @@ -76,9 +79,8 @@ def _reimage_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -104,7 +106,7 @@ def begin_reimage( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -170,11 +172,14 @@ def _reimage_all_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._reimage_all_initial.metadata['url'] # type: ignore @@ -192,9 +197,8 @@ def _reimage_all_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -220,9 +224,9 @@ def begin_reimage_all( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. - This operation is only supported for managed disks. + This operation is only supported for managed disks. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -287,11 +291,14 @@ def _deallocate_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._deallocate_initial.metadata['url'] # type: ignore @@ -309,9 +316,8 @@ def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -337,10 +343,10 @@ def begin_deallocate( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and - releases the compute resources it uses. You are not billed for the compute resources of this - virtual machine once it is deallocated. + releases the compute resources it uses. You are not billed for the compute resources of this + virtual machine once it is deallocated. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -408,10 +414,13 @@ def _update_initial( ): # type: (...) -> "models.VirtualMachineScaleSetVM" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -430,14 +439,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSetVM') 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 @@ -445,7 +452,6 @@ def _update_initial( 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('VirtualMachineScaleSetVM', pipeline_response) @@ -466,13 +472,13 @@ def begin_update( parameters, # type: "models.VirtualMachineScaleSetVM" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineScaleSetVM"] """Updates a virtual machine of a VM scale set. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_scale_set_name: The name of the VM scale set where the extension should be create or - updated. + updated. :type vm_scale_set_name: str :param instance_id: The instance ID of the virtual machine. :type instance_id: str @@ -536,11 +542,14 @@ def _delete_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -558,9 +567,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -586,7 +594,7 @@ def begin_delete( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Deletes a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -667,9 +675,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -687,9 +698,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -728,9 +738,12 @@ def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -748,9 +761,8 @@ def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -783,11 +795,14 @@ def list( :type resource_group_name: str :param virtual_machine_scale_set_name: The name of the VM scale set. :type virtual_machine_scale_set_name: str - :param filter: The filter to apply to the operation. + :param filter: The filter to apply to the operation. Allowed values are + 'startswith(instanceView/statuses/code, 'PowerState') eq true', 'properties/latestModelApplied + eq true', 'properties/latestModelApplied eq false'. :type filter: str - :param select: The list parameters. + :param select: The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. :type select: str - :param expand: The expand expression to apply to the operation. + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetVMListResult or the result of cls(response) @@ -795,11 +810,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + 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 @@ -819,15 +841,11 @@ def prepare_request(next_link=None): query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -861,11 +879,14 @@ def _power_off_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._power_off_initial.metadata['url'] # type: ignore @@ -883,9 +904,8 @@ def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -911,10 +931,10 @@ def begin_power_off( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached - and you are getting charged for the resources. Instead, use deallocate to release resources and - avoid charges. + and you are getting charged for the resources. Instead, use deallocate to release resources and + avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -979,11 +999,14 @@ def _restart_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._restart_initial.metadata['url'] # type: ignore @@ -1001,9 +1024,8 @@ def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1029,7 +1051,7 @@ def begin_restart( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Restarts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1095,11 +1117,14 @@ def _start_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._start_initial.metadata['url'] # type: ignore @@ -1117,9 +1142,8 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1145,7 +1169,7 @@ def begin_start( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Starts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1211,11 +1235,14 @@ def _redeploy_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._redeploy_initial.metadata['url'] # type: ignore @@ -1233,9 +1260,8 @@ def _redeploy_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1261,9 +1287,9 @@ def begin_redeploy( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and - powers it back on. + powers it back on. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1328,11 +1354,14 @@ def _perform_maintenance_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._perform_maintenance_initial.metadata['url'] # type: ignore @@ -1350,9 +1379,8 @@ def _perform_maintenance_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1378,7 +1406,7 @@ def begin_perform_maintenance( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Performs maintenance on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_sets_operations.py index fb811cada636..968d5bbc368e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_sets_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachineScaleSet" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSet') 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('VirtualMachineScaleSet', pipeline_response) @@ -112,7 +112,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualMachineScaleSet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -180,10 +180,13 @@ def _update_initial( ): # type: (...) -> "models.VirtualMachineScaleSet" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -201,14 +204,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSetUpdate') 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 @@ -231,7 +232,7 @@ def begin_update( parameters, # type: "models.VirtualMachineScaleSetUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] """Update a VM scale set. :param resource_group_name: The name of the resource group. @@ -296,11 +297,14 @@ def _delete_initial( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -317,9 +321,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -344,7 +347,7 @@ def begin_delete( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Deletes a VM scale set. :param resource_group_name: The name of the resource group. @@ -419,9 +422,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -438,9 +444,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -464,12 +469,15 @@ def _deallocate_initial( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._deallocate_initial.metadata['url'] # type: ignore @@ -487,9 +495,8 @@ def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -497,7 +504,6 @@ def _deallocate_initial( body_content = None 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 @@ -522,10 +528,10 @@ def begin_deallocate( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and - releases the compute resources. You are not billed for the compute resources that this virtual - machine scale set deallocates. + releases the compute resources. You are not billed for the compute resources that this virtual + machine scale set deallocates. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -590,12 +596,15 @@ def _delete_instances_initial( vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._delete_instances_initial.metadata['url'] # type: ignore @@ -613,14 +622,12 @@ def _delete_instances_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -645,7 +652,7 @@ def begin_delete_instances( vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Deletes virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -723,9 +730,12 @@ def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -742,9 +752,8 @@ def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -777,11 +786,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + 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 @@ -794,15 +810,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -835,8 +847,8 @@ def list_all( ): # type: (...) -> Iterable["models.VirtualMachineScaleSetListWithLinkResult"] """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource - group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this - till nextLink is null to fetch all the VM Scale Sets. + group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this + till nextLink is null to fetch all the VM Scale Sets. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetListWithLinkResult or the result of cls(response) @@ -844,11 +856,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + 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_all.metadata['url'] # type: ignore @@ -860,15 +879,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -903,7 +918,7 @@ def list_skus( ): # type: (...) -> Iterable["models.VirtualMachineScaleSetListSkusResult"] """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM - instances allowed for each SKU. + instances allowed for each SKU. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -915,11 +930,18 @@ def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + 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_skus.metadata['url'] # type: ignore @@ -933,15 +955,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -987,11 +1005,18 @@ def get_os_upgrade_history( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListOSUpgradeHistory"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + 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.get_os_upgrade_history.metadata['url'] # type: ignore @@ -1005,15 +1030,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1047,12 +1068,15 @@ def _power_off_initial( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._power_off_initial.metadata['url'] # type: ignore @@ -1070,9 +1094,8 @@ def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1080,7 +1103,6 @@ def _power_off_initial( body_content = None 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 @@ -1105,10 +1127,10 @@ def begin_power_off( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still - attached and you are getting charged for the resources. Instead, use deallocate to release - resources and avoid charges. + attached and you are getting charged for the resources. Instead, use deallocate to release + resources and avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1173,12 +1195,15 @@ def _restart_initial( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._restart_initial.metadata['url'] # type: ignore @@ -1196,9 +1221,8 @@ def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1206,7 +1230,6 @@ def _restart_initial( body_content = None 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 @@ -1231,7 +1254,7 @@ def begin_restart( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Restarts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1297,12 +1320,15 @@ def _start_initial( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._start_initial.metadata['url'] # type: ignore @@ -1320,9 +1346,8 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1330,7 +1355,6 @@ def _start_initial( body_content = None 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 @@ -1355,7 +1379,7 @@ def begin_start( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Starts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1421,12 +1445,15 @@ def _redeploy_initial( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._redeploy_initial.metadata['url'] # type: ignore @@ -1444,9 +1471,8 @@ def _redeploy_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1454,7 +1480,6 @@ def _redeploy_initial( body_content = None 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 @@ -1479,9 +1504,9 @@ def begin_redeploy( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, - and powers them back on. + and powers them back on. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1546,12 +1571,15 @@ def _perform_maintenance_initial( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._perform_maintenance_initial.metadata['url'] # type: ignore @@ -1569,9 +1597,8 @@ def _perform_maintenance_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1579,7 +1606,6 @@ def _perform_maintenance_initial( body_content = None 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 @@ -1604,11 +1630,11 @@ def begin_perform_maintenance( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances - which are not eligible for perform maintenance will be failed. Please refer to best practices - for more details: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual- - machine-scale-sets-maintenance-notifications. + which are not eligible for perform maintenance will be failed. Please refer to best practices + for more details: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual- + machine-scale-sets-maintenance-notifications. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1673,12 +1699,15 @@ def _update_instances_initial( vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_instances_initial.metadata['url'] # type: ignore @@ -1696,14 +1725,12 @@ def _update_instances_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -1728,7 +1755,7 @@ def begin_update_instances( vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. :param resource_group_name: The name of the resource group. @@ -1794,12 +1821,15 @@ def _reimage_initial( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._reimage_initial.metadata['url'] # type: ignore @@ -1817,9 +1847,8 @@ def _reimage_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1827,7 +1856,6 @@ def _reimage_initial( body_content = None 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 @@ -1852,7 +1880,7 @@ def begin_reimage( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1918,12 +1946,15 @@ def _reimage_all_initial( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._reimage_all_initial.metadata['url'] # type: ignore @@ -1941,9 +1972,8 @@ def _reimage_all_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1951,7 +1981,6 @@ def _reimage_all_initial( body_content = None 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 @@ -1976,9 +2005,9 @@ def begin_reimage_all( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This - operation is only supported for managed disks. + operation is only supported for managed disks. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -2060,9 +2089,12 @@ def force_recovery_service_fabric_platform_update_domain_walk( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RecoveryWalkResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.force_recovery_service_fabric_platform_update_domain_walk.metadata['url'] # type: ignore @@ -2080,9 +2112,8 @@ def force_recovery_service_fabric_platform_update_domain_walk( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_sizes_operations.py index 3198c99278fb..2c4d0aa29068 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_sizes_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -61,11 +61,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + 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 @@ -78,15 +85,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machines_operations.py index 9860d32cd2d6..d3fdd9273b28 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machines_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -69,9 +69,12 @@ def get_extensions( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.get_extensions.metadata['url'] # type: ignore @@ -90,9 +93,8 @@ def get_extensions( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -125,11 +127,18 @@ def list_by_location( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + 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_location.metadata['url'] # type: ignore @@ -142,15 +151,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -184,12 +189,15 @@ def _capture_initial( parameters, # type: "models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._capture_initial.metadata['url'] # type: ignore @@ -207,14 +215,12 @@ def _capture_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineCaptureParameters') 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 @@ -239,9 +245,9 @@ def begin_capture( parameters, # type: "models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineCaptureResult"] """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used - to create similar VMs. + to create similar VMs. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -308,10 +314,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachine" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -329,14 +338,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachine') 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 @@ -344,7 +351,6 @@ def _create_or_update_initial( 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('VirtualMachine', pipeline_response) @@ -364,7 +370,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualMachine" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachine"] """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -432,10 +438,13 @@ def _update_initial( ): # type: (...) -> "models.VirtualMachine" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -453,14 +462,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineUpdate') 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 @@ -468,7 +475,6 @@ def _update_initial( 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('VirtualMachine', pipeline_response) @@ -488,7 +494,7 @@ def begin_update( parameters, # type: "models.VirtualMachineUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachine"] """The operation to update a virtual machine. :param resource_group_name: The name of the resource group. @@ -553,11 +559,14 @@ def _delete_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -574,9 +583,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -601,7 +609,7 @@ def begin_delete( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """The operation to delete a virtual machine. :param resource_group_name: The name of the resource group. @@ -679,9 +687,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -700,9 +711,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -738,9 +748,12 @@ def instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.instance_view.metadata['url'] # type: ignore @@ -757,9 +770,8 @@ def instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -782,11 +794,14 @@ def _convert_to_managed_disks_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._convert_to_managed_disks_initial.metadata['url'] # type: ignore @@ -803,9 +818,8 @@ def _convert_to_managed_disks_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -830,9 +844,9 @@ def begin_convert_to_managed_disks( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop- - deallocated before invoking this operation. + deallocated before invoking this operation. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -893,11 +907,14 @@ def _deallocate_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._deallocate_initial.metadata['url'] # type: ignore @@ -914,9 +931,8 @@ def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -941,9 +957,9 @@ def begin_deallocate( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Shuts down the virtual machine and releases the compute resources. You are not billed for the - compute resources that this virtual machine uses. + compute resources that this virtual machine uses. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1017,9 +1033,12 @@ def generalize( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self.generalize.metadata['url'] # type: ignore @@ -1036,9 +1055,8 @@ def generalize( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1062,7 +1080,7 @@ def list( ): # type: (...) -> Iterable["models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified resource group. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1072,11 +1090,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + 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 @@ -1089,15 +1114,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1130,7 +1151,7 @@ def list_all( ): # type: (...) -> Iterable["models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified subscription. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineListResult or the result of cls(response) @@ -1138,11 +1159,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + 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_all.metadata['url'] # type: ignore @@ -1154,15 +1182,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1197,7 +1221,7 @@ def list_available_sizes( ): # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes to which the specified virtual machine can be - resized. + resized. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1209,11 +1233,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + 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_available_sizes.metadata['url'] # type: ignore @@ -1227,15 +1258,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1268,11 +1295,14 @@ def _power_off_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._power_off_initial.metadata['url'] # type: ignore @@ -1289,9 +1319,8 @@ def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1316,9 +1345,9 @@ def begin_power_off( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with - the same provisioned resources. You are still charged for this virtual machine. + the same provisioned resources. You are still charged for this virtual machine. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1379,11 +1408,14 @@ def _restart_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._restart_initial.metadata['url'] # type: ignore @@ -1400,9 +1432,8 @@ def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1427,7 +1458,7 @@ def begin_restart( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """The operation to restart a virtual machine. :param resource_group_name: The name of the resource group. @@ -1489,11 +1520,14 @@ def _start_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._start_initial.metadata['url'] # type: ignore @@ -1510,9 +1544,8 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1537,7 +1570,7 @@ def begin_start( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """The operation to start a virtual machine. :param resource_group_name: The name of the resource group. @@ -1599,11 +1632,14 @@ def _redeploy_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._redeploy_initial.metadata['url'] # type: ignore @@ -1620,9 +1656,8 @@ def _redeploy_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1647,7 +1682,7 @@ def begin_redeploy( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """Shuts down the virtual machine, moves it to a new node, and powers it back on. :param resource_group_name: The name of the resource group. @@ -1709,11 +1744,14 @@ def _perform_maintenance_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" + accept = "application/json" # Construct URL url = self._perform_maintenance_initial.metadata['url'] # type: ignore @@ -1730,9 +1768,8 @@ def _perform_maintenance_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1757,7 +1794,7 @@ def begin_perform_maintenance( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.OperationStatusResponse"] """The operation to perform maintenance on a virtual machine. :param resource_group_name: The name of the resource group. @@ -1820,12 +1857,15 @@ def _run_command_initial( parameters, # type: "models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> "models.RunCommandResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" # Construct URL url = self._run_command_initial.metadata['url'] # type: ignore @@ -1843,14 +1883,12 @@ def _run_command_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RunCommandInput') 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 @@ -1875,7 +1913,7 @@ def begin_run_command( parameters, # type: "models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RunCommandResult"] """Run command on the VM. :param resource_group_name: The name of the resource group. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/__init__.py index 20a4019e9c23..cdc7f7a1709a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/__init__.py @@ -10,7 +10,7 @@ __all__ = ['ComputeManagementClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass 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 d6901f63cdda..66b3b35b3cbc 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,6 +101,7 @@ 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/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_configuration.py index ec6b0242659c..4501af86bb29 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -47,8 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2018-04-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-compute/{}'.format(VERSION)) self._configure(**kwargs) @@ -61,6 +61,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) 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 c802c405a386..fc09b853e778 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 @@ -4,7 +4,11 @@ "client": { "name": "ComputeManagementClient", "filename": "_compute_management_client", - "description": "Compute Client." + "description": "Compute Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true }, "global_parameters": { "sync_method": { @@ -41,7 +45,10 @@ }, "config": { "credential": true, - "credential_scopes": ["https://management.azure.com/.default"] + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null }, "operation_groups": { "operations": "Operations", diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/__init__.py index c8a8b4817269..9e9459635989 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._compute_management_client_async import ComputeManagementClient +from ._compute_management_client import ComputeManagementClient __all__ = ['ComputeManagementClient'] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/_compute_management_client_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/_compute_management_client.py similarity index 77% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/_compute_management_client_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/_compute_management_client.py index f708cecc49ed..5e5dd5ce489b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/_compute_management_client_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/_compute_management_client.py @@ -15,25 +15,25 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration_async import ComputeManagementClientConfiguration -from .operations_async import Operations -from .operations_async import AvailabilitySetsOperations -from .operations_async import ProximityPlacementGroupsOperations -from .operations_async import VirtualMachineExtensionImagesOperations -from .operations_async import VirtualMachineExtensionsOperations -from .operations_async import VirtualMachineImagesOperations -from .operations_async import UsageOperations -from .operations_async import VirtualMachinesOperations -from .operations_async import VirtualMachineSizesOperations -from .operations_async import ImagesOperations -from .operations_async import VirtualMachineScaleSetsOperations -from .operations_async import VirtualMachineScaleSetExtensionsOperations -from .operations_async import VirtualMachineScaleSetRollingUpgradesOperations -from .operations_async import VirtualMachineScaleSetVMsOperations -from .operations_async import LogAnalyticsOperations -from .operations_async import VirtualMachineRunCommandsOperations -from .operations_async import DisksOperations -from .operations_async import SnapshotsOperations +from ._configuration import ComputeManagementClientConfiguration +from .operations import Operations +from .operations import AvailabilitySetsOperations +from .operations import ProximityPlacementGroupsOperations +from .operations import VirtualMachineExtensionImagesOperations +from .operations import VirtualMachineExtensionsOperations +from .operations import VirtualMachineImagesOperations +from .operations import UsageOperations +from .operations import VirtualMachinesOperations +from .operations import VirtualMachineSizesOperations +from .operations import ImagesOperations +from .operations import VirtualMachineScaleSetsOperations +from .operations import VirtualMachineScaleSetExtensionsOperations +from .operations import VirtualMachineScaleSetRollingUpgradesOperations +from .operations import VirtualMachineScaleSetVMsOperations +from .operations import LogAnalyticsOperations +from .operations import VirtualMachineRunCommandsOperations +from .operations import DisksOperations +from .operations import SnapshotsOperations from .. import models @@ -41,41 +41,41 @@ class ComputeManagementClient(object): """Compute Client. :ivar operations: Operations operations - :vartype operations: azure.mgmt.compute.v2018_04_01.aio.operations_async.Operations + :vartype operations: azure.mgmt.compute.v2018_04_01.aio.operations.Operations :ivar availability_sets: AvailabilitySetsOperations operations - :vartype availability_sets: azure.mgmt.compute.v2018_04_01.aio.operations_async.AvailabilitySetsOperations + :vartype availability_sets: azure.mgmt.compute.v2018_04_01.aio.operations.AvailabilitySetsOperations :ivar proximity_placement_groups: ProximityPlacementGroupsOperations operations - :vartype proximity_placement_groups: azure.mgmt.compute.v2018_04_01.aio.operations_async.ProximityPlacementGroupsOperations + :vartype proximity_placement_groups: azure.mgmt.compute.v2018_04_01.aio.operations.ProximityPlacementGroupsOperations :ivar virtual_machine_extension_images: VirtualMachineExtensionImagesOperations operations - :vartype virtual_machine_extension_images: azure.mgmt.compute.v2018_04_01.aio.operations_async.VirtualMachineExtensionImagesOperations + :vartype virtual_machine_extension_images: azure.mgmt.compute.v2018_04_01.aio.operations.VirtualMachineExtensionImagesOperations :ivar virtual_machine_extensions: VirtualMachineExtensionsOperations operations - :vartype virtual_machine_extensions: azure.mgmt.compute.v2018_04_01.aio.operations_async.VirtualMachineExtensionsOperations + :vartype virtual_machine_extensions: azure.mgmt.compute.v2018_04_01.aio.operations.VirtualMachineExtensionsOperations :ivar virtual_machine_images: VirtualMachineImagesOperations operations - :vartype virtual_machine_images: azure.mgmt.compute.v2018_04_01.aio.operations_async.VirtualMachineImagesOperations + :vartype virtual_machine_images: azure.mgmt.compute.v2018_04_01.aio.operations.VirtualMachineImagesOperations :ivar usage: UsageOperations operations - :vartype usage: azure.mgmt.compute.v2018_04_01.aio.operations_async.UsageOperations + :vartype usage: azure.mgmt.compute.v2018_04_01.aio.operations.UsageOperations :ivar virtual_machines: VirtualMachinesOperations operations - :vartype virtual_machines: azure.mgmt.compute.v2018_04_01.aio.operations_async.VirtualMachinesOperations + :vartype virtual_machines: azure.mgmt.compute.v2018_04_01.aio.operations.VirtualMachinesOperations :ivar virtual_machine_sizes: VirtualMachineSizesOperations operations - :vartype virtual_machine_sizes: azure.mgmt.compute.v2018_04_01.aio.operations_async.VirtualMachineSizesOperations + :vartype virtual_machine_sizes: azure.mgmt.compute.v2018_04_01.aio.operations.VirtualMachineSizesOperations :ivar images: ImagesOperations operations - :vartype images: azure.mgmt.compute.v2018_04_01.aio.operations_async.ImagesOperations + :vartype images: azure.mgmt.compute.v2018_04_01.aio.operations.ImagesOperations :ivar virtual_machine_scale_sets: VirtualMachineScaleSetsOperations operations - :vartype virtual_machine_scale_sets: azure.mgmt.compute.v2018_04_01.aio.operations_async.VirtualMachineScaleSetsOperations + :vartype virtual_machine_scale_sets: azure.mgmt.compute.v2018_04_01.aio.operations.VirtualMachineScaleSetsOperations :ivar virtual_machine_scale_set_extensions: VirtualMachineScaleSetExtensionsOperations operations - :vartype virtual_machine_scale_set_extensions: azure.mgmt.compute.v2018_04_01.aio.operations_async.VirtualMachineScaleSetExtensionsOperations + :vartype virtual_machine_scale_set_extensions: azure.mgmt.compute.v2018_04_01.aio.operations.VirtualMachineScaleSetExtensionsOperations :ivar virtual_machine_scale_set_rolling_upgrades: VirtualMachineScaleSetRollingUpgradesOperations operations - :vartype virtual_machine_scale_set_rolling_upgrades: azure.mgmt.compute.v2018_04_01.aio.operations_async.VirtualMachineScaleSetRollingUpgradesOperations + :vartype virtual_machine_scale_set_rolling_upgrades: azure.mgmt.compute.v2018_04_01.aio.operations.VirtualMachineScaleSetRollingUpgradesOperations :ivar virtual_machine_scale_set_vms: VirtualMachineScaleSetVMsOperations operations - :vartype virtual_machine_scale_set_vms: azure.mgmt.compute.v2018_04_01.aio.operations_async.VirtualMachineScaleSetVMsOperations + :vartype virtual_machine_scale_set_vms: azure.mgmt.compute.v2018_04_01.aio.operations.VirtualMachineScaleSetVMsOperations :ivar log_analytics: LogAnalyticsOperations operations - :vartype log_analytics: azure.mgmt.compute.v2018_04_01.aio.operations_async.LogAnalyticsOperations + :vartype log_analytics: azure.mgmt.compute.v2018_04_01.aio.operations.LogAnalyticsOperations :ivar virtual_machine_run_commands: VirtualMachineRunCommandsOperations operations - :vartype virtual_machine_run_commands: azure.mgmt.compute.v2018_04_01.aio.operations_async.VirtualMachineRunCommandsOperations + :vartype virtual_machine_run_commands: azure.mgmt.compute.v2018_04_01.aio.operations.VirtualMachineRunCommandsOperations :ivar disks: DisksOperations operations - :vartype disks: azure.mgmt.compute.v2018_04_01.aio.operations_async.DisksOperations + :vartype disks: azure.mgmt.compute.v2018_04_01.aio.operations.DisksOperations :ivar snapshots: SnapshotsOperations operations - :vartype snapshots: azure.mgmt.compute.v2018_04_01.aio.operations_async.SnapshotsOperations + :vartype snapshots: azure.mgmt.compute.v2018_04_01.aio.operations.SnapshotsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. @@ -98,6 +98,7 @@ 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/aio/_configuration_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/_configuration.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/_configuration_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/_configuration.py index 760808ef2a1d..7880a1e10fe4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/_configuration_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -44,8 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2018-04-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-compute/{}'.format(VERSION)) self._configure(**kwargs) @@ -57,6 +57,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/__init__.py new file mode 100644 index 000000000000..00f6e4823926 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/__init__.py @@ -0,0 +1,47 @@ +# 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 ._operations import Operations +from ._availability_sets_operations import AvailabilitySetsOperations +from ._proximity_placement_groups_operations import ProximityPlacementGroupsOperations +from ._virtual_machine_extension_images_operations import VirtualMachineExtensionImagesOperations +from ._virtual_machine_extensions_operations import VirtualMachineExtensionsOperations +from ._virtual_machine_images_operations import VirtualMachineImagesOperations +from ._usage_operations import UsageOperations +from ._virtual_machines_operations import VirtualMachinesOperations +from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations +from ._images_operations import ImagesOperations +from ._virtual_machine_scale_sets_operations import VirtualMachineScaleSetsOperations +from ._virtual_machine_scale_set_extensions_operations import VirtualMachineScaleSetExtensionsOperations +from ._virtual_machine_scale_set_rolling_upgrades_operations import VirtualMachineScaleSetRollingUpgradesOperations +from ._virtual_machine_scale_set_vms_operations import VirtualMachineScaleSetVMsOperations +from ._log_analytics_operations import LogAnalyticsOperations +from ._virtual_machine_run_commands_operations import VirtualMachineRunCommandsOperations +from ._disks_operations import DisksOperations +from ._snapshots_operations import SnapshotsOperations + +__all__ = [ + 'Operations', + 'AvailabilitySetsOperations', + 'ProximityPlacementGroupsOperations', + 'VirtualMachineExtensionImagesOperations', + 'VirtualMachineExtensionsOperations', + 'VirtualMachineImagesOperations', + 'UsageOperations', + 'VirtualMachinesOperations', + 'VirtualMachineSizesOperations', + 'ImagesOperations', + 'VirtualMachineScaleSetsOperations', + 'VirtualMachineScaleSetExtensionsOperations', + 'VirtualMachineScaleSetRollingUpgradesOperations', + 'VirtualMachineScaleSetVMsOperations', + 'LogAnalyticsOperations', + 'VirtualMachineRunCommandsOperations', + 'DisksOperations', + 'SnapshotsOperations', +] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_availability_sets_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_availability_sets_operations.py similarity index 90% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_availability_sets_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_availability_sets_operations.py index dac84387b0c4..e4a56a8ee0f9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_availability_sets_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_availability_sets_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -62,10 +62,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -83,14 +86,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailabilitySet') 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 @@ -127,10 +128,13 @@ async def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -148,14 +152,12 @@ async def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailabilitySetUpdate') 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 @@ -189,7 +191,9 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -209,7 +213,6 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -241,9 +244,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -260,9 +266,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -286,7 +291,8 @@ def list_by_subscription( ) -> AsyncIterable["models.AvailabilitySetListResult"]: """Lists all availability sets in a subscription. - :param expand: The expand expression to apply to the operation. + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AvailabilitySetListResult or the result of cls(response) @@ -294,11 +300,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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_subscription.metadata['url'] # type: ignore @@ -312,15 +325,11 @@ def prepare_request(next_link=None): if expand is not None: query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -362,11 +371,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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 @@ -379,15 +395,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -421,7 +433,7 @@ def list_available_sizes( **kwargs ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes that can be used to create a new virtual machine in - an existing availability set. + an existing availability set. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -433,11 +445,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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_available_sizes.metadata['url'] # type: ignore @@ -451,15 +470,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_disks_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_disks_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_disks_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_disks_operations.py index f21189be4814..2f868603305c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_disks_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_disks_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.Disk": cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('Disk', pipeline_response) @@ -106,14 +106,14 @@ async def begin_create_or_update( disk_name: str, disk: "models.Disk", **kwargs - ) -> "models.Disk": + ) -> 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. + 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.v2018_04_01.models.Disk @@ -123,8 +123,8 @@ async def begin_create_or_update( 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: Disk, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_04_01.models.Disk + :return: An instance of AsyncLROPoller that returns either Disk or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_04_01.models.Disk] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -175,10 +175,13 @@ async def _update_initial( **kwargs ) -> "models.Disk": cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -196,14 +199,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -211,7 +212,6 @@ async def _update_initial( 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('Disk', pipeline_response) @@ -230,14 +230,14 @@ async def begin_update( disk_name: str, disk: "models.DiskUpdate", **kwargs - ) -> "models.Disk": + ) -> 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. + 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.v2018_04_01.models.DiskUpdate @@ -247,8 +247,8 @@ async def begin_update( 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: Disk, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_04_01.models.Disk + :return: An instance of AsyncLROPoller that returns either Disk or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_04_01.models.Disk] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -311,9 +311,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -330,9 +333,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -356,7 +358,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -376,7 +380,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -395,14 +398,14 @@ async def begin_delete( resource_group_name: str, disk_name: str, **kwargs - ) -> None: + ) -> 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. + 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. @@ -410,8 +413,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -465,11 +468,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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 @@ -482,15 +492,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -529,11 +535,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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 @@ -545,15 +558,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -586,12 +595,15 @@ async def _grant_access_initial( disk_name: str, grant_access_data: "models.GrantAccessData", **kwargs - ) -> "models.AccessUri": - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> 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 = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._grant_access_initial.metadata['url'] # type: ignore @@ -609,14 +621,12 @@ async def _grant_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -640,17 +650,17 @@ async def begin_grant_access( disk_name: str, grant_access_data: "models.GrantAccessData", **kwargs - ) -> "models.AccessUri": + ) -> 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. + 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. + operation. :type grant_access_data: ~azure.mgmt.compute.v2018_04_01.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. @@ -658,8 +668,8 @@ async def begin_grant_access( 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: AccessUri, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_04_01.models.AccessUri + :return: An instance of AsyncLROPoller that returns either AccessUri or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_04_01.models.AccessUri] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -709,7 +719,9 @@ async def _revoke_access_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -729,7 +741,6 @@ async def _revoke_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -748,14 +759,14 @@ async def begin_revoke_access( resource_group_name: str, disk_name: str, **kwargs - ) -> None: + ) -> 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. + 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. @@ -763,8 +774,8 @@ async def begin_revoke_access( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_images_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_images_operations.py similarity index 90% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_images_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_images_operations.py index 9ba96e6f5633..491cb906cb5d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_images_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_images_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.Image": cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'Image') 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('Image', pipeline_response) @@ -106,7 +106,7 @@ async def begin_create_or_update( image_name: str, parameters: "models.Image", **kwargs - ) -> "models.Image": + ) -> AsyncLROPoller["models.Image"]: """Create or update an image. :param resource_group_name: The name of the resource group. @@ -121,8 +121,8 @@ async def begin_create_or_update( 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: Image, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_04_01.models.Image + :return: An instance of AsyncLROPoller that returns either Image or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_04_01.models.Image] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -173,10 +173,13 @@ async def _update_initial( **kwargs ) -> "models.Image": cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -194,14 +197,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ImageUpdate') 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 @@ -209,7 +210,6 @@ async def _update_initial( 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('Image', pipeline_response) @@ -228,7 +228,7 @@ async def begin_update( image_name: str, parameters: "models.ImageUpdate", **kwargs - ) -> "models.Image": + ) -> AsyncLROPoller["models.Image"]: """Update an image. :param resource_group_name: The name of the resource group. @@ -243,8 +243,8 @@ async def begin_update( 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: Image, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_04_01.models.Image + :return: An instance of AsyncLROPoller that returns either Image or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_04_01.models.Image] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -294,7 +294,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -314,7 +316,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -333,7 +334,7 @@ async def begin_delete( resource_group_name: str, image_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes an Image. :param resource_group_name: The name of the resource group. @@ -346,8 +347,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -407,9 +408,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -428,9 +432,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -462,11 +465,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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 @@ -479,15 +489,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -519,7 +525,7 @@ def list( **kwargs ) -> AsyncIterable["models.ImageListResult"]: """Gets the list of Images in the subscription. Use nextLink property in the response to get the - next page of Images. Do this till nextLink is null to fetch all the Images. + next page of Images. Do this till nextLink is null to fetch all the Images. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ImageListResult or the result of cls(response) @@ -527,11 +533,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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 @@ -543,15 +556,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_log_analytics_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_log_analytics_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_log_analytics_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_log_analytics_operations.py index a914cd5edeb9..e95149f867db 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_log_analytics_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_log_analytics_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -47,12 +47,15 @@ async def _export_request_rate_by_interval_initial( location: str, parameters: "models.RequestRateByIntervalInput", **kwargs - ) -> "models.LogAnalyticsOperationResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.LogAnalyticsOperationResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._export_request_rate_by_interval_initial.metadata['url'] # type: ignore @@ -69,14 +72,12 @@ async def _export_request_rate_by_interval_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RequestRateByIntervalInput') 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 @@ -99,9 +100,9 @@ async def begin_export_request_rate_by_interval( location: str, parameters: "models.RequestRateByIntervalInput", **kwargs - ) -> "models.LogAnalyticsOperationResult": + ) -> AsyncLROPoller["models.LogAnalyticsOperationResult"]: """Export logs that show Api requests made by this subscription in the given time window to show - throttling activities. + throttling activities. :param location: The location upon which virtual-machine-sizes is queried. :type location: str @@ -113,8 +114,8 @@ async def begin_export_request_rate_by_interval( 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: LogAnalyticsOperationResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_04_01.models.LogAnalyticsOperationResult + :return: An instance of AsyncLROPoller that returns either LogAnalyticsOperationResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_04_01.models.LogAnalyticsOperationResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -161,12 +162,15 @@ async def _export_throttled_requests_initial( location: str, parameters: "models.LogAnalyticsInputBase", **kwargs - ) -> "models.LogAnalyticsOperationResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.LogAnalyticsOperationResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._export_throttled_requests_initial.metadata['url'] # type: ignore @@ -183,14 +187,12 @@ async def _export_throttled_requests_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LogAnalyticsInputBase') 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 @@ -213,9 +215,9 @@ async def begin_export_throttled_requests( location: str, parameters: "models.LogAnalyticsInputBase", **kwargs - ) -> "models.LogAnalyticsOperationResult": + ) -> AsyncLROPoller["models.LogAnalyticsOperationResult"]: """Export logs that show total throttled Api requests for this subscription in the given time - window. + window. :param location: The location upon which virtual-machine-sizes is queried. :type location: str @@ -227,8 +229,8 @@ async def begin_export_throttled_requests( 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: LogAnalyticsOperationResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_04_01.models.LogAnalyticsOperationResult + :return: An instance of AsyncLROPoller that returns either LogAnalyticsOperationResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_04_01.models.LogAnalyticsOperationResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_operations.py similarity index 87% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_operations.py index 6e11a58a2955..8a5cf4d06a83 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -53,11 +53,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeOperationListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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 @@ -65,15 +72,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_proximity_placement_groups_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_proximity_placement_groups_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_proximity_placement_groups_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_proximity_placement_groups_operations.py index 65e88b22505c..7a1d0702fc82 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_proximity_placement_groups_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_proximity_placement_groups_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -62,10 +62,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -83,14 +86,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ProximityPlacementGroup') 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 @@ -98,7 +99,6 @@ async def create_or_update( 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('ProximityPlacementGroup', pipeline_response) @@ -132,10 +132,13 @@ async def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -153,14 +156,12 @@ async def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'UpdateResource') 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 @@ -194,7 +195,9 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -214,7 +217,6 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -246,9 +248,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -265,9 +270,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -296,11 +300,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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_subscription.metadata['url'] # type: ignore @@ -312,15 +323,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -362,11 +369,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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 @@ -379,15 +393,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_snapshots_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_snapshots_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_snapshots_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_snapshots_operations.py index fd4e0fbd3fc7..a1c07a217735 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_snapshots_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_snapshots_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.Snapshot": cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('Snapshot', pipeline_response) @@ -106,14 +106,14 @@ async def begin_create_or_update( snapshot_name: str, snapshot: "models.Snapshot", **kwargs - ) -> "models.Snapshot": + ) -> 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. + 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.v2018_04_01.models.Snapshot @@ -123,8 +123,8 @@ async def begin_create_or_update( 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: Snapshot, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_04_01.models.Snapshot + :return: An instance of AsyncLROPoller that returns either Snapshot or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_04_01.models.Snapshot] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -175,10 +175,13 @@ async def _update_initial( **kwargs ) -> "models.Snapshot": cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -196,14 +199,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -211,7 +212,6 @@ async def _update_initial( 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('Snapshot', pipeline_response) @@ -230,14 +230,14 @@ async def begin_update( snapshot_name: str, snapshot: "models.SnapshotUpdate", **kwargs - ) -> "models.Snapshot": + ) -> 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. + 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.v2018_04_01.models.SnapshotUpdate @@ -247,8 +247,8 @@ async def begin_update( 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: Snapshot, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_04_01.models.Snapshot + :return: An instance of AsyncLROPoller that returns either Snapshot or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_04_01.models.Snapshot] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -311,9 +311,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -330,9 +333,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -356,7 +358,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -376,7 +380,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -395,14 +398,14 @@ async def begin_delete( resource_group_name: str, snapshot_name: str, **kwargs - ) -> None: + ) -> 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. + 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. @@ -410,8 +413,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -465,11 +468,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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 @@ -482,15 +492,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -529,11 +535,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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 @@ -545,15 +558,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -586,12 +595,15 @@ async def _grant_access_initial( snapshot_name: str, grant_access_data: "models.GrantAccessData", **kwargs - ) -> "models.AccessUri": - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> 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 = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._grant_access_initial.metadata['url'] # type: ignore @@ -609,14 +621,12 @@ async def _grant_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -640,17 +650,17 @@ async def begin_grant_access( snapshot_name: str, grant_access_data: "models.GrantAccessData", **kwargs - ) -> "models.AccessUri": + ) -> 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. + 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. + operation. :type grant_access_data: ~azure.mgmt.compute.v2018_04_01.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. @@ -658,8 +668,8 @@ async def begin_grant_access( 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: AccessUri, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_04_01.models.AccessUri + :return: An instance of AsyncLROPoller that returns either AccessUri or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_04_01.models.AccessUri] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -709,7 +719,9 @@ async def _revoke_access_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -729,7 +741,6 @@ async def _revoke_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -748,14 +759,14 @@ async def begin_revoke_access( resource_group_name: str, snapshot_name: str, **kwargs - ) -> None: + ) -> 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. + 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. @@ -763,8 +774,8 @@ async def begin_revoke_access( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_usage_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_usage_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_usage_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_usage_operations.py index 831022348e64..92f33bd4613a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_usage_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_usage_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -47,7 +47,7 @@ def list( **kwargs ) -> AsyncIterable["models.ListUsagesResult"]: """Gets, for the specified location, the current compute resource usage information as well as the - limits for compute resources under the subscription. + limits for compute resources under the subscription. :param location: The location for which resource usage is queried. :type location: str @@ -57,11 +57,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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 @@ -74,15 +81,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_virtual_machine_extension_images_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_extension_images_operations.py similarity index 92% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_virtual_machine_extension_images_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_extension_images_operations.py index f45cee9edf74..1f38e994082b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_virtual_machine_extension_images_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -64,9 +64,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -85,9 +88,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -122,9 +124,12 @@ async def list_types( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.list_types.metadata['url'] # type: ignore @@ -141,9 +146,8 @@ async def list_types( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -190,9 +194,12 @@ async def list_versions( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.list_versions.metadata['url'] # type: ignore @@ -216,9 +223,8 @@ async def list_versions( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_virtual_machine_extensions_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_extensions_operations.py similarity index 92% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_virtual_machine_extensions_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_extensions_operations.py index 04c068794c1b..1a800a50d5f3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_virtual_machine_extensions_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_extensions_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachineExtension": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -73,14 +76,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtension') 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 @@ -88,7 +89,6 @@ async def _create_or_update_initial( 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('VirtualMachineExtension', pipeline_response) @@ -108,18 +108,18 @@ async def begin_create_or_update( vm_extension_name: str, extension_parameters: "models.VirtualMachineExtension", **kwargs - ) -> "models.VirtualMachineExtension": + ) -> AsyncLROPoller["models.VirtualMachineExtension"]: """The operation to create or update the extension. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_name: The name of the virtual machine where the extension should be created or - updated. + updated. :type vm_name: str :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Create Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2018_04_01.models.VirtualMachineExtension :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. @@ -127,8 +127,8 @@ async def begin_create_or_update( 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: VirtualMachineExtension, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_04_01.models.VirtualMachineExtension + :return: An instance of AsyncLROPoller that returns either VirtualMachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -181,10 +181,13 @@ async def _update_initial( **kwargs ) -> "models.VirtualMachineExtension": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -203,14 +206,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtensionUpdate') 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 @@ -233,7 +234,7 @@ async def begin_update( vm_extension_name: str, extension_parameters: "models.VirtualMachineExtensionUpdate", **kwargs - ) -> "models.VirtualMachineExtension": + ) -> AsyncLROPoller["models.VirtualMachineExtension"]: """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -243,7 +244,7 @@ async def begin_update( :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Update Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2018_04_01.models.VirtualMachineExtensionUpdate :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. @@ -251,8 +252,8 @@ async def begin_update( 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: VirtualMachineExtension, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_04_01.models.VirtualMachineExtension + :return: An instance of AsyncLROPoller that returns either VirtualMachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -304,7 +305,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -325,7 +328,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -345,7 +347,7 @@ async def begin_delete( vm_name: str, vm_extension_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -360,8 +362,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -425,9 +427,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -447,9 +452,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -487,9 +491,12 @@ async def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -508,9 +515,8 @@ async def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_virtual_machine_images_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_images_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_virtual_machine_images_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_images_operations.py index c21ab81e5f12..120ee6a274bd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_virtual_machine_images_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_images_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -67,9 +67,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -89,9 +92,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -142,9 +144,12 @@ async def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -169,9 +174,8 @@ async def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -206,9 +210,12 @@ async def list_offers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.list_offers.metadata['url'] # type: ignore @@ -225,9 +232,8 @@ async def list_offers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -259,9 +265,12 @@ async def list_publishers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.list_publishers.metadata['url'] # type: ignore @@ -277,9 +286,8 @@ async def list_publishers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -317,9 +325,12 @@ async def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.list_skus.metadata['url'] # type: ignore @@ -337,9 +348,8 @@ async def list_skus( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_virtual_machine_run_commands_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_run_commands_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_virtual_machine_run_commands_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_run_commands_operations.py index 0eac2a2970a0..6d7a0ade0bd9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_virtual_machine_run_commands_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,11 +56,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json, text/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 @@ -73,15 +80,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -126,9 +129,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandDocument"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json, text/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -145,9 +151,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_virtual_machine_scale_set_extensions_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_virtual_machine_scale_set_extensions_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index c3e04701670a..06dbedaea5fe 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_virtual_machine_scale_set_extensions_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,10 +52,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachineScaleSetExtension": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -74,14 +77,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineScaleSetExtension') 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 @@ -89,7 +90,6 @@ async def _create_or_update_initial( 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('VirtualMachineScaleSetExtension', pipeline_response) @@ -109,18 +109,18 @@ async def begin_create_or_update( vmss_extension_name: str, extension_parameters: "models.VirtualMachineScaleSetExtension", **kwargs - ) -> "models.VirtualMachineScaleSetExtension": + ) -> AsyncLROPoller["models.VirtualMachineScaleSetExtension"]: """The operation to create or update an extension. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_scale_set_name: The name of the VM scale set where the extension should be create or - updated. + updated. :type vm_scale_set_name: str :param vmss_extension_name: The name of the VM scale set extension. :type vmss_extension_name: str :param extension_parameters: Parameters supplied to the Create VM scale set Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2018_04_01.models.VirtualMachineScaleSetExtension :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. @@ -128,8 +128,8 @@ async def begin_create_or_update( 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: VirtualMachineScaleSetExtension, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_04_01.models.VirtualMachineScaleSetExtension + :return: An instance of AsyncLROPoller that returns either VirtualMachineScaleSetExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineScaleSetExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -181,7 +181,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -202,7 +204,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -222,7 +223,7 @@ async def begin_delete( vm_scale_set_name: str, vmss_extension_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -237,8 +238,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -302,9 +303,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -324,9 +328,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -361,11 +364,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtensionListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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 @@ -379,15 +389,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_virtual_machine_scale_set_rolling_upgrades_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py similarity index 92% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_virtual_machine_scale_set_rolling_upgrades_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index f3ae615f1d4c..33a62bd00a4a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_virtual_machine_scale_set_rolling_upgrades_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -49,7 +49,9 @@ async def _cancel_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -69,7 +71,6 @@ async def _cancel_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -88,7 +89,7 @@ async def begin_cancel( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Cancels the current virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -101,8 +102,8 @@ async def begin_cancel( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -148,7 +149,9 @@ async def _start_os_upgrade_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -168,7 +171,6 @@ async def _start_os_upgrade_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -187,10 +189,10 @@ async def begin_start_os_upgrade( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts a rolling upgrade to move all virtual machine scale set instances to the latest - available Platform Image OS version. Instances which are already running the latest available - OS version are not affected. + available Platform Image OS version. Instances which are already running the latest available + OS version are not affected. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -202,8 +204,8 @@ async def begin_start_os_upgrade( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -260,9 +262,12 @@ async def get_latest( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RollingUpgradeStatusInfo"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.get_latest.metadata['url'] # type: ignore @@ -279,9 +284,8 @@ async def get_latest( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_virtual_machine_scale_set_vms_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_vms_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_virtual_machine_scale_set_vms_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index 806ee064f490..37f18e3b550a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_virtual_machine_scale_set_vms_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,7 +51,9 @@ async def _reimage_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -72,7 +74,6 @@ async def _reimage_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +93,7 @@ async def begin_reimage( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -107,8 +108,8 @@ async def begin_reimage( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -156,7 +157,9 @@ async def _reimage_all_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -177,7 +180,6 @@ async def _reimage_all_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -197,9 +199,9 @@ async def begin_reimage_all( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. - This operation is only supported for managed disks. + This operation is only supported for managed disks. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -213,8 +215,8 @@ async def begin_reimage_all( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -262,7 +264,9 @@ async def _deallocate_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -283,7 +287,6 @@ async def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -303,10 +306,10 @@ async def begin_deallocate( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and - releases the compute resources it uses. You are not billed for the compute resources of this - virtual machine once it is deallocated. + releases the compute resources it uses. You are not billed for the compute resources of this + virtual machine once it is deallocated. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -320,8 +323,8 @@ async def begin_deallocate( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -370,10 +373,13 @@ async def _update_initial( **kwargs ) -> "models.VirtualMachineScaleSetVM": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -392,14 +398,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSetVM') 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 @@ -407,7 +411,6 @@ async def _update_initial( 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('VirtualMachineScaleSetVM', pipeline_response) @@ -427,13 +430,13 @@ async def begin_update( instance_id: str, parameters: "models.VirtualMachineScaleSetVM", **kwargs - ) -> "models.VirtualMachineScaleSetVM": + ) -> AsyncLROPoller["models.VirtualMachineScaleSetVM"]: """Updates a virtual machine of a VM scale set. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_scale_set_name: The name of the VM scale set where the extension should be create or - updated. + updated. :type vm_scale_set_name: str :param instance_id: The instance ID of the virtual machine. :type instance_id: str @@ -445,8 +448,8 @@ async def begin_update( 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: VirtualMachineScaleSetVM, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_04_01.models.VirtualMachineScaleSetVM + :return: An instance of AsyncLROPoller that returns either VirtualMachineScaleSetVM or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineScaleSetVM] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -498,7 +501,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -519,7 +524,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -539,7 +543,7 @@ async def begin_delete( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -554,8 +558,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -616,9 +620,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -636,9 +643,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -676,9 +682,12 @@ async def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -696,9 +705,8 @@ async def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -730,11 +738,14 @@ def list( :type resource_group_name: str :param virtual_machine_scale_set_name: The name of the VM scale set. :type virtual_machine_scale_set_name: str - :param filter: The filter to apply to the operation. + :param filter: The filter to apply to the operation. Allowed values are + 'startswith(instanceView/statuses/code, 'PowerState') eq true', 'properties/latestModelApplied + eq true', 'properties/latestModelApplied eq false'. :type filter: str - :param select: The list parameters. + :param select: The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. :type select: str - :param expand: The expand expression to apply to the operation. + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetVMListResult or the result of cls(response) @@ -742,11 +753,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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 @@ -766,15 +784,11 @@ def prepare_request(next_link=None): query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -809,7 +823,9 @@ async def _power_off_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -830,7 +846,6 @@ async def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -850,10 +865,10 @@ async def begin_power_off( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached - and you are getting charged for the resources. Instead, use deallocate to release resources and - avoid charges. + and you are getting charged for the resources. Instead, use deallocate to release resources and + avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -867,8 +882,8 @@ async def begin_power_off( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -916,7 +931,9 @@ async def _restart_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -937,7 +954,6 @@ async def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -957,7 +973,7 @@ async def begin_restart( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Restarts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -972,8 +988,8 @@ async def begin_restart( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1021,7 +1037,9 @@ async def _start_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -1042,7 +1060,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1062,7 +1079,7 @@ async def begin_start( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1077,8 +1094,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1126,7 +1143,9 @@ async def _redeploy_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -1147,7 +1166,6 @@ async def _redeploy_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1167,9 +1185,9 @@ async def begin_redeploy( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and - powers it back on. + powers it back on. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1183,8 +1201,8 @@ async def begin_redeploy( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1232,7 +1250,9 @@ async def _perform_maintenance_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -1253,7 +1273,6 @@ async def _perform_maintenance_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1273,7 +1292,7 @@ async def begin_perform_maintenance( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Performs maintenance on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1288,8 +1307,8 @@ async def begin_perform_maintenance( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1336,12 +1355,15 @@ async def _run_command_initial( instance_id: str, parameters: "models.RunCommandInput", **kwargs - ) -> "models.RunCommandResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.RunCommandResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" # Construct URL url = self._run_command_initial.metadata['url'] # type: ignore @@ -1360,14 +1382,12 @@ async def _run_command_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RunCommandInput') 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 @@ -1392,7 +1412,7 @@ async def begin_run_command( instance_id: str, parameters: "models.RunCommandInput", **kwargs - ) -> "models.RunCommandResult": + ) -> AsyncLROPoller["models.RunCommandResult"]: """Run command on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1409,8 +1429,8 @@ async def begin_run_command( 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: RunCommandResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_04_01.models.RunCommandResult + :return: An instance of AsyncLROPoller that returns either RunCommandResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_04_01.models.RunCommandResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_virtual_machine_scale_sets_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_sets_operations.py similarity index 92% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_virtual_machine_scale_sets_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_sets_operations.py index 17711d9829f7..94250943027e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_virtual_machine_scale_sets_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachineScaleSet": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSet') 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('VirtualMachineScaleSet', pipeline_response) @@ -106,7 +106,7 @@ async def begin_create_or_update( vm_scale_set_name: str, parameters: "models.VirtualMachineScaleSet", **kwargs - ) -> "models.VirtualMachineScaleSet": + ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -121,8 +121,8 @@ async def begin_create_or_update( 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: VirtualMachineScaleSet, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_04_01.models.VirtualMachineScaleSet + :return: An instance of AsyncLROPoller that returns either VirtualMachineScaleSet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineScaleSet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -173,10 +173,13 @@ async def _update_initial( **kwargs ) -> "models.VirtualMachineScaleSet": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -194,14 +197,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSetUpdate') 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 @@ -223,7 +224,7 @@ async def begin_update( vm_scale_set_name: str, parameters: "models.VirtualMachineScaleSetUpdate", **kwargs - ) -> "models.VirtualMachineScaleSet": + ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: """Update a VM scale set. :param resource_group_name: The name of the resource group. @@ -238,8 +239,8 @@ async def begin_update( 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: VirtualMachineScaleSet, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_04_01.models.VirtualMachineScaleSet + :return: An instance of AsyncLROPoller that returns either VirtualMachineScaleSet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineScaleSet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -289,7 +290,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -309,7 +312,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -328,7 +330,7 @@ async def begin_delete( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VM scale set. :param resource_group_name: The name of the resource group. @@ -341,8 +343,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -399,9 +401,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -418,9 +423,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -445,7 +449,9 @@ async def _deallocate_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") @@ -467,7 +473,6 @@ async def _deallocate_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -475,7 +480,6 @@ async def _deallocate_initial( body_content = None 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 @@ -494,10 +498,10 @@ async def begin_deallocate( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and - releases the compute resources. You are not billed for the compute resources that this virtual - machine scale set deallocates. + releases the compute resources. You are not billed for the compute resources that this virtual + machine scale set deallocates. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -511,8 +515,8 @@ async def begin_deallocate( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -560,7 +564,9 @@ async def _delete_instances_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") @@ -582,12 +588,10 @@ async def _delete_instances_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -606,7 +610,7 @@ async def begin_delete_instances( vm_scale_set_name: str, vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -621,8 +625,8 @@ async def begin_delete_instances( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -680,9 +684,12 @@ async def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -699,9 +706,8 @@ async def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -733,11 +739,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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 @@ -750,15 +763,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -790,8 +799,8 @@ def list_all( **kwargs ) -> AsyncIterable["models.VirtualMachineScaleSetListWithLinkResult"]: """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource - group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this - till nextLink is null to fetch all the VM Scale Sets. + group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this + till nextLink is null to fetch all the VM Scale Sets. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetListWithLinkResult or the result of cls(response) @@ -799,11 +808,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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_all.metadata['url'] # type: ignore @@ -815,15 +831,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -857,7 +869,7 @@ def list_skus( **kwargs ) -> AsyncIterable["models.VirtualMachineScaleSetListSkusResult"]: """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM - instances allowed for each SKU. + instances allowed for each SKU. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -869,11 +881,18 @@ def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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_skus.metadata['url'] # type: ignore @@ -887,15 +906,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -940,11 +955,18 @@ def get_os_upgrade_history( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListOSUpgradeHistory"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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.get_os_upgrade_history.metadata['url'] # type: ignore @@ -958,15 +980,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1001,7 +1019,9 @@ async def _power_off_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") @@ -1023,7 +1043,6 @@ async def _power_off_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1031,7 +1050,6 @@ async def _power_off_initial( body_content = None 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 @@ -1050,10 +1068,10 @@ async def begin_power_off( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still - attached and you are getting charged for the resources. Instead, use deallocate to release - resources and avoid charges. + attached and you are getting charged for the resources. Instead, use deallocate to release + resources and avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1067,8 +1085,8 @@ async def begin_power_off( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1116,7 +1134,9 @@ async def _restart_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") @@ -1138,7 +1158,6 @@ async def _restart_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1146,7 +1165,6 @@ async def _restart_initial( body_content = None 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 @@ -1165,7 +1183,7 @@ async def begin_restart( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Restarts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1180,8 +1198,8 @@ async def begin_restart( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1229,7 +1247,9 @@ async def _start_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") @@ -1251,7 +1271,6 @@ async def _start_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1259,7 +1278,6 @@ async def _start_initial( body_content = None 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 @@ -1278,7 +1296,7 @@ async def begin_start( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1293,8 +1311,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1342,7 +1360,9 @@ async def _redeploy_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") @@ -1364,7 +1384,6 @@ async def _redeploy_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1372,7 +1391,6 @@ async def _redeploy_initial( body_content = None 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 @@ -1391,9 +1409,9 @@ async def begin_redeploy( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, - and powers them back on. + and powers them back on. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1407,8 +1425,8 @@ async def begin_redeploy( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1456,7 +1474,9 @@ async def _perform_maintenance_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") @@ -1478,7 +1498,6 @@ async def _perform_maintenance_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1486,7 +1505,6 @@ async def _perform_maintenance_initial( body_content = None 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 @@ -1505,11 +1523,11 @@ async def begin_perform_maintenance( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances - which are not eligible for perform maintenance will be failed. Please refer to best practices - for more details: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual- - machine-scale-sets-maintenance-notifications. + which are not eligible for perform maintenance will be failed. Please refer to best practices + for more details: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual- + machine-scale-sets-maintenance-notifications. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1523,8 +1541,8 @@ async def begin_perform_maintenance( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1572,7 +1590,9 @@ async def _update_instances_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") @@ -1594,12 +1614,10 @@ async def _update_instances_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -1618,7 +1636,7 @@ async def begin_update_instances( vm_scale_set_name: str, vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. :param resource_group_name: The name of the resource group. @@ -1633,8 +1651,8 @@ async def begin_update_instances( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1682,7 +1700,9 @@ async def _reimage_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") @@ -1704,7 +1724,6 @@ async def _reimage_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1712,7 +1731,6 @@ async def _reimage_initial( body_content = None 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 @@ -1731,7 +1749,7 @@ async def begin_reimage( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1746,8 +1764,8 @@ async def begin_reimage( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1795,7 +1813,9 @@ async def _reimage_all_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") @@ -1817,7 +1837,6 @@ async def _reimage_all_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1825,7 +1844,6 @@ async def _reimage_all_initial( body_content = None 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 @@ -1844,9 +1862,9 @@ async def begin_reimage_all( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This - operation is only supported for managed disks. + operation is only supported for managed disks. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1860,8 +1878,8 @@ async def begin_reimage_all( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1924,9 +1942,12 @@ async def force_recovery_service_fabric_platform_update_domain_walk( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RecoveryWalkResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.force_recovery_service_fabric_platform_update_domain_walk.metadata['url'] # type: ignore @@ -1944,9 +1965,8 @@ async def force_recovery_service_fabric_platform_update_domain_walk( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_virtual_machine_sizes_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_sizes_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_virtual_machine_sizes_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_sizes_operations.py index 7e6bbb347437..96cdb97e69b7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_virtual_machine_sizes_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_sizes_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,11 +56,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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 @@ -73,15 +80,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_virtual_machines_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machines_operations.py similarity index 90% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_virtual_machines_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machines_operations.py index b627ccd3e4ff..49596af1595b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/_virtual_machines_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machines_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -58,11 +58,18 @@ def list_by_location( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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_location.metadata['url'] # type: ignore @@ -75,15 +82,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -116,12 +119,15 @@ async def _capture_initial( vm_name: str, parameters: "models.VirtualMachineCaptureParameters", **kwargs - ) -> "models.VirtualMachineCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.VirtualMachineCaptureResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._capture_initial.metadata['url'] # type: ignore @@ -139,14 +145,12 @@ async def _capture_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineCaptureParameters') 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 @@ -170,9 +174,9 @@ async def begin_capture( vm_name: str, parameters: "models.VirtualMachineCaptureParameters", **kwargs - ) -> "models.VirtualMachineCaptureResult": + ) -> AsyncLROPoller["models.VirtualMachineCaptureResult"]: """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used - to create similar VMs. + to create similar VMs. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -186,8 +190,8 @@ async def begin_capture( 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: VirtualMachineCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_04_01.models.VirtualMachineCaptureResult + :return: An instance of AsyncLROPoller that returns either VirtualMachineCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineCaptureResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -238,10 +242,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachine": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -259,14 +266,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachine') 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 @@ -274,7 +279,6 @@ async def _create_or_update_initial( 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('VirtualMachine', pipeline_response) @@ -293,7 +297,7 @@ async def begin_create_or_update( vm_name: str, parameters: "models.VirtualMachine", **kwargs - ) -> "models.VirtualMachine": + ) -> AsyncLROPoller["models.VirtualMachine"]: """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -308,8 +312,8 @@ async def begin_create_or_update( 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: VirtualMachine, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_04_01.models.VirtualMachine + :return: An instance of AsyncLROPoller that returns either VirtualMachine or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_04_01.models.VirtualMachine] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,10 +364,13 @@ async def _update_initial( **kwargs ) -> "models.VirtualMachine": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -381,14 +388,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineUpdate') 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 @@ -396,7 +401,6 @@ async def _update_initial( 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('VirtualMachine', pipeline_response) @@ -415,7 +419,7 @@ async def begin_update( vm_name: str, parameters: "models.VirtualMachineUpdate", **kwargs - ) -> "models.VirtualMachine": + ) -> AsyncLROPoller["models.VirtualMachine"]: """The operation to update a virtual machine. :param resource_group_name: The name of the resource group. @@ -430,8 +434,8 @@ async def begin_update( 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: VirtualMachine, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_04_01.models.VirtualMachine + :return: An instance of AsyncLROPoller that returns either VirtualMachine or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_04_01.models.VirtualMachine] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -481,7 +485,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -501,7 +507,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -520,7 +525,7 @@ async def begin_delete( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to delete a virtual machine. :param resource_group_name: The name of the resource group. @@ -533,8 +538,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -594,9 +599,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -615,9 +623,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -652,9 +659,12 @@ async def instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.instance_view.metadata['url'] # type: ignore @@ -671,9 +681,8 @@ async def instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -697,7 +706,9 @@ async def _convert_to_managed_disks_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -717,7 +728,6 @@ async def _convert_to_managed_disks_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -736,9 +746,9 @@ async def begin_convert_to_managed_disks( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop- - deallocated before invoking this operation. + deallocated before invoking this operation. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -750,8 +760,8 @@ async def begin_convert_to_managed_disks( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -797,7 +807,9 @@ async def _deallocate_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -817,7 +829,6 @@ async def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -836,9 +847,9 @@ async def begin_deallocate( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Shuts down the virtual machine and releases the compute resources. You are not billed for the - compute resources that this virtual machine uses. + compute resources that this virtual machine uses. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -850,8 +861,8 @@ async def begin_deallocate( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -908,7 +919,9 @@ async def generalize( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -928,7 +941,6 @@ async def generalize( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -948,7 +960,7 @@ def list( **kwargs ) -> AsyncIterable["models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified resource group. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -958,11 +970,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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 @@ -975,15 +994,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1015,7 +1030,7 @@ def list_all( **kwargs ) -> AsyncIterable["models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified subscription. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineListResult or the result of cls(response) @@ -1023,11 +1038,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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_all.metadata['url'] # type: ignore @@ -1039,15 +1061,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1081,7 +1099,7 @@ def list_available_sizes( **kwargs ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes to which the specified virtual machine can be - resized. + resized. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1093,11 +1111,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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_available_sizes.metadata['url'] # type: ignore @@ -1111,15 +1136,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1153,7 +1174,9 @@ async def _power_off_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -1173,7 +1196,6 @@ async def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1192,9 +1214,9 @@ async def begin_power_off( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with - the same provisioned resources. You are still charged for this virtual machine. + the same provisioned resources. You are still charged for this virtual machine. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1206,8 +1228,8 @@ async def begin_power_off( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1253,7 +1275,9 @@ async def _restart_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -1273,7 +1297,6 @@ async def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1292,7 +1315,7 @@ async def begin_restart( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to restart a virtual machine. :param resource_group_name: The name of the resource group. @@ -1305,8 +1328,8 @@ async def begin_restart( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1352,7 +1375,9 @@ async def _start_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -1372,7 +1397,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1391,7 +1415,7 @@ async def begin_start( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to start a virtual machine. :param resource_group_name: The name of the resource group. @@ -1404,8 +1428,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1451,7 +1475,9 @@ async def _redeploy_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -1471,7 +1497,6 @@ async def _redeploy_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1490,7 +1515,7 @@ async def begin_redeploy( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Shuts down the virtual machine, moves it to a new node, and powers it back on. :param resource_group_name: The name of the resource group. @@ -1503,8 +1528,8 @@ async def begin_redeploy( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1550,7 +1575,9 @@ async def _perform_maintenance_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -1570,7 +1597,6 @@ async def _perform_maintenance_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1589,7 +1615,7 @@ async def begin_perform_maintenance( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to perform maintenance on a virtual machine. :param resource_group_name: The name of the resource group. @@ -1602,8 +1628,8 @@ async def begin_perform_maintenance( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1648,12 +1674,15 @@ async def _run_command_initial( vm_name: str, parameters: "models.RunCommandInput", **kwargs - ) -> "models.RunCommandResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.RunCommandResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" # Construct URL url = self._run_command_initial.metadata['url'] # type: ignore @@ -1671,14 +1700,12 @@ async def _run_command_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RunCommandInput') 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 @@ -1702,7 +1729,7 @@ async def begin_run_command( vm_name: str, parameters: "models.RunCommandInput", **kwargs - ) -> "models.RunCommandResult": + ) -> AsyncLROPoller["models.RunCommandResult"]: """Run command on the VM. :param resource_group_name: The name of the resource group. @@ -1717,8 +1744,8 @@ async def begin_run_command( 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: RunCommandResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_04_01.models.RunCommandResult + :return: An instance of AsyncLROPoller that returns either RunCommandResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_04_01.models.RunCommandResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/__init__.py deleted file mode 100644 index 5269f3450b5a..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations_async/__init__.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 ._operations_async import Operations -from ._availability_sets_operations_async import AvailabilitySetsOperations -from ._proximity_placement_groups_operations_async import ProximityPlacementGroupsOperations -from ._virtual_machine_extension_images_operations_async import VirtualMachineExtensionImagesOperations -from ._virtual_machine_extensions_operations_async import VirtualMachineExtensionsOperations -from ._virtual_machine_images_operations_async import VirtualMachineImagesOperations -from ._usage_operations_async import UsageOperations -from ._virtual_machines_operations_async import VirtualMachinesOperations -from ._virtual_machine_sizes_operations_async import VirtualMachineSizesOperations -from ._images_operations_async import ImagesOperations -from ._virtual_machine_scale_sets_operations_async import VirtualMachineScaleSetsOperations -from ._virtual_machine_scale_set_extensions_operations_async import VirtualMachineScaleSetExtensionsOperations -from ._virtual_machine_scale_set_rolling_upgrades_operations_async import VirtualMachineScaleSetRollingUpgradesOperations -from ._virtual_machine_scale_set_vms_operations_async import VirtualMachineScaleSetVMsOperations -from ._log_analytics_operations_async import LogAnalyticsOperations -from ._virtual_machine_run_commands_operations_async import VirtualMachineRunCommandsOperations -from ._disks_operations_async import DisksOperations -from ._snapshots_operations_async import SnapshotsOperations - -__all__ = [ - 'Operations', - 'AvailabilitySetsOperations', - 'ProximityPlacementGroupsOperations', - 'VirtualMachineExtensionImagesOperations', - 'VirtualMachineExtensionsOperations', - 'VirtualMachineImagesOperations', - 'UsageOperations', - 'VirtualMachinesOperations', - 'VirtualMachineSizesOperations', - 'ImagesOperations', - 'VirtualMachineScaleSetsOperations', - 'VirtualMachineScaleSetExtensionsOperations', - 'VirtualMachineScaleSetRollingUpgradesOperations', - 'VirtualMachineScaleSetVMsOperations', - 'LogAnalyticsOperations', - 'VirtualMachineRunCommandsOperations', - 'DisksOperations', - 'SnapshotsOperations', -] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/_compute_management_client_enums.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/_compute_management_client_enums.py index f6e855b55c6f..08f083852619 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/_compute_management_client_enums.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/_compute_management_client_enums.py @@ -6,36 +6,54 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum +from enum import Enum, EnumMeta +from six import with_metaclass -class AccessLevel(str, Enum): +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) - none = "None" - read = "Read" + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) -class CachingTypes(str, Enum): + +class AccessLevel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + NONE = "None" + READ = "Read" + +class CachingTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the caching requirements. :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **None** :code:`
`:code:`
` **ReadOnly** :code:`
`:code:`
` **ReadWrite** :code:`
`:code:`
` Default: **None for Standard storage. ReadOnly for Premium storage** """ - none = "None" - read_only = "ReadOnly" - read_write = "ReadWrite" + NONE = "None" + READ_ONLY = "ReadOnly" + READ_WRITE = "ReadWrite" -class DiskCreateOption(str, Enum): +class DiskCreateOption(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """This enumerates the possible sources of a disk's creation. """ - empty = "Empty" - attach = "Attach" - from_image = "FromImage" - import_enum = "Import" - copy = "Copy" - restore = "Restore" + EMPTY = "Empty" + ATTACH = "Attach" + FROM_IMAGE = "FromImage" + IMPORT_ENUM = "Import" + COPY = "Copy" + RESTORE = "Restore" -class DiskCreateOptionTypes(str, Enum): +class DiskCreateOptionTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies how the virtual machine should be created.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` **Attach** \u2013 This value is used when you are using a specialized disk to create the virtual machine.:code:`
`:code:`
` **FromImage** \u2013 @@ -44,130 +62,130 @@ class DiskCreateOptionTypes(str, Enum): marketplace image, you also use the plan element previously described. """ - from_image = "FromImage" - empty = "Empty" - attach = "Attach" + FROM_IMAGE = "FromImage" + EMPTY = "Empty" + ATTACH = "Attach" -class IntervalInMins(str, Enum): +class IntervalInMins(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Interval value in minutes used to create LogAnalytics call rate logs. """ - three_mins = "ThreeMins" - five_mins = "FiveMins" - thirty_mins = "ThirtyMins" - sixty_mins = "SixtyMins" + THREE_MINS = "ThreeMins" + FIVE_MINS = "FiveMins" + THIRTY_MINS = "ThirtyMins" + SIXTY_MINS = "SixtyMins" -class IPVersion(str, Enum): +class IPVersion(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. """ - i_pv4 = "IPv4" - i_pv6 = "IPv6" + I_PV4 = "IPv4" + I_PV6 = "IPv6" -class MaintenanceOperationResultCodeTypes(str, Enum): +class MaintenanceOperationResultCodeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The Last Maintenance Operation Result Code. """ - none = "None" - retry_later = "RetryLater" - maintenance_aborted = "MaintenanceAborted" - maintenance_completed = "MaintenanceCompleted" + NONE = "None" + RETRY_LATER = "RetryLater" + MAINTENANCE_ABORTED = "MaintenanceAborted" + MAINTENANCE_COMPLETED = "MaintenanceCompleted" -class OperatingSystemStateTypes(str, Enum): +class OperatingSystemStateTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The OS State. """ - generalized = "Generalized" - specialized = "Specialized" + GENERALIZED = "Generalized" + SPECIALIZED = "Specialized" -class OperatingSystemTypes(str, Enum): +class OperatingSystemTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The operating system of the osDiskImage. """ - windows = "Windows" - linux = "Linux" + WINDOWS = "Windows" + LINUX = "Linux" -class ProtocolTypes(str, Enum): +class ProtocolTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the protocol of listener. :code:`
`:code:`
` Possible values are: :code:`
`\ **http** :code:`
`:code:`
` **https** """ - http = "Http" - https = "Https" + HTTP = "Http" + HTTPS = "Https" -class ProximityPlacementGroupType(str, Enum): +class ProximityPlacementGroupType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the type of the proximity placement group. :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **Standard** : Co-locate resources within an Azure region or Availability Zone. :code:`
`:code:`
` **Ultra** : For future use. """ - standard = "Standard" - ultra = "Ultra" + STANDARD = "Standard" + ULTRA = "Ultra" -class ResourceIdentityType(str, Enum): +class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The type of identity used for the virtual machine. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine. """ - system_assigned = "SystemAssigned" - user_assigned = "UserAssigned" - system_assigned_user_assigned = "SystemAssigned, UserAssigned" - none = "None" + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned, UserAssigned" + NONE = "None" -class RollingUpgradeActionType(str, Enum): +class RollingUpgradeActionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The last action performed on the rolling upgrade. """ - start = "Start" - cancel = "Cancel" + START = "Start" + CANCEL = "Cancel" -class RollingUpgradeStatusCode(str, Enum): +class RollingUpgradeStatusCode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Code indicating the current status of the upgrade. """ - rolling_forward = "RollingForward" - cancelled = "Cancelled" - completed = "Completed" - faulted = "Faulted" + ROLLING_FORWARD = "RollingForward" + CANCELLED = "Cancelled" + COMPLETED = "Completed" + FAULTED = "Faulted" -class SettingNames(str, Enum): +class SettingNames(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon. """ - auto_logon = "AutoLogon" - first_logon_commands = "FirstLogonCommands" + AUTO_LOGON = "AutoLogon" + FIRST_LOGON_COMMANDS = "FirstLogonCommands" -class SnapshotStorageAccountTypes(str, Enum): +class SnapshotStorageAccountTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The sku name. """ - standard_lrs = "Standard_LRS" - premium_lrs = "Premium_LRS" - standard_zrs = "Standard_ZRS" + STANDARD_LRS = "Standard_LRS" + PREMIUM_LRS = "Premium_LRS" + STANDARD_ZRS = "Standard_ZRS" -class StatusLevelTypes(str, Enum): +class StatusLevelTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The level code. """ - info = "Info" - warning = "Warning" - error = "Error" + INFO = "Info" + WARNING = "Warning" + ERROR = "Error" -class StorageAccountTypes(str, Enum): +class StorageAccountTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the storage account type for the managed disk. Possible values are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. NOTE: Managed OS disk storage account type can only be set when you create the scale set. """ - standard_lrs = "Standard_LRS" - premium_lrs = "Premium_LRS" - standard_ssd_lrs = "StandardSSD_LRS" + STANDARD_LRS = "Standard_LRS" + PREMIUM_LRS = "Premium_LRS" + STANDARD_SSD_LRS = "StandardSSD_LRS" -class UpgradeMode(str, Enum): +class UpgradeMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the mode of an upgrade to virtual machines in the scale set.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` **Manual** - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade @@ -175,51 +193,51 @@ class UpgradeMode(str, Enum): automatically updated at the same time. """ - automatic = "Automatic" - manual = "Manual" - rolling = "Rolling" + AUTOMATIC = "Automatic" + MANUAL = "Manual" + ROLLING = "Rolling" -class UpgradeOperationInvoker(str, Enum): +class UpgradeOperationInvoker(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Invoker of the Upgrade Operation """ - unknown = "Unknown" - user = "User" - platform = "Platform" + UNKNOWN = "Unknown" + USER = "User" + PLATFORM = "Platform" -class UpgradeState(str, Enum): +class UpgradeState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Code indicating the current status of the upgrade. """ - rolling_forward = "RollingForward" - cancelled = "Cancelled" - completed = "Completed" - faulted = "Faulted" + ROLLING_FORWARD = "RollingForward" + CANCELLED = "Cancelled" + COMPLETED = "Completed" + FAULTED = "Faulted" -class VirtualMachineEvictionPolicyTypes(str, Enum): +class VirtualMachineEvictionPolicyTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the eviction policy for virtual machines in a low priority scale set. :code:`
`:code:`
`Minimum api-version: 2017-10-30-preview """ - deallocate = "Deallocate" - delete = "Delete" + DEALLOCATE = "Deallocate" + DELETE = "Delete" -class VirtualMachinePriorityTypes(str, Enum): +class VirtualMachinePriorityTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the priority for the virtual machines in the scale set. :code:`
`:code:`
`Minimum api-version: 2017-10-30-preview """ - regular = "Regular" - low = "Low" + REGULAR = "Regular" + LOW = "Low" -class VirtualMachineScaleSetSkuScaleType(str, Enum): +class VirtualMachineScaleSetSkuScaleType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The scale type applicable to the sku. """ - automatic = "Automatic" - none = "None" + AUTOMATIC = "Automatic" + NONE = "None" -class VirtualMachineSizeTypes(str, Enum): +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 `_. @@ -233,169 +251,169 @@ class VirtualMachineSizeTypes(str, Enum): `_ """ - basic_a0 = "Basic_A0" - basic_a1 = "Basic_A1" - basic_a2 = "Basic_A2" - basic_a3 = "Basic_A3" - basic_a4 = "Basic_A4" - standard_a0 = "Standard_A0" - standard_a1 = "Standard_A1" - standard_a2 = "Standard_A2" - standard_a3 = "Standard_A3" - standard_a4 = "Standard_A4" - standard_a5 = "Standard_A5" - standard_a6 = "Standard_A6" - standard_a7 = "Standard_A7" - standard_a8 = "Standard_A8" - standard_a9 = "Standard_A9" - standard_a10 = "Standard_A10" - standard_a11 = "Standard_A11" - standard_a1_v2 = "Standard_A1_v2" - standard_a2_v2 = "Standard_A2_v2" - standard_a4_v2 = "Standard_A4_v2" - standard_a8_v2 = "Standard_A8_v2" - standard_a2_m_v2 = "Standard_A2m_v2" - standard_a4_m_v2 = "Standard_A4m_v2" - standard_a8_m_v2 = "Standard_A8m_v2" - standard_b1_s = "Standard_B1s" - standard_b1_ms = "Standard_B1ms" - standard_b2_s = "Standard_B2s" - standard_b2_ms = "Standard_B2ms" - standard_b4_ms = "Standard_B4ms" - standard_b8_ms = "Standard_B8ms" - standard_d1 = "Standard_D1" - standard_d2 = "Standard_D2" - standard_d3 = "Standard_D3" - standard_d4 = "Standard_D4" - standard_d11 = "Standard_D11" - standard_d12 = "Standard_D12" - standard_d13 = "Standard_D13" - standard_d14 = "Standard_D14" - standard_d1_v2 = "Standard_D1_v2" - standard_d2_v2 = "Standard_D2_v2" - standard_d3_v2 = "Standard_D3_v2" - standard_d4_v2 = "Standard_D4_v2" - standard_d5_v2 = "Standard_D5_v2" - standard_d2_v3 = "Standard_D2_v3" - standard_d4_v3 = "Standard_D4_v3" - standard_d8_v3 = "Standard_D8_v3" - standard_d16_v3 = "Standard_D16_v3" - standard_d32_v3 = "Standard_D32_v3" - standard_d64_v3 = "Standard_D64_v3" - standard_d2_s_v3 = "Standard_D2s_v3" - standard_d4_s_v3 = "Standard_D4s_v3" - standard_d8_s_v3 = "Standard_D8s_v3" - standard_d16_s_v3 = "Standard_D16s_v3" - standard_d32_s_v3 = "Standard_D32s_v3" - standard_d64_s_v3 = "Standard_D64s_v3" - standard_d11_v2 = "Standard_D11_v2" - standard_d12_v2 = "Standard_D12_v2" - standard_d13_v2 = "Standard_D13_v2" - standard_d14_v2 = "Standard_D14_v2" - standard_d15_v2 = "Standard_D15_v2" - standard_ds1 = "Standard_DS1" - standard_ds2 = "Standard_DS2" - standard_ds3 = "Standard_DS3" - standard_ds4 = "Standard_DS4" - standard_ds11 = "Standard_DS11" - standard_ds12 = "Standard_DS12" - standard_ds13 = "Standard_DS13" - standard_ds14 = "Standard_DS14" - standard_ds1_v2 = "Standard_DS1_v2" - standard_ds2_v2 = "Standard_DS2_v2" - standard_ds3_v2 = "Standard_DS3_v2" - standard_ds4_v2 = "Standard_DS4_v2" - standard_ds5_v2 = "Standard_DS5_v2" - standard_ds11_v2 = "Standard_DS11_v2" - standard_ds12_v2 = "Standard_DS12_v2" - standard_ds13_v2 = "Standard_DS13_v2" - standard_ds14_v2 = "Standard_DS14_v2" - standard_ds15_v2 = "Standard_DS15_v2" - standard_ds13_4_v2 = "Standard_DS13-4_v2" - standard_ds13_2_v2 = "Standard_DS13-2_v2" - standard_ds14_8_v2 = "Standard_DS14-8_v2" - standard_ds14_4_v2 = "Standard_DS14-4_v2" - standard_e2_v3 = "Standard_E2_v3" - standard_e4_v3 = "Standard_E4_v3" - standard_e8_v3 = "Standard_E8_v3" - standard_e16_v3 = "Standard_E16_v3" - standard_e32_v3 = "Standard_E32_v3" - standard_e64_v3 = "Standard_E64_v3" - standard_e2_s_v3 = "Standard_E2s_v3" - standard_e4_s_v3 = "Standard_E4s_v3" - standard_e8_s_v3 = "Standard_E8s_v3" - standard_e16_s_v3 = "Standard_E16s_v3" - standard_e32_s_v3 = "Standard_E32s_v3" - standard_e64_s_v3 = "Standard_E64s_v3" - standard_e32_16_v3 = "Standard_E32-16_v3" - standard_e32_8_s_v3 = "Standard_E32-8s_v3" - standard_e64_32_s_v3 = "Standard_E64-32s_v3" - standard_e64_16_s_v3 = "Standard_E64-16s_v3" - standard_f1 = "Standard_F1" - standard_f2 = "Standard_F2" - standard_f4 = "Standard_F4" - standard_f8 = "Standard_F8" - standard_f16 = "Standard_F16" - standard_f1_s = "Standard_F1s" - standard_f2_s = "Standard_F2s" - standard_f4_s = "Standard_F4s" - standard_f8_s = "Standard_F8s" - standard_f16_s = "Standard_F16s" - standard_f2_s_v2 = "Standard_F2s_v2" - standard_f4_s_v2 = "Standard_F4s_v2" - standard_f8_s_v2 = "Standard_F8s_v2" - standard_f16_s_v2 = "Standard_F16s_v2" - standard_f32_s_v2 = "Standard_F32s_v2" - standard_f64_s_v2 = "Standard_F64s_v2" - standard_f72_s_v2 = "Standard_F72s_v2" - standard_g1 = "Standard_G1" - standard_g2 = "Standard_G2" - standard_g3 = "Standard_G3" - standard_g4 = "Standard_G4" - standard_g5 = "Standard_G5" - standard_gs1 = "Standard_GS1" - standard_gs2 = "Standard_GS2" - standard_gs3 = "Standard_GS3" - standard_gs4 = "Standard_GS4" - standard_gs5 = "Standard_GS5" - standard_gs4_8 = "Standard_GS4-8" - standard_gs4_4 = "Standard_GS4-4" - standard_gs5_16 = "Standard_GS5-16" - standard_gs5_8 = "Standard_GS5-8" - standard_h8 = "Standard_H8" - standard_h16 = "Standard_H16" - standard_h8_m = "Standard_H8m" - standard_h16_m = "Standard_H16m" - standard_h16_r = "Standard_H16r" - standard_h16_mr = "Standard_H16mr" - standard_l4_s = "Standard_L4s" - standard_l8_s = "Standard_L8s" - standard_l16_s = "Standard_L16s" - standard_l32_s = "Standard_L32s" - standard_m64_s = "Standard_M64s" - standard_m64_ms = "Standard_M64ms" - standard_m128_s = "Standard_M128s" - standard_m128_ms = "Standard_M128ms" - standard_m64_32_ms = "Standard_M64-32ms" - standard_m64_16_ms = "Standard_M64-16ms" - standard_m128_64_ms = "Standard_M128-64ms" - standard_m128_32_ms = "Standard_M128-32ms" - standard_nc6 = "Standard_NC6" - standard_nc12 = "Standard_NC12" - standard_nc24 = "Standard_NC24" - standard_nc24_r = "Standard_NC24r" - standard_nc6_s_v2 = "Standard_NC6s_v2" - standard_nc12_s_v2 = "Standard_NC12s_v2" - standard_nc24_s_v2 = "Standard_NC24s_v2" - standard_nc24_rs_v2 = "Standard_NC24rs_v2" - standard_nc6_s_v3 = "Standard_NC6s_v3" - standard_nc12_s_v3 = "Standard_NC12s_v3" - standard_nc24_s_v3 = "Standard_NC24s_v3" - standard_nc24_rs_v3 = "Standard_NC24rs_v3" - standard_nd6_s = "Standard_ND6s" - standard_nd12_s = "Standard_ND12s" - standard_nd24_s = "Standard_ND24s" - standard_nd24_rs = "Standard_ND24rs" - standard_nv6 = "Standard_NV6" - standard_nv12 = "Standard_NV12" - standard_nv24 = "Standard_NV24" + BASIC_A0 = "Basic_A0" + BASIC_A1 = "Basic_A1" + BASIC_A2 = "Basic_A2" + BASIC_A3 = "Basic_A3" + BASIC_A4 = "Basic_A4" + STANDARD_A0 = "Standard_A0" + STANDARD_A1 = "Standard_A1" + STANDARD_A2 = "Standard_A2" + STANDARD_A3 = "Standard_A3" + STANDARD_A4 = "Standard_A4" + STANDARD_A5 = "Standard_A5" + STANDARD_A6 = "Standard_A6" + STANDARD_A7 = "Standard_A7" + STANDARD_A8 = "Standard_A8" + STANDARD_A9 = "Standard_A9" + STANDARD_A10 = "Standard_A10" + STANDARD_A11 = "Standard_A11" + STANDARD_A1_V2 = "Standard_A1_v2" + STANDARD_A2_V2 = "Standard_A2_v2" + STANDARD_A4_V2 = "Standard_A4_v2" + STANDARD_A8_V2 = "Standard_A8_v2" + STANDARD_A2_M_V2 = "Standard_A2m_v2" + STANDARD_A4_M_V2 = "Standard_A4m_v2" + STANDARD_A8_M_V2 = "Standard_A8m_v2" + STANDARD_B1_S = "Standard_B1s" + STANDARD_B1_MS = "Standard_B1ms" + STANDARD_B2_S = "Standard_B2s" + STANDARD_B2_MS = "Standard_B2ms" + STANDARD_B4_MS = "Standard_B4ms" + STANDARD_B8_MS = "Standard_B8ms" + STANDARD_D1 = "Standard_D1" + STANDARD_D2 = "Standard_D2" + STANDARD_D3 = "Standard_D3" + STANDARD_D4 = "Standard_D4" + STANDARD_D11 = "Standard_D11" + STANDARD_D12 = "Standard_D12" + STANDARD_D13 = "Standard_D13" + STANDARD_D14 = "Standard_D14" + STANDARD_D1_V2 = "Standard_D1_v2" + STANDARD_D2_V2 = "Standard_D2_v2" + STANDARD_D3_V2 = "Standard_D3_v2" + STANDARD_D4_V2 = "Standard_D4_v2" + STANDARD_D5_V2 = "Standard_D5_v2" + STANDARD_D2_V3 = "Standard_D2_v3" + STANDARD_D4_V3 = "Standard_D4_v3" + STANDARD_D8_V3 = "Standard_D8_v3" + STANDARD_D16_V3 = "Standard_D16_v3" + STANDARD_D32_V3 = "Standard_D32_v3" + STANDARD_D64_V3 = "Standard_D64_v3" + STANDARD_D2_S_V3 = "Standard_D2s_v3" + STANDARD_D4_S_V3 = "Standard_D4s_v3" + STANDARD_D8_S_V3 = "Standard_D8s_v3" + STANDARD_D16_S_V3 = "Standard_D16s_v3" + STANDARD_D32_S_V3 = "Standard_D32s_v3" + STANDARD_D64_S_V3 = "Standard_D64s_v3" + STANDARD_D11_V2 = "Standard_D11_v2" + STANDARD_D12_V2 = "Standard_D12_v2" + STANDARD_D13_V2 = "Standard_D13_v2" + STANDARD_D14_V2 = "Standard_D14_v2" + STANDARD_D15_V2 = "Standard_D15_v2" + STANDARD_DS1 = "Standard_DS1" + STANDARD_DS2 = "Standard_DS2" + STANDARD_DS3 = "Standard_DS3" + STANDARD_DS4 = "Standard_DS4" + STANDARD_DS11 = "Standard_DS11" + STANDARD_DS12 = "Standard_DS12" + STANDARD_DS13 = "Standard_DS13" + STANDARD_DS14 = "Standard_DS14" + STANDARD_DS1_V2 = "Standard_DS1_v2" + STANDARD_DS2_V2 = "Standard_DS2_v2" + STANDARD_DS3_V2 = "Standard_DS3_v2" + STANDARD_DS4_V2 = "Standard_DS4_v2" + STANDARD_DS5_V2 = "Standard_DS5_v2" + STANDARD_DS11_V2 = "Standard_DS11_v2" + STANDARD_DS12_V2 = "Standard_DS12_v2" + STANDARD_DS13_V2 = "Standard_DS13_v2" + STANDARD_DS14_V2 = "Standard_DS14_v2" + STANDARD_DS15_V2 = "Standard_DS15_v2" + STANDARD_DS13_4_V2 = "Standard_DS13-4_v2" + STANDARD_DS13_2_V2 = "Standard_DS13-2_v2" + STANDARD_DS14_8_V2 = "Standard_DS14-8_v2" + STANDARD_DS14_4_V2 = "Standard_DS14-4_v2" + STANDARD_E2_V3 = "Standard_E2_v3" + STANDARD_E4_V3 = "Standard_E4_v3" + STANDARD_E8_V3 = "Standard_E8_v3" + STANDARD_E16_V3 = "Standard_E16_v3" + STANDARD_E32_V3 = "Standard_E32_v3" + STANDARD_E64_V3 = "Standard_E64_v3" + STANDARD_E2_S_V3 = "Standard_E2s_v3" + STANDARD_E4_S_V3 = "Standard_E4s_v3" + STANDARD_E8_S_V3 = "Standard_E8s_v3" + STANDARD_E16_S_V3 = "Standard_E16s_v3" + STANDARD_E32_S_V3 = "Standard_E32s_v3" + STANDARD_E64_S_V3 = "Standard_E64s_v3" + STANDARD_E32_16_V3 = "Standard_E32-16_v3" + STANDARD_E32_8_S_V3 = "Standard_E32-8s_v3" + STANDARD_E64_32_S_V3 = "Standard_E64-32s_v3" + STANDARD_E64_16_S_V3 = "Standard_E64-16s_v3" + STANDARD_F1 = "Standard_F1" + STANDARD_F2 = "Standard_F2" + STANDARD_F4 = "Standard_F4" + STANDARD_F8 = "Standard_F8" + STANDARD_F16 = "Standard_F16" + STANDARD_F1_S = "Standard_F1s" + STANDARD_F2_S = "Standard_F2s" + STANDARD_F4_S = "Standard_F4s" + STANDARD_F8_S = "Standard_F8s" + STANDARD_F16_S = "Standard_F16s" + STANDARD_F2_S_V2 = "Standard_F2s_v2" + STANDARD_F4_S_V2 = "Standard_F4s_v2" + STANDARD_F8_S_V2 = "Standard_F8s_v2" + STANDARD_F16_S_V2 = "Standard_F16s_v2" + STANDARD_F32_S_V2 = "Standard_F32s_v2" + STANDARD_F64_S_V2 = "Standard_F64s_v2" + STANDARD_F72_S_V2 = "Standard_F72s_v2" + STANDARD_G1 = "Standard_G1" + STANDARD_G2 = "Standard_G2" + STANDARD_G3 = "Standard_G3" + STANDARD_G4 = "Standard_G4" + STANDARD_G5 = "Standard_G5" + STANDARD_GS1 = "Standard_GS1" + STANDARD_GS2 = "Standard_GS2" + STANDARD_GS3 = "Standard_GS3" + STANDARD_GS4 = "Standard_GS4" + STANDARD_GS5 = "Standard_GS5" + STANDARD_GS4_8 = "Standard_GS4-8" + STANDARD_GS4_4 = "Standard_GS4-4" + STANDARD_GS5_16 = "Standard_GS5-16" + STANDARD_GS5_8 = "Standard_GS5-8" + STANDARD_H8 = "Standard_H8" + STANDARD_H16 = "Standard_H16" + STANDARD_H8_M = "Standard_H8m" + STANDARD_H16_M = "Standard_H16m" + STANDARD_H16_R = "Standard_H16r" + STANDARD_H16_MR = "Standard_H16mr" + STANDARD_L4_S = "Standard_L4s" + STANDARD_L8_S = "Standard_L8s" + STANDARD_L16_S = "Standard_L16s" + STANDARD_L32_S = "Standard_L32s" + STANDARD_M64_S = "Standard_M64s" + STANDARD_M64_MS = "Standard_M64ms" + STANDARD_M128_S = "Standard_M128s" + STANDARD_M128_MS = "Standard_M128ms" + STANDARD_M64_32_MS = "Standard_M64-32ms" + STANDARD_M64_16_MS = "Standard_M64-16ms" + STANDARD_M128_64_MS = "Standard_M128-64ms" + STANDARD_M128_32_MS = "Standard_M128-32ms" + STANDARD_NC6 = "Standard_NC6" + STANDARD_NC12 = "Standard_NC12" + STANDARD_NC24 = "Standard_NC24" + STANDARD_NC24_R = "Standard_NC24r" + STANDARD_NC6_S_V2 = "Standard_NC6s_v2" + STANDARD_NC12_S_V2 = "Standard_NC12s_v2" + STANDARD_NC24_S_V2 = "Standard_NC24s_v2" + STANDARD_NC24_RS_V2 = "Standard_NC24rs_v2" + STANDARD_NC6_S_V3 = "Standard_NC6s_v3" + STANDARD_NC12_S_V3 = "Standard_NC12s_v3" + STANDARD_NC24_S_V3 = "Standard_NC24s_v3" + STANDARD_NC24_RS_V3 = "Standard_NC24rs_v3" + STANDARD_ND6_S = "Standard_ND6s" + STANDARD_ND12_S = "Standard_ND12s" + STANDARD_ND24_S = "Standard_ND24s" + STANDARD_ND24_RS = "Standard_ND24rs" + STANDARD_NV6 = "Standard_NV6" + STANDARD_NV12 = "Standard_NV12" + STANDARD_NV24 = "Standard_NV24" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_availability_sets_operations.py index 920a1248948a..eae7943fee83 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_availability_sets_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -67,10 +67,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -88,14 +91,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailabilitySet') 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 @@ -133,10 +134,13 @@ def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -154,14 +158,12 @@ def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailabilitySetUpdate') 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 @@ -196,7 +198,9 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -216,7 +220,6 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,9 +252,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -268,9 +274,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -295,7 +300,8 @@ def list_by_subscription( # type: (...) -> Iterable["models.AvailabilitySetListResult"] """Lists all availability sets in a subscription. - :param expand: The expand expression to apply to the operation. + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AvailabilitySetListResult or the result of cls(response) @@ -303,11 +309,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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_subscription.metadata['url'] # type: ignore @@ -321,15 +334,11 @@ def prepare_request(next_link=None): if expand is not None: query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -372,11 +381,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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 @@ -389,15 +405,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -432,7 +444,7 @@ def list_available_sizes( ): # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes that can be used to create a new virtual machine in - an existing availability set. + an existing availability set. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -444,11 +456,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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_available_sizes.metadata['url'] # type: ignore @@ -462,15 +481,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_disks_operations.py index cd83fab3a4f0..56977a4bb9f8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_disks_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.Disk" cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('Disk', pipeline_response) @@ -112,14 +112,14 @@ def begin_create_or_update( disk, # type: "models.Disk" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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.v2018_04_01.models.Disk @@ -182,10 +182,13 @@ def _update_initial( ): # type: (...) -> "models.Disk" cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -203,14 +206,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -218,7 +219,6 @@ def _update_initial( 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('Disk', pipeline_response) @@ -238,14 +238,14 @@ def begin_update( disk, # type: "models.DiskUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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.v2018_04_01.models.DiskUpdate @@ -320,9 +320,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -339,9 +342,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -366,7 +368,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -386,7 +390,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -406,14 +409,14 @@ def begin_delete( disk_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. @@ -477,11 +480,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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 @@ -494,15 +504,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -542,11 +548,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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 @@ -558,15 +571,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -600,12 +609,15 @@ def _grant_access_initial( grant_access_data, # type: "models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> "models.AccessUri" - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # 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 = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._grant_access_initial.metadata['url'] # type: ignore @@ -623,14 +635,12 @@ def _grant_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -655,17 +665,17 @@ def begin_grant_access( grant_access_data, # type: "models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. + operation. :type grant_access_data: ~azure.mgmt.compute.v2018_04_01.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. @@ -725,7 +735,9 @@ def _revoke_access_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -745,7 +757,6 @@ def _revoke_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -765,14 +776,14 @@ def begin_revoke_access( disk_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_images_operations.py index 3acac50a6f4d..2fcb274119c0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_images_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.Image" cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'Image') 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('Image', pipeline_response) @@ -112,7 +112,7 @@ def begin_create_or_update( parameters, # type: "models.Image" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Image"] """Create or update an image. :param resource_group_name: The name of the resource group. @@ -180,10 +180,13 @@ def _update_initial( ): # type: (...) -> "models.Image" cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -201,14 +204,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ImageUpdate') 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 @@ -216,7 +217,6 @@ def _update_initial( 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('Image', pipeline_response) @@ -236,7 +236,7 @@ def begin_update( parameters, # type: "models.ImageUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Image"] """Update an image. :param resource_group_name: The name of the resource group. @@ -303,7 +303,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -323,7 +325,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -343,7 +344,7 @@ def begin_delete( image_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes an Image. :param resource_group_name: The name of the resource group. @@ -418,9 +419,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -439,9 +443,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -474,11 +477,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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 @@ -491,15 +501,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -532,7 +538,7 @@ def list( ): # type: (...) -> Iterable["models.ImageListResult"] """Gets the list of Images in the subscription. Use nextLink property in the response to get the - next page of Images. Do this till nextLink is null to fetch all the Images. + next page of Images. Do this till nextLink is null to fetch all the Images. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ImageListResult or the result of cls(response) @@ -540,11 +546,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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 @@ -556,15 +569,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_log_analytics_operations.py index 0aec585af372..c946f111fc29 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_log_analytics_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod @@ -52,12 +52,15 @@ def _export_request_rate_by_interval_initial( parameters, # type: "models.RequestRateByIntervalInput" **kwargs # type: Any ): - # type: (...) -> "models.LogAnalyticsOperationResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._export_request_rate_by_interval_initial.metadata['url'] # type: ignore @@ -74,14 +77,12 @@ def _export_request_rate_by_interval_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RequestRateByIntervalInput') 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 @@ -105,9 +106,9 @@ def begin_export_request_rate_by_interval( parameters, # type: "models.RequestRateByIntervalInput" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LogAnalyticsOperationResult"] """Export logs that show Api requests made by this subscription in the given time window to show - throttling activities. + throttling activities. :param location: The location upon which virtual-machine-sizes is queried. :type location: str @@ -168,12 +169,15 @@ def _export_throttled_requests_initial( parameters, # type: "models.LogAnalyticsInputBase" **kwargs # type: Any ): - # type: (...) -> "models.LogAnalyticsOperationResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._export_throttled_requests_initial.metadata['url'] # type: ignore @@ -190,14 +194,12 @@ def _export_throttled_requests_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LogAnalyticsInputBase') 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 @@ -221,9 +223,9 @@ def begin_export_throttled_requests( parameters, # type: "models.LogAnalyticsInputBase" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LogAnalyticsOperationResult"] """Export logs that show total throttled Api requests for this subscription in the given time - window. + window. :param location: The location upon which virtual-machine-sizes is queried. :type location: str diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_operations.py index 3b3e36c21fba..f8f4aeab8ce1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -58,11 +58,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeOperationListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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 @@ -70,15 +77,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_proximity_placement_groups_operations.py index 430695633373..a24378a6ca49 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_proximity_placement_groups_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -67,10 +67,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -88,14 +91,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ProximityPlacementGroup') 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 @@ -103,7 +104,6 @@ def create_or_update( 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('ProximityPlacementGroup', pipeline_response) @@ -138,10 +138,13 @@ def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -159,14 +162,12 @@ def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'UpdateResource') 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 @@ -201,7 +202,9 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -221,7 +224,6 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,9 +256,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -273,9 +278,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -305,11 +309,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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_subscription.metadata['url'] # type: ignore @@ -321,15 +332,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -372,11 +379,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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 @@ -389,15 +403,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_snapshots_operations.py index c24515af9d9a..c23e48566fbb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_snapshots_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.Snapshot" cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('Snapshot', pipeline_response) @@ -112,14 +112,14 @@ def begin_create_or_update( snapshot, # type: "models.Snapshot" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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.v2018_04_01.models.Snapshot @@ -182,10 +182,13 @@ def _update_initial( ): # type: (...) -> "models.Snapshot" cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -203,14 +206,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -218,7 +219,6 @@ def _update_initial( 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('Snapshot', pipeline_response) @@ -238,14 +238,14 @@ def begin_update( snapshot, # type: "models.SnapshotUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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.v2018_04_01.models.SnapshotUpdate @@ -320,9 +320,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -339,9 +342,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -366,7 +368,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -386,7 +390,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -406,14 +409,14 @@ def begin_delete( snapshot_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. @@ -477,11 +480,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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 @@ -494,15 +504,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -542,11 +548,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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 @@ -558,15 +571,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -600,12 +609,15 @@ def _grant_access_initial( grant_access_data, # type: "models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> "models.AccessUri" - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # 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 = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._grant_access_initial.metadata['url'] # type: ignore @@ -623,14 +635,12 @@ def _grant_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -655,17 +665,17 @@ def begin_grant_access( grant_access_data, # type: "models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. + operation. :type grant_access_data: ~azure.mgmt.compute.v2018_04_01.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. @@ -725,7 +735,9 @@ def _revoke_access_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -745,7 +757,6 @@ def _revoke_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -765,14 +776,14 @@ def begin_revoke_access( snapshot_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_usage_operations.py index 7dfc1c4504a5..5ec8febc3115 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_usage_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,7 +52,7 @@ def list( ): # type: (...) -> Iterable["models.ListUsagesResult"] """Gets, for the specified location, the current compute resource usage information as well as the - limits for compute resources under the subscription. + limits for compute resources under the subscription. :param location: The location for which resource usage is queried. :type location: str @@ -62,11 +62,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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 @@ -79,15 +86,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_extension_images_operations.py index cf69c2965969..b27018de5e36 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_extension_images_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -69,9 +69,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -90,9 +93,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -128,9 +130,12 @@ def list_types( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.list_types.metadata['url'] # type: ignore @@ -147,9 +152,8 @@ def list_types( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -197,9 +201,12 @@ def list_versions( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.list_versions.metadata['url'] # type: ignore @@ -223,9 +230,8 @@ def list_versions( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_extensions_operations.py index 89e31fb75bab..90dd93e2b322 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_extensions_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachineExtension" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -78,14 +81,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtension') 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 @@ -93,7 +94,6 @@ def _create_or_update_initial( 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('VirtualMachineExtension', pipeline_response) @@ -114,18 +114,18 @@ def begin_create_or_update( extension_parameters, # type: "models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineExtension"] """The operation to create or update the extension. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_name: The name of the virtual machine where the extension should be created or - updated. + updated. :type vm_name: str :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Create Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2018_04_01.models.VirtualMachineExtension :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. @@ -188,10 +188,13 @@ def _update_initial( ): # type: (...) -> "models.VirtualMachineExtension" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -210,14 +213,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtensionUpdate') 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 @@ -241,7 +242,7 @@ def begin_update( extension_parameters, # type: "models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineExtension"] """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -251,7 +252,7 @@ def begin_update( :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Update Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2018_04_01.models.VirtualMachineExtensionUpdate :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. @@ -313,7 +314,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -334,7 +337,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -355,7 +357,7 @@ def begin_delete( vm_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -436,9 +438,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -458,9 +463,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -499,9 +503,12 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -520,9 +527,8 @@ def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_images_operations.py index 30af7b37330d..9664f71b8022 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_images_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -72,9 +72,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -94,9 +97,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -148,9 +150,12 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -175,9 +180,8 @@ def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -213,9 +217,12 @@ def list_offers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.list_offers.metadata['url'] # type: ignore @@ -232,9 +239,8 @@ def list_offers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -267,9 +273,12 @@ def list_publishers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.list_publishers.metadata['url'] # type: ignore @@ -285,9 +294,8 @@ def list_publishers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -326,9 +334,12 @@ def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.list_skus.metadata['url'] # type: ignore @@ -346,9 +357,8 @@ def list_skus( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_run_commands_operations.py index fc1aeeeaa94c..6f49682ee01c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_run_commands_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -61,11 +61,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json, text/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 @@ -78,15 +85,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -132,9 +135,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandDocument"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json, text/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -151,9 +157,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_extensions_operations.py index 5fd64d1fc5d8..55624024ea2a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -57,10 +57,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachineScaleSetExtension" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -79,14 +82,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineScaleSetExtension') 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 @@ -94,7 +95,6 @@ def _create_or_update_initial( 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('VirtualMachineScaleSetExtension', pipeline_response) @@ -115,18 +115,18 @@ def begin_create_or_update( extension_parameters, # type: "models.VirtualMachineScaleSetExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineScaleSetExtension"] """The operation to create or update an extension. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_scale_set_name: The name of the VM scale set where the extension should be create or - updated. + updated. :type vm_scale_set_name: str :param vmss_extension_name: The name of the VM scale set extension. :type vmss_extension_name: str :param extension_parameters: Parameters supplied to the Create VM scale set Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2018_04_01.models.VirtualMachineScaleSetExtension :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. @@ -188,7 +188,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -209,7 +211,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -230,7 +231,7 @@ def begin_delete( vmss_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -311,9 +312,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -333,9 +337,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -371,11 +374,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtensionListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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 @@ -389,15 +399,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 1372ccc14595..2b8670ef6463 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod @@ -54,7 +54,9 @@ def _cancel_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -74,7 +76,6 @@ def _cancel_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -94,7 +95,7 @@ def begin_cancel( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Cancels the current virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -155,7 +156,9 @@ def _start_os_upgrade_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -175,7 +178,6 @@ def _start_os_upgrade_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -195,10 +197,10 @@ def begin_start_os_upgrade( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts a rolling upgrade to move all virtual machine scale set instances to the latest - available Platform Image OS version. Instances which are already running the latest available - OS version are not affected. + available Platform Image OS version. Instances which are already running the latest available + OS version are not affected. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -269,9 +271,12 @@ def get_latest( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RollingUpgradeStatusInfo"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.get_latest.metadata['url'] # type: ignore @@ -288,9 +293,8 @@ def get_latest( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_vms_operations.py index 3c00d524d119..44f86e484688 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,7 +56,9 @@ def _reimage_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -77,7 +79,6 @@ def _reimage_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +99,7 @@ def begin_reimage( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -163,7 +164,9 @@ def _reimage_all_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -184,7 +187,6 @@ def _reimage_all_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -205,9 +207,9 @@ def begin_reimage_all( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. - This operation is only supported for managed disks. + This operation is only supported for managed disks. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -271,7 +273,9 @@ def _deallocate_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -292,7 +296,6 @@ def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -313,10 +316,10 @@ def begin_deallocate( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and - releases the compute resources it uses. You are not billed for the compute resources of this - virtual machine once it is deallocated. + releases the compute resources it uses. You are not billed for the compute resources of this + virtual machine once it is deallocated. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -381,10 +384,13 @@ def _update_initial( ): # type: (...) -> "models.VirtualMachineScaleSetVM" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -403,14 +409,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSetVM') 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 @@ -418,7 +422,6 @@ def _update_initial( 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('VirtualMachineScaleSetVM', pipeline_response) @@ -439,13 +442,13 @@ def begin_update( parameters, # type: "models.VirtualMachineScaleSetVM" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineScaleSetVM"] """Updates a virtual machine of a VM scale set. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_scale_set_name: The name of the VM scale set where the extension should be create or - updated. + updated. :type vm_scale_set_name: str :param instance_id: The instance ID of the virtual machine. :type instance_id: str @@ -511,7 +514,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -532,7 +537,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -553,7 +557,7 @@ def begin_delete( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -631,9 +635,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -651,9 +658,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -692,9 +698,12 @@ def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -712,9 +721,8 @@ def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -747,11 +755,14 @@ def list( :type resource_group_name: str :param virtual_machine_scale_set_name: The name of the VM scale set. :type virtual_machine_scale_set_name: str - :param filter: The filter to apply to the operation. + :param filter: The filter to apply to the operation. Allowed values are + 'startswith(instanceView/statuses/code, 'PowerState') eq true', 'properties/latestModelApplied + eq true', 'properties/latestModelApplied eq false'. :type filter: str - :param select: The list parameters. + :param select: The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. :type select: str - :param expand: The expand expression to apply to the operation. + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetVMListResult or the result of cls(response) @@ -759,11 +770,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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 @@ -783,15 +801,11 @@ def prepare_request(next_link=None): query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -827,7 +841,9 @@ def _power_off_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -848,7 +864,6 @@ def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -869,10 +884,10 @@ def begin_power_off( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached - and you are getting charged for the resources. Instead, use deallocate to release resources and - avoid charges. + and you are getting charged for the resources. Instead, use deallocate to release resources and + avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -936,7 +951,9 @@ def _restart_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -957,7 +974,6 @@ def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -978,7 +994,7 @@ def begin_restart( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Restarts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1043,7 +1059,9 @@ def _start_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -1064,7 +1082,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1085,7 +1102,7 @@ def begin_start( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1150,7 +1167,9 @@ def _redeploy_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -1171,7 +1190,6 @@ def _redeploy_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1192,9 +1210,9 @@ def begin_redeploy( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and - powers it back on. + powers it back on. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1258,7 +1276,9 @@ def _perform_maintenance_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -1279,7 +1299,6 @@ def _perform_maintenance_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1300,7 +1319,7 @@ def begin_perform_maintenance( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Performs maintenance on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1364,12 +1383,15 @@ def _run_command_initial( parameters, # type: "models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> "models.RunCommandResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" # Construct URL url = self._run_command_initial.metadata['url'] # type: ignore @@ -1388,14 +1410,12 @@ def _run_command_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RunCommandInput') 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 @@ -1421,7 +1441,7 @@ def begin_run_command( parameters, # type: "models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RunCommandResult"] """Run command on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_sets_operations.py index 034ac74ea9af..269f76379f9e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_sets_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachineScaleSet" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSet') 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('VirtualMachineScaleSet', pipeline_response) @@ -112,7 +112,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualMachineScaleSet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -180,10 +180,13 @@ def _update_initial( ): # type: (...) -> "models.VirtualMachineScaleSet" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -201,14 +204,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSetUpdate') 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 @@ -231,7 +232,7 @@ def begin_update( parameters, # type: "models.VirtualMachineScaleSetUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] """Update a VM scale set. :param resource_group_name: The name of the resource group. @@ -298,7 +299,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -318,7 +321,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -338,7 +340,7 @@ def begin_delete( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VM scale set. :param resource_group_name: The name of the resource group. @@ -410,9 +412,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -429,9 +434,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -457,7 +461,9 @@ def _deallocate_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") @@ -479,7 +485,6 @@ def _deallocate_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -487,7 +492,6 @@ def _deallocate_initial( body_content = None 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 @@ -507,10 +511,10 @@ def begin_deallocate( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and - releases the compute resources. You are not billed for the compute resources that this virtual - machine scale set deallocates. + releases the compute resources. You are not billed for the compute resources that this virtual + machine scale set deallocates. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -574,7 +578,9 @@ def _delete_instances_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") @@ -596,12 +602,10 @@ def _delete_instances_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -621,7 +625,7 @@ def begin_delete_instances( vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -696,9 +700,12 @@ def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -715,9 +722,8 @@ def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -750,11 +756,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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 @@ -767,15 +780,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -808,8 +817,8 @@ def list_all( ): # type: (...) -> Iterable["models.VirtualMachineScaleSetListWithLinkResult"] """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource - group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this - till nextLink is null to fetch all the VM Scale Sets. + group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this + till nextLink is null to fetch all the VM Scale Sets. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetListWithLinkResult or the result of cls(response) @@ -817,11 +826,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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_all.metadata['url'] # type: ignore @@ -833,15 +849,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -876,7 +888,7 @@ def list_skus( ): # type: (...) -> Iterable["models.VirtualMachineScaleSetListSkusResult"] """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM - instances allowed for each SKU. + instances allowed for each SKU. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -888,11 +900,18 @@ def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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_skus.metadata['url'] # type: ignore @@ -906,15 +925,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -960,11 +975,18 @@ def get_os_upgrade_history( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListOSUpgradeHistory"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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.get_os_upgrade_history.metadata['url'] # type: ignore @@ -978,15 +1000,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1022,7 +1040,9 @@ def _power_off_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") @@ -1044,7 +1064,6 @@ def _power_off_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1052,7 +1071,6 @@ def _power_off_initial( body_content = None 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 @@ -1072,10 +1090,10 @@ def begin_power_off( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still - attached and you are getting charged for the resources. Instead, use deallocate to release - resources and avoid charges. + attached and you are getting charged for the resources. Instead, use deallocate to release + resources and avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1139,7 +1157,9 @@ def _restart_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") @@ -1161,7 +1181,6 @@ def _restart_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1169,7 +1188,6 @@ def _restart_initial( body_content = None 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 @@ -1189,7 +1207,7 @@ def begin_restart( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Restarts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1254,7 +1272,9 @@ def _start_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") @@ -1276,7 +1296,6 @@ def _start_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1284,7 +1303,6 @@ def _start_initial( body_content = None 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 @@ -1304,7 +1322,7 @@ def begin_start( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1369,7 +1387,9 @@ def _redeploy_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") @@ -1391,7 +1411,6 @@ def _redeploy_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1399,7 +1418,6 @@ def _redeploy_initial( body_content = None 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 @@ -1419,9 +1437,9 @@ def begin_redeploy( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, - and powers them back on. + and powers them back on. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1485,7 +1503,9 @@ def _perform_maintenance_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") @@ -1507,7 +1527,6 @@ def _perform_maintenance_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1515,7 +1534,6 @@ def _perform_maintenance_initial( body_content = None 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 @@ -1535,11 +1553,11 @@ def begin_perform_maintenance( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances - which are not eligible for perform maintenance will be failed. Please refer to best practices - for more details: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual- - machine-scale-sets-maintenance-notifications. + which are not eligible for perform maintenance will be failed. Please refer to best practices + for more details: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual- + machine-scale-sets-maintenance-notifications. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1603,7 +1621,9 @@ def _update_instances_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") @@ -1625,12 +1645,10 @@ def _update_instances_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -1650,7 +1668,7 @@ def begin_update_instances( vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. :param resource_group_name: The name of the resource group. @@ -1715,7 +1733,9 @@ def _reimage_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") @@ -1737,7 +1757,6 @@ def _reimage_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1745,7 +1764,6 @@ def _reimage_initial( body_content = None 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 @@ -1765,7 +1783,7 @@ def begin_reimage( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1830,7 +1848,9 @@ def _reimage_all_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") @@ -1852,7 +1872,6 @@ def _reimage_all_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1860,7 +1879,6 @@ def _reimage_all_initial( body_content = None 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 @@ -1880,9 +1898,9 @@ def begin_reimage_all( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This - operation is only supported for managed disks. + operation is only supported for managed disks. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1961,9 +1979,12 @@ def force_recovery_service_fabric_platform_update_domain_walk( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RecoveryWalkResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.force_recovery_service_fabric_platform_update_domain_walk.metadata['url'] # type: ignore @@ -1981,9 +2002,8 @@ def force_recovery_service_fabric_platform_update_domain_walk( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_sizes_operations.py index cc9a5ce670b9..7afb07599303 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_sizes_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -61,11 +61,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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 @@ -78,15 +85,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machines_operations.py index cb5fef39db60..f6311307902d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machines_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -63,11 +63,18 @@ def list_by_location( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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_location.metadata['url'] # type: ignore @@ -80,15 +87,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -122,12 +125,15 @@ def _capture_initial( parameters, # type: "models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._capture_initial.metadata['url'] # type: ignore @@ -145,14 +151,12 @@ def _capture_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineCaptureParameters') 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 @@ -177,9 +181,9 @@ def begin_capture( parameters, # type: "models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineCaptureResult"] """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used - to create similar VMs. + to create similar VMs. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -246,10 +250,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachine" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -267,14 +274,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachine') 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 @@ -282,7 +287,6 @@ def _create_or_update_initial( 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('VirtualMachine', pipeline_response) @@ -302,7 +306,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualMachine" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachine"] """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -370,10 +374,13 @@ def _update_initial( ): # type: (...) -> "models.VirtualMachine" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -391,14 +398,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineUpdate') 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 @@ -406,7 +411,6 @@ def _update_initial( 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('VirtualMachine', pipeline_response) @@ -426,7 +430,7 @@ def begin_update( parameters, # type: "models.VirtualMachineUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachine"] """The operation to update a virtual machine. :param resource_group_name: The name of the resource group. @@ -493,7 +497,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -513,7 +519,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -533,7 +538,7 @@ def begin_delete( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to delete a virtual machine. :param resource_group_name: The name of the resource group. @@ -608,9 +613,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -629,9 +637,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -667,9 +674,12 @@ def instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + accept = "application/json" # Construct URL url = self.instance_view.metadata['url'] # type: ignore @@ -686,9 +696,8 @@ def instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -713,7 +722,9 @@ def _convert_to_managed_disks_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -733,7 +744,6 @@ def _convert_to_managed_disks_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -753,9 +763,9 @@ def begin_convert_to_managed_disks( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop- - deallocated before invoking this operation. + deallocated before invoking this operation. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -815,7 +825,9 @@ def _deallocate_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -835,7 +847,6 @@ def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -855,9 +866,9 @@ def begin_deallocate( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Shuts down the virtual machine and releases the compute resources. You are not billed for the - compute resources that this virtual machine uses. + compute resources that this virtual machine uses. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -928,7 +939,9 @@ def generalize( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -948,7 +961,6 @@ def generalize( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -969,7 +981,7 @@ def list( ): # type: (...) -> Iterable["models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified resource group. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -979,11 +991,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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 @@ -996,15 +1015,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1037,7 +1052,7 @@ def list_all( ): # type: (...) -> Iterable["models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified subscription. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineListResult or the result of cls(response) @@ -1045,11 +1060,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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_all.metadata['url'] # type: ignore @@ -1061,15 +1083,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1104,7 +1122,7 @@ def list_available_sizes( ): # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes to which the specified virtual machine can be - resized. + resized. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1116,11 +1134,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" + 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_available_sizes.metadata['url'] # type: ignore @@ -1134,15 +1159,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1177,7 +1198,9 @@ def _power_off_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -1197,7 +1220,6 @@ def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1217,9 +1239,9 @@ def begin_power_off( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with - the same provisioned resources. You are still charged for this virtual machine. + the same provisioned resources. You are still charged for this virtual machine. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1279,7 +1301,9 @@ def _restart_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -1299,7 +1323,6 @@ def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1319,7 +1342,7 @@ def begin_restart( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to restart a virtual machine. :param resource_group_name: The name of the resource group. @@ -1380,7 +1403,9 @@ def _start_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -1400,7 +1425,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1420,7 +1444,7 @@ def begin_start( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to start a virtual machine. :param resource_group_name: The name of the resource group. @@ -1481,7 +1505,9 @@ def _redeploy_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -1501,7 +1527,6 @@ def _redeploy_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1521,7 +1546,7 @@ def begin_redeploy( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Shuts down the virtual machine, moves it to a new node, and powers it back on. :param resource_group_name: The name of the resource group. @@ -1582,7 +1607,9 @@ def _perform_maintenance_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -1602,7 +1629,6 @@ def _perform_maintenance_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1622,7 +1648,7 @@ def begin_perform_maintenance( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to perform maintenance on a virtual machine. :param resource_group_name: The name of the resource group. @@ -1682,12 +1708,15 @@ def _run_command_initial( parameters, # type: "models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> "models.RunCommandResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" # Construct URL url = self._run_command_initial.metadata['url'] # type: ignore @@ -1705,14 +1734,12 @@ def _run_command_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RunCommandInput') 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 @@ -1737,7 +1764,7 @@ def begin_run_command( parameters, # type: "models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RunCommandResult"] """Run command on the VM. :param resource_group_name: The name of the resource group. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/__init__.py index 20a4019e9c23..cdc7f7a1709a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/__init__.py @@ -10,7 +10,7 @@ __all__ = ['ComputeManagementClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass 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 c5ea10d2c456..b4d1044819de 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,6 +110,7 @@ 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/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_configuration.py index b6ff8a4e20ed..b8a65bf8e1e3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -47,8 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2018-06-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-compute/{}'.format(VERSION)) self._configure(**kwargs) @@ -61,6 +61,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) 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 882f9ff77fde..a641efba8a8d 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 @@ -4,7 +4,11 @@ "client": { "name": "ComputeManagementClient", "filename": "_compute_management_client", - "description": "Compute Client." + "description": "Compute Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true }, "global_parameters": { "sync_method": { @@ -41,7 +45,10 @@ }, "config": { "credential": true, - "credential_scopes": ["https://management.azure.com/.default"] + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null }, "operation_groups": { "operations": "Operations", diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/__init__.py index c8a8b4817269..9e9459635989 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._compute_management_client_async import ComputeManagementClient +from ._compute_management_client import ComputeManagementClient __all__ = ['ComputeManagementClient'] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/_compute_management_client_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/_compute_management_client.py similarity index 77% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/_compute_management_client_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/_compute_management_client.py index 7f8adee74353..030b7ef0107e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/_compute_management_client_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/_compute_management_client.py @@ -15,28 +15,28 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration_async import ComputeManagementClientConfiguration -from .operations_async import Operations -from .operations_async import AvailabilitySetsOperations -from .operations_async import ProximityPlacementGroupsOperations -from .operations_async import VirtualMachineExtensionImagesOperations -from .operations_async import VirtualMachineExtensionsOperations -from .operations_async import VirtualMachineImagesOperations -from .operations_async import UsageOperations -from .operations_async import VirtualMachinesOperations -from .operations_async import VirtualMachineSizesOperations -from .operations_async import ImagesOperations -from .operations_async import VirtualMachineScaleSetsOperations -from .operations_async import VirtualMachineScaleSetExtensionsOperations -from .operations_async import VirtualMachineScaleSetRollingUpgradesOperations -from .operations_async import VirtualMachineScaleSetVMsOperations -from .operations_async import LogAnalyticsOperations -from .operations_async import VirtualMachineRunCommandsOperations -from .operations_async import GalleriesOperations -from .operations_async import GalleryImagesOperations -from .operations_async import GalleryImageVersionsOperations -from .operations_async import DisksOperations -from .operations_async import SnapshotsOperations +from ._configuration import ComputeManagementClientConfiguration +from .operations import Operations +from .operations import AvailabilitySetsOperations +from .operations import ProximityPlacementGroupsOperations +from .operations import VirtualMachineExtensionImagesOperations +from .operations import VirtualMachineExtensionsOperations +from .operations import VirtualMachineImagesOperations +from .operations import UsageOperations +from .operations import VirtualMachinesOperations +from .operations import VirtualMachineSizesOperations +from .operations import ImagesOperations +from .operations import VirtualMachineScaleSetsOperations +from .operations import VirtualMachineScaleSetExtensionsOperations +from .operations import VirtualMachineScaleSetRollingUpgradesOperations +from .operations import VirtualMachineScaleSetVMsOperations +from .operations import LogAnalyticsOperations +from .operations import VirtualMachineRunCommandsOperations +from .operations import GalleriesOperations +from .operations import GalleryImagesOperations +from .operations import GalleryImageVersionsOperations +from .operations import DisksOperations +from .operations import SnapshotsOperations from .. import models @@ -44,47 +44,47 @@ class ComputeManagementClient(object): """Compute Client. :ivar operations: Operations operations - :vartype operations: azure.mgmt.compute.v2018_06_01.aio.operations_async.Operations + :vartype operations: azure.mgmt.compute.v2018_06_01.aio.operations.Operations :ivar availability_sets: AvailabilitySetsOperations operations - :vartype availability_sets: azure.mgmt.compute.v2018_06_01.aio.operations_async.AvailabilitySetsOperations + :vartype availability_sets: azure.mgmt.compute.v2018_06_01.aio.operations.AvailabilitySetsOperations :ivar proximity_placement_groups: ProximityPlacementGroupsOperations operations - :vartype proximity_placement_groups: azure.mgmt.compute.v2018_06_01.aio.operations_async.ProximityPlacementGroupsOperations + :vartype proximity_placement_groups: azure.mgmt.compute.v2018_06_01.aio.operations.ProximityPlacementGroupsOperations :ivar virtual_machine_extension_images: VirtualMachineExtensionImagesOperations operations - :vartype virtual_machine_extension_images: azure.mgmt.compute.v2018_06_01.aio.operations_async.VirtualMachineExtensionImagesOperations + :vartype virtual_machine_extension_images: azure.mgmt.compute.v2018_06_01.aio.operations.VirtualMachineExtensionImagesOperations :ivar virtual_machine_extensions: VirtualMachineExtensionsOperations operations - :vartype virtual_machine_extensions: azure.mgmt.compute.v2018_06_01.aio.operations_async.VirtualMachineExtensionsOperations + :vartype virtual_machine_extensions: azure.mgmt.compute.v2018_06_01.aio.operations.VirtualMachineExtensionsOperations :ivar virtual_machine_images: VirtualMachineImagesOperations operations - :vartype virtual_machine_images: azure.mgmt.compute.v2018_06_01.aio.operations_async.VirtualMachineImagesOperations + :vartype virtual_machine_images: azure.mgmt.compute.v2018_06_01.aio.operations.VirtualMachineImagesOperations :ivar usage: UsageOperations operations - :vartype usage: azure.mgmt.compute.v2018_06_01.aio.operations_async.UsageOperations + :vartype usage: azure.mgmt.compute.v2018_06_01.aio.operations.UsageOperations :ivar virtual_machines: VirtualMachinesOperations operations - :vartype virtual_machines: azure.mgmt.compute.v2018_06_01.aio.operations_async.VirtualMachinesOperations + :vartype virtual_machines: azure.mgmt.compute.v2018_06_01.aio.operations.VirtualMachinesOperations :ivar virtual_machine_sizes: VirtualMachineSizesOperations operations - :vartype virtual_machine_sizes: azure.mgmt.compute.v2018_06_01.aio.operations_async.VirtualMachineSizesOperations + :vartype virtual_machine_sizes: azure.mgmt.compute.v2018_06_01.aio.operations.VirtualMachineSizesOperations :ivar images: ImagesOperations operations - :vartype images: azure.mgmt.compute.v2018_06_01.aio.operations_async.ImagesOperations + :vartype images: azure.mgmt.compute.v2018_06_01.aio.operations.ImagesOperations :ivar virtual_machine_scale_sets: VirtualMachineScaleSetsOperations operations - :vartype virtual_machine_scale_sets: azure.mgmt.compute.v2018_06_01.aio.operations_async.VirtualMachineScaleSetsOperations + :vartype virtual_machine_scale_sets: azure.mgmt.compute.v2018_06_01.aio.operations.VirtualMachineScaleSetsOperations :ivar virtual_machine_scale_set_extensions: VirtualMachineScaleSetExtensionsOperations operations - :vartype virtual_machine_scale_set_extensions: azure.mgmt.compute.v2018_06_01.aio.operations_async.VirtualMachineScaleSetExtensionsOperations + :vartype virtual_machine_scale_set_extensions: azure.mgmt.compute.v2018_06_01.aio.operations.VirtualMachineScaleSetExtensionsOperations :ivar virtual_machine_scale_set_rolling_upgrades: VirtualMachineScaleSetRollingUpgradesOperations operations - :vartype virtual_machine_scale_set_rolling_upgrades: azure.mgmt.compute.v2018_06_01.aio.operations_async.VirtualMachineScaleSetRollingUpgradesOperations + :vartype virtual_machine_scale_set_rolling_upgrades: azure.mgmt.compute.v2018_06_01.aio.operations.VirtualMachineScaleSetRollingUpgradesOperations :ivar virtual_machine_scale_set_vms: VirtualMachineScaleSetVMsOperations operations - :vartype virtual_machine_scale_set_vms: azure.mgmt.compute.v2018_06_01.aio.operations_async.VirtualMachineScaleSetVMsOperations + :vartype virtual_machine_scale_set_vms: azure.mgmt.compute.v2018_06_01.aio.operations.VirtualMachineScaleSetVMsOperations :ivar log_analytics: LogAnalyticsOperations operations - :vartype log_analytics: azure.mgmt.compute.v2018_06_01.aio.operations_async.LogAnalyticsOperations + :vartype log_analytics: azure.mgmt.compute.v2018_06_01.aio.operations.LogAnalyticsOperations :ivar virtual_machine_run_commands: VirtualMachineRunCommandsOperations operations - :vartype virtual_machine_run_commands: azure.mgmt.compute.v2018_06_01.aio.operations_async.VirtualMachineRunCommandsOperations + :vartype virtual_machine_run_commands: azure.mgmt.compute.v2018_06_01.aio.operations.VirtualMachineRunCommandsOperations :ivar galleries: GalleriesOperations operations - :vartype galleries: azure.mgmt.compute.v2018_06_01.aio.operations_async.GalleriesOperations + :vartype galleries: azure.mgmt.compute.v2018_06_01.aio.operations.GalleriesOperations :ivar gallery_images: GalleryImagesOperations operations - :vartype gallery_images: azure.mgmt.compute.v2018_06_01.aio.operations_async.GalleryImagesOperations + :vartype gallery_images: azure.mgmt.compute.v2018_06_01.aio.operations.GalleryImagesOperations :ivar gallery_image_versions: GalleryImageVersionsOperations operations - :vartype gallery_image_versions: azure.mgmt.compute.v2018_06_01.aio.operations_async.GalleryImageVersionsOperations + :vartype gallery_image_versions: azure.mgmt.compute.v2018_06_01.aio.operations.GalleryImageVersionsOperations :ivar disks: DisksOperations operations - :vartype disks: azure.mgmt.compute.v2018_06_01.aio.operations_async.DisksOperations + :vartype disks: azure.mgmt.compute.v2018_06_01.aio.operations.DisksOperations :ivar snapshots: SnapshotsOperations operations - :vartype snapshots: azure.mgmt.compute.v2018_06_01.aio.operations_async.SnapshotsOperations + :vartype snapshots: azure.mgmt.compute.v2018_06_01.aio.operations.SnapshotsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. @@ -107,6 +107,7 @@ 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/aio/_configuration_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/_configuration.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/_configuration_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/_configuration.py index 3c540a16bb17..df4fac45723e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/_configuration_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -44,8 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2018-06-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-compute/{}'.format(VERSION)) self._configure(**kwargs) @@ -57,6 +57,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/__init__.py new file mode 100644 index 000000000000..ae7010225ed5 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/__init__.py @@ -0,0 +1,53 @@ +# 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 ._operations import Operations +from ._availability_sets_operations import AvailabilitySetsOperations +from ._proximity_placement_groups_operations import ProximityPlacementGroupsOperations +from ._virtual_machine_extension_images_operations import VirtualMachineExtensionImagesOperations +from ._virtual_machine_extensions_operations import VirtualMachineExtensionsOperations +from ._virtual_machine_images_operations import VirtualMachineImagesOperations +from ._usage_operations import UsageOperations +from ._virtual_machines_operations import VirtualMachinesOperations +from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations +from ._images_operations import ImagesOperations +from ._virtual_machine_scale_sets_operations import VirtualMachineScaleSetsOperations +from ._virtual_machine_scale_set_extensions_operations import VirtualMachineScaleSetExtensionsOperations +from ._virtual_machine_scale_set_rolling_upgrades_operations import VirtualMachineScaleSetRollingUpgradesOperations +from ._virtual_machine_scale_set_vms_operations import VirtualMachineScaleSetVMsOperations +from ._log_analytics_operations import LogAnalyticsOperations +from ._virtual_machine_run_commands_operations import VirtualMachineRunCommandsOperations +from ._galleries_operations import GalleriesOperations +from ._gallery_images_operations import GalleryImagesOperations +from ._gallery_image_versions_operations import GalleryImageVersionsOperations +from ._disks_operations import DisksOperations +from ._snapshots_operations import SnapshotsOperations + +__all__ = [ + 'Operations', + 'AvailabilitySetsOperations', + 'ProximityPlacementGroupsOperations', + 'VirtualMachineExtensionImagesOperations', + 'VirtualMachineExtensionsOperations', + 'VirtualMachineImagesOperations', + 'UsageOperations', + 'VirtualMachinesOperations', + 'VirtualMachineSizesOperations', + 'ImagesOperations', + 'VirtualMachineScaleSetsOperations', + 'VirtualMachineScaleSetExtensionsOperations', + 'VirtualMachineScaleSetRollingUpgradesOperations', + 'VirtualMachineScaleSetVMsOperations', + 'LogAnalyticsOperations', + 'VirtualMachineRunCommandsOperations', + 'GalleriesOperations', + 'GalleryImagesOperations', + 'GalleryImageVersionsOperations', + 'DisksOperations', + 'SnapshotsOperations', +] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_availability_sets_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_availability_sets_operations.py similarity index 90% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_availability_sets_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_availability_sets_operations.py index 7ab405f388bb..55744ec3528a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_availability_sets_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_availability_sets_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -62,10 +62,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -83,14 +86,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailabilitySet') 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 @@ -127,10 +128,13 @@ async def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -148,14 +152,12 @@ async def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailabilitySetUpdate') 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 @@ -189,7 +191,9 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -209,7 +213,6 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -241,9 +244,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -260,9 +266,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -286,7 +291,8 @@ def list_by_subscription( ) -> AsyncIterable["models.AvailabilitySetListResult"]: """Lists all availability sets in a subscription. - :param expand: The expand expression to apply to the operation. + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AvailabilitySetListResult or the result of cls(response) @@ -294,11 +300,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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_subscription.metadata['url'] # type: ignore @@ -312,15 +325,11 @@ def prepare_request(next_link=None): if expand is not None: query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -362,11 +371,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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 @@ -379,15 +395,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -421,7 +433,7 @@ def list_available_sizes( **kwargs ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes that can be used to create a new virtual machine in - an existing availability set. + an existing availability set. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -433,11 +445,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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_available_sizes.metadata['url'] # type: ignore @@ -451,15 +470,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_disks_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_disks_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_disks_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_disks_operations.py index 4251a8c35c37..b2814cadadcd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_disks_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_disks_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.Disk": cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('Disk', pipeline_response) @@ -106,14 +106,14 @@ async def begin_create_or_update( disk_name: str, disk: "models.Disk", **kwargs - ) -> "models.Disk": + ) -> 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. + 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.v2018_06_01.models.Disk @@ -123,8 +123,8 @@ async def begin_create_or_update( 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: Disk, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_06_01.models.Disk + :return: An instance of AsyncLROPoller that returns either Disk or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_06_01.models.Disk] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -175,10 +175,13 @@ async def _update_initial( **kwargs ) -> "models.Disk": cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -196,14 +199,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -211,7 +212,6 @@ async def _update_initial( 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('Disk', pipeline_response) @@ -230,14 +230,14 @@ async def begin_update( disk_name: str, disk: "models.DiskUpdate", **kwargs - ) -> "models.Disk": + ) -> 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. + 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.v2018_06_01.models.DiskUpdate @@ -247,8 +247,8 @@ async def begin_update( 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: Disk, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_06_01.models.Disk + :return: An instance of AsyncLROPoller that returns either Disk or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_06_01.models.Disk] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -311,9 +311,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -330,9 +333,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -356,7 +358,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -376,7 +380,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -395,14 +398,14 @@ async def begin_delete( resource_group_name: str, disk_name: str, **kwargs - ) -> None: + ) -> 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. + 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. @@ -410,8 +413,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -465,11 +468,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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 @@ -482,15 +492,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -529,11 +535,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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 @@ -545,15 +558,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -586,12 +595,15 @@ async def _grant_access_initial( disk_name: str, grant_access_data: "models.GrantAccessData", **kwargs - ) -> "models.AccessUri": - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> 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 = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._grant_access_initial.metadata['url'] # type: ignore @@ -609,14 +621,12 @@ async def _grant_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -640,17 +650,17 @@ async def begin_grant_access( disk_name: str, grant_access_data: "models.GrantAccessData", **kwargs - ) -> "models.AccessUri": + ) -> 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. + 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. + operation. :type grant_access_data: ~azure.mgmt.compute.v2018_06_01.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. @@ -658,8 +668,8 @@ async def begin_grant_access( 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: AccessUri, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_06_01.models.AccessUri + :return: An instance of AsyncLROPoller that returns either AccessUri or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_06_01.models.AccessUri] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -709,7 +719,9 @@ async def _revoke_access_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -729,7 +741,6 @@ async def _revoke_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -748,14 +759,14 @@ async def begin_revoke_access( resource_group_name: str, disk_name: str, **kwargs - ) -> None: + ) -> 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. + 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. @@ -763,8 +774,8 @@ async def begin_revoke_access( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_galleries_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_galleries_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_galleries_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_galleries_operations.py index 2fe55f478980..ab2cf83008c2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_galleries_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_galleries_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.Gallery": cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery, 'Gallery') 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('Gallery', pipeline_response) @@ -109,13 +109,13 @@ async def begin_create_or_update( gallery_name: str, gallery: "models.Gallery", **kwargs - ) -> "models.Gallery": + ) -> AsyncLROPoller["models.Gallery"]: """Create or update a Shared Image Gallery. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery. The allowed characters are alphabets - and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. + and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. :type gallery_name: str :param gallery: Parameters supplied to the create or update Shared Image Gallery operation. :type gallery: ~azure.mgmt.compute.v2018_06_01.models.Gallery @@ -125,8 +125,8 @@ async def begin_create_or_update( 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: Gallery, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_06_01.models.Gallery + :return: An instance of AsyncLROPoller that returns either Gallery or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_06_01.models.Gallery] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -187,9 +187,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -206,9 +209,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -232,9 +234,12 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -251,8 +256,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -271,7 +276,7 @@ async def begin_delete( resource_group_name: str, gallery_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Delete a Shared Image Gallery. :param resource_group_name: The name of the resource group. @@ -284,8 +289,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -339,11 +344,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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 @@ -356,15 +368,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -403,11 +411,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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 @@ -419,15 +434,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_gallery_image_versions_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_gallery_image_versions_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_gallery_image_versions_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_gallery_image_versions_operations.py index 40080a4f6f1a..07ce0c83964d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_gallery_image_versions_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_gallery_image_versions_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -53,10 +53,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.GalleryImageVersion": cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -76,14 +79,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_image_version, 'GalleryImageVersion') 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 @@ -91,7 +92,6 @@ async def _create_or_update_initial( 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('GalleryImageVersion', pipeline_response) @@ -115,24 +115,24 @@ async def begin_create_or_update( gallery_image_version_name: str, gallery_image_version: "models.GalleryImageVersion", **kwargs - ) -> "models.GalleryImageVersion": + ) -> AsyncLROPoller["models.GalleryImageVersion"]: """Create or update a gallery Image Version. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. + resides. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition in which the Image Version - is to be created. + is to be created. :type gallery_image_name: str :param gallery_image_version_name: The name of the gallery Image Version to be created. Needs - to follow semantic version name pattern: The allowed characters are digit and period. Digits - must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. + to follow semantic version name pattern: The allowed characters are digit and period. Digits + must be within the range of a 32-bit integer. Format: + :code:``.:code:``.:code:``. :type gallery_image_version_name: str :param gallery_image_version: Parameters supplied to the create or update gallery Image Version - operation. + operation. :type gallery_image_version: ~azure.mgmt.compute.v2018_06_01.models.GalleryImageVersion :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. @@ -140,8 +140,8 @@ async def begin_create_or_update( 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: GalleryImageVersion, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_06_01.models.GalleryImageVersion + :return: An instance of AsyncLROPoller that returns either GalleryImageVersion or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_06_01.models.GalleryImageVersion] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -192,7 +192,7 @@ async def get( gallery_name: str, gallery_image_name: str, gallery_image_version_name: str, - expand: Optional[str] = "ReplicationStatus", + expand: Optional[Union[str, "models.ReplicationStatusTypes"]] = None, **kwargs ) -> "models.GalleryImageVersion": """Retrieves information about a gallery Image Version. @@ -208,16 +208,19 @@ async def get( :param gallery_image_version_name: The name of the gallery Image Version to be retrieved. :type gallery_image_version_name: str :param expand: The expand expression to apply on the operation. - :type expand: str + :type expand: str or ~azure.mgmt.compute.v2018_06_01.models.ReplicationStatusTypes :keyword callable cls: A custom type or function that will be passed the direct response :return: GalleryImageVersion, or the result of cls(response) :rtype: ~azure.mgmt.compute.v2018_06_01.models.GalleryImageVersion :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -238,9 +241,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -266,9 +268,12 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -287,8 +292,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -309,16 +314,16 @@ async def begin_delete( gallery_image_name: str, gallery_image_version_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Delete a gallery Image Version. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. + resides. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition in which the Image Version - resides. + resides. :type gallery_image_name: str :param gallery_image_version_name: The name of the gallery Image Version to be deleted. :type gallery_image_version_name: str @@ -328,8 +333,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -382,10 +387,10 @@ def list_by_gallery_image( :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. + resides. :type gallery_name: str :param gallery_image_name: The name of the Shared Image Gallery Image Definition from which the - Image Versions are to be listed. + Image Versions are to be listed. :type gallery_image_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GalleryImageVersionList or the result of cls(response) @@ -393,11 +398,18 @@ def list_by_gallery_image( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersionList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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_gallery_image.metadata['url'] # type: ignore @@ -412,15 +424,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_gallery_images_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_gallery_images_operations.py similarity index 90% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_gallery_images_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_gallery_images_operations.py index 0aaf42bfdad1..2c370a08b5a3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_gallery_images_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_gallery_images_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,10 +52,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.GalleryImage": cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -74,14 +77,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_image, 'GalleryImage') 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 @@ -89,7 +90,6 @@ async def _create_or_update_initial( 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('GalleryImage', pipeline_response) @@ -112,17 +112,17 @@ async def begin_create_or_update( gallery_image_name: str, gallery_image: "models.GalleryImage", **kwargs - ) -> "models.GalleryImage": + ) -> AsyncLROPoller["models.GalleryImage"]: """Create or update a gallery Image Definition. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to - be created. + be created. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition to be created or updated. - The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the - middle. The maximum length is 80 characters. + The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the + middle. The maximum length is 80 characters. :type gallery_image_name: str :param gallery_image: Parameters supplied to the create or update gallery image operation. :type gallery_image: ~azure.mgmt.compute.v2018_06_01.models.GalleryImage @@ -132,8 +132,8 @@ async def begin_create_or_update( 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: GalleryImage, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_06_01.models.GalleryImage + :return: An instance of AsyncLROPoller that returns either GalleryImage or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_06_01.models.GalleryImage] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -199,9 +199,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -219,9 +222,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -246,9 +248,12 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -266,8 +271,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -287,13 +292,13 @@ async def begin_delete( gallery_name: str, gallery_image_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Delete a gallery image. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to - be deleted. + be deleted. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition to be deleted. :type gallery_image_name: str @@ -303,8 +308,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -355,7 +360,7 @@ def list_by_gallery( :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery from which Image Definitions are to - be listed. + be listed. :type gallery_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GalleryImageList or the result of cls(response) @@ -363,11 +368,18 @@ def list_by_gallery( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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_gallery.metadata['url'] # type: ignore @@ -381,15 +393,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_images_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_images_operations.py similarity index 90% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_images_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_images_operations.py index 1455d8d61088..653719fec5fb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_images_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_images_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.Image": cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'Image') 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('Image', pipeline_response) @@ -106,7 +106,7 @@ async def begin_create_or_update( image_name: str, parameters: "models.Image", **kwargs - ) -> "models.Image": + ) -> AsyncLROPoller["models.Image"]: """Create or update an image. :param resource_group_name: The name of the resource group. @@ -121,8 +121,8 @@ async def begin_create_or_update( 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: Image, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_06_01.models.Image + :return: An instance of AsyncLROPoller that returns either Image or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_06_01.models.Image] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -173,10 +173,13 @@ async def _update_initial( **kwargs ) -> "models.Image": cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -194,14 +197,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ImageUpdate') 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 @@ -209,7 +210,6 @@ async def _update_initial( 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('Image', pipeline_response) @@ -228,7 +228,7 @@ async def begin_update( image_name: str, parameters: "models.ImageUpdate", **kwargs - ) -> "models.Image": + ) -> AsyncLROPoller["models.Image"]: """Update an image. :param resource_group_name: The name of the resource group. @@ -243,8 +243,8 @@ async def begin_update( 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: Image, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_06_01.models.Image + :return: An instance of AsyncLROPoller that returns either Image or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_06_01.models.Image] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -294,7 +294,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -314,7 +316,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -333,7 +334,7 @@ async def begin_delete( resource_group_name: str, image_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes an Image. :param resource_group_name: The name of the resource group. @@ -346,8 +347,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -407,9 +408,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -428,9 +432,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -462,11 +465,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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 @@ -479,15 +489,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -519,7 +525,7 @@ def list( **kwargs ) -> AsyncIterable["models.ImageListResult"]: """Gets the list of Images in the subscription. Use nextLink property in the response to get the - next page of Images. Do this till nextLink is null to fetch all the Images. + next page of Images. Do this till nextLink is null to fetch all the Images. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ImageListResult or the result of cls(response) @@ -527,11 +533,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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 @@ -543,15 +556,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_log_analytics_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_log_analytics_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_log_analytics_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_log_analytics_operations.py index 3a37c5605122..b9bf1ddb52f1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_log_analytics_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_log_analytics_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -47,12 +47,15 @@ async def _export_request_rate_by_interval_initial( location: str, parameters: "models.RequestRateByIntervalInput", **kwargs - ) -> "models.LogAnalyticsOperationResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.LogAnalyticsOperationResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._export_request_rate_by_interval_initial.metadata['url'] # type: ignore @@ -69,14 +72,12 @@ async def _export_request_rate_by_interval_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RequestRateByIntervalInput') 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 @@ -99,9 +100,9 @@ async def begin_export_request_rate_by_interval( location: str, parameters: "models.RequestRateByIntervalInput", **kwargs - ) -> "models.LogAnalyticsOperationResult": + ) -> AsyncLROPoller["models.LogAnalyticsOperationResult"]: """Export logs that show Api requests made by this subscription in the given time window to show - throttling activities. + throttling activities. :param location: The location upon which virtual-machine-sizes is queried. :type location: str @@ -113,8 +114,8 @@ async def begin_export_request_rate_by_interval( 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: LogAnalyticsOperationResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_06_01.models.LogAnalyticsOperationResult + :return: An instance of AsyncLROPoller that returns either LogAnalyticsOperationResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_06_01.models.LogAnalyticsOperationResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -161,12 +162,15 @@ async def _export_throttled_requests_initial( location: str, parameters: "models.LogAnalyticsInputBase", **kwargs - ) -> "models.LogAnalyticsOperationResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.LogAnalyticsOperationResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._export_throttled_requests_initial.metadata['url'] # type: ignore @@ -183,14 +187,12 @@ async def _export_throttled_requests_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LogAnalyticsInputBase') 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 @@ -213,9 +215,9 @@ async def begin_export_throttled_requests( location: str, parameters: "models.LogAnalyticsInputBase", **kwargs - ) -> "models.LogAnalyticsOperationResult": + ) -> AsyncLROPoller["models.LogAnalyticsOperationResult"]: """Export logs that show total throttled Api requests for this subscription in the given time - window. + window. :param location: The location upon which virtual-machine-sizes is queried. :type location: str @@ -227,8 +229,8 @@ async def begin_export_throttled_requests( 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: LogAnalyticsOperationResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_06_01.models.LogAnalyticsOperationResult + :return: An instance of AsyncLROPoller that returns either LogAnalyticsOperationResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_06_01.models.LogAnalyticsOperationResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_operations.py similarity index 87% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_operations.py index e0c37e393bb0..03a13039d6c3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -53,11 +53,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeOperationListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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 @@ -65,15 +72,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_proximity_placement_groups_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_proximity_placement_groups_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_proximity_placement_groups_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_proximity_placement_groups_operations.py index 685c3fd50653..441e365ba37a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_proximity_placement_groups_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_proximity_placement_groups_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -62,10 +62,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -83,14 +86,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ProximityPlacementGroup') 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 @@ -98,7 +99,6 @@ async def create_or_update( 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('ProximityPlacementGroup', pipeline_response) @@ -132,10 +132,13 @@ async def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -153,14 +156,12 @@ async def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'UpdateResource') 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 @@ -194,7 +195,9 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -214,7 +217,6 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -246,9 +248,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -265,9 +270,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -296,11 +300,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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_subscription.metadata['url'] # type: ignore @@ -312,15 +323,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -362,11 +369,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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 @@ -379,15 +393,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_snapshots_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_snapshots_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_snapshots_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_snapshots_operations.py index 48b2ddac8db7..7aaa7c5dece6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_snapshots_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_snapshots_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.Snapshot": cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('Snapshot', pipeline_response) @@ -106,14 +106,14 @@ async def begin_create_or_update( snapshot_name: str, snapshot: "models.Snapshot", **kwargs - ) -> "models.Snapshot": + ) -> 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. + 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.v2018_06_01.models.Snapshot @@ -123,8 +123,8 @@ async def begin_create_or_update( 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: Snapshot, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_06_01.models.Snapshot + :return: An instance of AsyncLROPoller that returns either Snapshot or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_06_01.models.Snapshot] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -175,10 +175,13 @@ async def _update_initial( **kwargs ) -> "models.Snapshot": cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -196,14 +199,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -211,7 +212,6 @@ async def _update_initial( 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('Snapshot', pipeline_response) @@ -230,14 +230,14 @@ async def begin_update( snapshot_name: str, snapshot: "models.SnapshotUpdate", **kwargs - ) -> "models.Snapshot": + ) -> 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. + 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.v2018_06_01.models.SnapshotUpdate @@ -247,8 +247,8 @@ async def begin_update( 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: Snapshot, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_06_01.models.Snapshot + :return: An instance of AsyncLROPoller that returns either Snapshot or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_06_01.models.Snapshot] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -311,9 +311,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -330,9 +333,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -356,7 +358,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -376,7 +380,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -395,14 +398,14 @@ async def begin_delete( resource_group_name: str, snapshot_name: str, **kwargs - ) -> None: + ) -> 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. + 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. @@ -410,8 +413,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -465,11 +468,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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 @@ -482,15 +492,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -529,11 +535,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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 @@ -545,15 +558,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -586,12 +595,15 @@ async def _grant_access_initial( snapshot_name: str, grant_access_data: "models.GrantAccessData", **kwargs - ) -> "models.AccessUri": - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> 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 = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._grant_access_initial.metadata['url'] # type: ignore @@ -609,14 +621,12 @@ async def _grant_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -640,17 +650,17 @@ async def begin_grant_access( snapshot_name: str, grant_access_data: "models.GrantAccessData", **kwargs - ) -> "models.AccessUri": + ) -> 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. + 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. + operation. :type grant_access_data: ~azure.mgmt.compute.v2018_06_01.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. @@ -658,8 +668,8 @@ async def begin_grant_access( 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: AccessUri, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_06_01.models.AccessUri + :return: An instance of AsyncLROPoller that returns either AccessUri or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_06_01.models.AccessUri] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -709,7 +719,9 @@ async def _revoke_access_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -729,7 +741,6 @@ async def _revoke_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -748,14 +759,14 @@ async def begin_revoke_access( resource_group_name: str, snapshot_name: str, **kwargs - ) -> None: + ) -> 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. + 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. @@ -763,8 +774,8 @@ async def begin_revoke_access( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_usage_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_usage_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_usage_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_usage_operations.py index 700d395024e1..e67fa93c39e8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_usage_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_usage_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -47,7 +47,7 @@ def list( **kwargs ) -> AsyncIterable["models.ListUsagesResult"]: """Gets, for the specified location, the current compute resource usage information as well as the - limits for compute resources under the subscription. + limits for compute resources under the subscription. :param location: The location for which resource usage is queried. :type location: str @@ -57,11 +57,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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 @@ -74,15 +81,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_virtual_machine_extension_images_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_extension_images_operations.py similarity index 92% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_virtual_machine_extension_images_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_extension_images_operations.py index 33f0a02c6821..1051b94f2b5c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_virtual_machine_extension_images_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -64,9 +64,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -85,9 +88,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -122,9 +124,12 @@ async def list_types( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.list_types.metadata['url'] # type: ignore @@ -141,9 +146,8 @@ async def list_types( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -190,9 +194,12 @@ async def list_versions( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.list_versions.metadata['url'] # type: ignore @@ -216,9 +223,8 @@ async def list_versions( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_virtual_machine_extensions_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_extensions_operations.py similarity index 92% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_virtual_machine_extensions_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_extensions_operations.py index 487f96a8f41b..ff954e27742f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_virtual_machine_extensions_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_extensions_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachineExtension": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -73,14 +76,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtension') 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 @@ -88,7 +89,6 @@ async def _create_or_update_initial( 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('VirtualMachineExtension', pipeline_response) @@ -108,18 +108,18 @@ async def begin_create_or_update( vm_extension_name: str, extension_parameters: "models.VirtualMachineExtension", **kwargs - ) -> "models.VirtualMachineExtension": + ) -> AsyncLROPoller["models.VirtualMachineExtension"]: """The operation to create or update the extension. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_name: The name of the virtual machine where the extension should be created or - updated. + updated. :type vm_name: str :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Create Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2018_06_01.models.VirtualMachineExtension :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. @@ -127,8 +127,8 @@ async def begin_create_or_update( 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: VirtualMachineExtension, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_06_01.models.VirtualMachineExtension + :return: An instance of AsyncLROPoller that returns either VirtualMachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -181,10 +181,13 @@ async def _update_initial( **kwargs ) -> "models.VirtualMachineExtension": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -203,14 +206,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtensionUpdate') 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 @@ -233,7 +234,7 @@ async def begin_update( vm_extension_name: str, extension_parameters: "models.VirtualMachineExtensionUpdate", **kwargs - ) -> "models.VirtualMachineExtension": + ) -> AsyncLROPoller["models.VirtualMachineExtension"]: """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -243,7 +244,7 @@ async def begin_update( :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Update Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2018_06_01.models.VirtualMachineExtensionUpdate :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. @@ -251,8 +252,8 @@ async def begin_update( 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: VirtualMachineExtension, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_06_01.models.VirtualMachineExtension + :return: An instance of AsyncLROPoller that returns either VirtualMachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -304,7 +305,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -325,7 +328,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -345,7 +347,7 @@ async def begin_delete( vm_name: str, vm_extension_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -360,8 +362,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -425,9 +427,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -447,9 +452,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -487,9 +491,12 @@ async def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -508,9 +515,8 @@ async def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_virtual_machine_images_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_images_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_virtual_machine_images_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_images_operations.py index 4184849aacc1..43681c79a032 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_virtual_machine_images_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_images_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -67,9 +67,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -89,9 +92,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -142,9 +144,12 @@ async def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -169,9 +174,8 @@ async def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -206,9 +210,12 @@ async def list_offers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.list_offers.metadata['url'] # type: ignore @@ -225,9 +232,8 @@ async def list_offers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -259,9 +265,12 @@ async def list_publishers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.list_publishers.metadata['url'] # type: ignore @@ -277,9 +286,8 @@ async def list_publishers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -317,9 +325,12 @@ async def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.list_skus.metadata['url'] # type: ignore @@ -337,9 +348,8 @@ async def list_skus( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_virtual_machine_run_commands_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_run_commands_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_virtual_machine_run_commands_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_run_commands_operations.py index 7fc8707ca10a..ae68dd96f544 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_virtual_machine_run_commands_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,11 +56,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json, text/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 @@ -73,15 +80,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -126,9 +129,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandDocument"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json, text/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -145,9 +151,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_virtual_machine_scale_set_extensions_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_virtual_machine_scale_set_extensions_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index 6d73c3f87e62..d108286c3f22 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_virtual_machine_scale_set_extensions_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,10 +52,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachineScaleSetExtension": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -74,14 +77,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineScaleSetExtension') 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 @@ -89,7 +90,6 @@ async def _create_or_update_initial( 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('VirtualMachineScaleSetExtension', pipeline_response) @@ -109,18 +109,18 @@ async def begin_create_or_update( vmss_extension_name: str, extension_parameters: "models.VirtualMachineScaleSetExtension", **kwargs - ) -> "models.VirtualMachineScaleSetExtension": + ) -> AsyncLROPoller["models.VirtualMachineScaleSetExtension"]: """The operation to create or update an extension. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_scale_set_name: The name of the VM scale set where the extension should be create or - updated. + updated. :type vm_scale_set_name: str :param vmss_extension_name: The name of the VM scale set extension. :type vmss_extension_name: str :param extension_parameters: Parameters supplied to the Create VM scale set Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2018_06_01.models.VirtualMachineScaleSetExtension :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. @@ -128,8 +128,8 @@ async def begin_create_or_update( 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: VirtualMachineScaleSetExtension, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_06_01.models.VirtualMachineScaleSetExtension + :return: An instance of AsyncLROPoller that returns either VirtualMachineScaleSetExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineScaleSetExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -181,7 +181,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -202,7 +204,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -222,7 +223,7 @@ async def begin_delete( vm_scale_set_name: str, vmss_extension_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -237,8 +238,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -302,9 +303,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -324,9 +328,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -361,11 +364,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtensionListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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 @@ -379,15 +389,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_virtual_machine_scale_set_rolling_upgrades_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_virtual_machine_scale_set_rolling_upgrades_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 8575b0e6ede8..62a38c8f81a1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_virtual_machine_scale_set_rolling_upgrades_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -49,7 +49,9 @@ async def _cancel_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -69,7 +71,6 @@ async def _cancel_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -88,7 +89,7 @@ async def begin_cancel( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Cancels the current virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -101,8 +102,8 @@ async def begin_cancel( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -148,7 +149,9 @@ async def _start_os_upgrade_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -168,7 +171,6 @@ async def _start_os_upgrade_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -187,10 +189,10 @@ async def begin_start_os_upgrade( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts a rolling upgrade to move all virtual machine scale set instances to the latest - available Platform Image OS version. Instances which are already running the latest available - OS version are not affected. + available Platform Image OS version. Instances which are already running the latest available + OS version are not affected. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -202,8 +204,8 @@ async def begin_start_os_upgrade( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -249,7 +251,9 @@ async def _start_extension_upgrade_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -269,7 +273,6 @@ async def _start_extension_upgrade_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -288,10 +291,10 @@ async def begin_start_extension_upgrade( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to - the latest available extension version. Instances which are already running the latest - extension versions are not affected. + the latest available extension version. Instances which are already running the latest + extension versions are not affected. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -303,8 +306,8 @@ async def begin_start_extension_upgrade( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -361,9 +364,12 @@ async def get_latest( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RollingUpgradeStatusInfo"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.get_latest.metadata['url'] # type: ignore @@ -380,9 +386,8 @@ async def get_latest( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_virtual_machine_scale_set_vms_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_vms_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_virtual_machine_scale_set_vms_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index 0ec502522fef..4abeefb7f12b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_virtual_machine_scale_set_vms_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,7 +52,9 @@ async def _reimage_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") @@ -75,7 +77,6 @@ async def _reimage_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_scale_set_vm_reimage_input is not None: body_content = self._serialize.body(vm_scale_set_vm_reimage_input, 'VirtualMachineReimageParameters') @@ -83,7 +84,6 @@ async def _reimage_initial( body_content = None 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 @@ -103,7 +103,7 @@ async def begin_reimage( instance_id: str, vm_scale_set_vm_reimage_input: Optional["models.VirtualMachineReimageParameters"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -120,8 +120,8 @@ async def begin_reimage( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -170,7 +170,9 @@ async def _reimage_all_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -191,7 +193,6 @@ async def _reimage_all_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -211,9 +212,9 @@ async def begin_reimage_all( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. - This operation is only supported for managed disks. + This operation is only supported for managed disks. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -227,8 +228,8 @@ async def begin_reimage_all( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -276,7 +277,9 @@ async def _deallocate_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -297,7 +300,6 @@ async def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -317,10 +319,10 @@ async def begin_deallocate( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and - releases the compute resources it uses. You are not billed for the compute resources of this - virtual machine once it is deallocated. + releases the compute resources it uses. You are not billed for the compute resources of this + virtual machine once it is deallocated. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -334,8 +336,8 @@ async def begin_deallocate( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -384,10 +386,13 @@ async def _update_initial( **kwargs ) -> "models.VirtualMachineScaleSetVM": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -406,14 +411,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSetVM') 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 @@ -421,7 +424,6 @@ async def _update_initial( 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('VirtualMachineScaleSetVM', pipeline_response) @@ -441,13 +443,13 @@ async def begin_update( instance_id: str, parameters: "models.VirtualMachineScaleSetVM", **kwargs - ) -> "models.VirtualMachineScaleSetVM": + ) -> AsyncLROPoller["models.VirtualMachineScaleSetVM"]: """Updates a virtual machine of a VM scale set. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_scale_set_name: The name of the VM scale set where the extension should be create or - updated. + updated. :type vm_scale_set_name: str :param instance_id: The instance ID of the virtual machine. :type instance_id: str @@ -459,8 +461,8 @@ async def begin_update( 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: VirtualMachineScaleSetVM, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_06_01.models.VirtualMachineScaleSetVM + :return: An instance of AsyncLROPoller that returns either VirtualMachineScaleSetVM or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineScaleSetVM] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -512,7 +514,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -533,7 +537,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -553,7 +556,7 @@ async def begin_delete( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -568,8 +571,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -630,9 +633,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -650,9 +656,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -690,9 +695,12 @@ async def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -710,9 +718,8 @@ async def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -744,11 +751,14 @@ def list( :type resource_group_name: str :param virtual_machine_scale_set_name: The name of the VM scale set. :type virtual_machine_scale_set_name: str - :param filter: The filter to apply to the operation. + :param filter: The filter to apply to the operation. Allowed values are + 'startswith(instanceView/statuses/code, 'PowerState') eq true', 'properties/latestModelApplied + eq true', 'properties/latestModelApplied eq false'. :type filter: str - :param select: The list parameters. + :param select: The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. :type select: str - :param expand: The expand expression to apply to the operation. + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetVMListResult or the result of cls(response) @@ -756,11 +766,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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 @@ -780,15 +797,11 @@ def prepare_request(next_link=None): query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -823,7 +836,9 @@ async def _power_off_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -844,7 +859,6 @@ async def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -864,10 +878,10 @@ async def begin_power_off( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached - and you are getting charged for the resources. Instead, use deallocate to release resources and - avoid charges. + and you are getting charged for the resources. Instead, use deallocate to release resources and + avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -881,8 +895,8 @@ async def begin_power_off( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -930,7 +944,9 @@ async def _restart_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -951,7 +967,6 @@ async def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -971,7 +986,7 @@ async def begin_restart( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Restarts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -986,8 +1001,8 @@ async def begin_restart( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1035,7 +1050,9 @@ async def _start_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -1056,7 +1073,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1076,7 +1092,7 @@ async def begin_start( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1091,8 +1107,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1140,7 +1156,9 @@ async def _redeploy_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -1161,7 +1179,6 @@ async def _redeploy_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1181,9 +1198,9 @@ async def begin_redeploy( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and - powers it back on. + powers it back on. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1197,8 +1214,8 @@ async def begin_redeploy( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1246,7 +1263,9 @@ async def _perform_maintenance_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -1267,7 +1286,6 @@ async def _perform_maintenance_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1287,7 +1305,7 @@ async def begin_perform_maintenance( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Performs maintenance on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1302,8 +1320,8 @@ async def begin_perform_maintenance( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1350,12 +1368,15 @@ async def _run_command_initial( instance_id: str, parameters: "models.RunCommandInput", **kwargs - ) -> "models.RunCommandResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.RunCommandResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" # Construct URL url = self._run_command_initial.metadata['url'] # type: ignore @@ -1374,14 +1395,12 @@ async def _run_command_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RunCommandInput') 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 @@ -1406,7 +1425,7 @@ async def begin_run_command( instance_id: str, parameters: "models.RunCommandInput", **kwargs - ) -> "models.RunCommandResult": + ) -> AsyncLROPoller["models.RunCommandResult"]: """Run command on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1423,8 +1442,8 @@ async def begin_run_command( 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: RunCommandResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_06_01.models.RunCommandResult + :return: An instance of AsyncLROPoller that returns either RunCommandResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_06_01.models.RunCommandResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_virtual_machine_scale_sets_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_sets_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_virtual_machine_scale_sets_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_sets_operations.py index 46c1131029e8..6aa857640138 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_virtual_machine_scale_sets_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachineScaleSet": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSet') 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('VirtualMachineScaleSet', pipeline_response) @@ -106,7 +106,7 @@ async def begin_create_or_update( vm_scale_set_name: str, parameters: "models.VirtualMachineScaleSet", **kwargs - ) -> "models.VirtualMachineScaleSet": + ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -121,8 +121,8 @@ async def begin_create_or_update( 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: VirtualMachineScaleSet, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_06_01.models.VirtualMachineScaleSet + :return: An instance of AsyncLROPoller that returns either VirtualMachineScaleSet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineScaleSet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -173,10 +173,13 @@ async def _update_initial( **kwargs ) -> "models.VirtualMachineScaleSet": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -194,14 +197,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSetUpdate') 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 @@ -223,7 +224,7 @@ async def begin_update( vm_scale_set_name: str, parameters: "models.VirtualMachineScaleSetUpdate", **kwargs - ) -> "models.VirtualMachineScaleSet": + ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: """Update a VM scale set. :param resource_group_name: The name of the resource group. @@ -238,8 +239,8 @@ async def begin_update( 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: VirtualMachineScaleSet, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_06_01.models.VirtualMachineScaleSet + :return: An instance of AsyncLROPoller that returns either VirtualMachineScaleSet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineScaleSet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -289,7 +290,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -309,7 +312,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -328,7 +330,7 @@ async def begin_delete( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VM scale set. :param resource_group_name: The name of the resource group. @@ -341,8 +343,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -399,9 +401,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -418,9 +423,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -445,7 +449,9 @@ async def _deallocate_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") @@ -467,7 +473,6 @@ async def _deallocate_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -475,7 +480,6 @@ async def _deallocate_initial( body_content = None 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 @@ -494,10 +498,10 @@ async def begin_deallocate( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and - releases the compute resources. You are not billed for the compute resources that this virtual - machine scale set deallocates. + releases the compute resources. You are not billed for the compute resources that this virtual + machine scale set deallocates. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -511,8 +515,8 @@ async def begin_deallocate( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -560,7 +564,9 @@ async def _delete_instances_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") @@ -582,12 +588,10 @@ async def _delete_instances_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -606,7 +610,7 @@ async def begin_delete_instances( vm_scale_set_name: str, vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -621,8 +625,8 @@ async def begin_delete_instances( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -680,9 +684,12 @@ async def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -699,9 +706,8 @@ async def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -733,11 +739,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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 @@ -750,15 +763,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -790,8 +799,8 @@ def list_all( **kwargs ) -> AsyncIterable["models.VirtualMachineScaleSetListWithLinkResult"]: """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource - group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this - till nextLink is null to fetch all the VM Scale Sets. + group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this + till nextLink is null to fetch all the VM Scale Sets. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetListWithLinkResult or the result of cls(response) @@ -799,11 +808,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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_all.metadata['url'] # type: ignore @@ -815,15 +831,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -857,7 +869,7 @@ def list_skus( **kwargs ) -> AsyncIterable["models.VirtualMachineScaleSetListSkusResult"]: """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM - instances allowed for each SKU. + instances allowed for each SKU. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -869,11 +881,18 @@ def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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_skus.metadata['url'] # type: ignore @@ -887,15 +906,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -940,11 +955,18 @@ def get_os_upgrade_history( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListOSUpgradeHistory"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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.get_os_upgrade_history.metadata['url'] # type: ignore @@ -958,15 +980,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1001,7 +1019,9 @@ async def _power_off_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") @@ -1023,7 +1043,6 @@ async def _power_off_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1031,7 +1050,6 @@ async def _power_off_initial( body_content = None 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 @@ -1050,10 +1068,10 @@ async def begin_power_off( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still - attached and you are getting charged for the resources. Instead, use deallocate to release - resources and avoid charges. + attached and you are getting charged for the resources. Instead, use deallocate to release + resources and avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1067,8 +1085,8 @@ async def begin_power_off( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1116,7 +1134,9 @@ async def _restart_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") @@ -1138,7 +1158,6 @@ async def _restart_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1146,7 +1165,6 @@ async def _restart_initial( body_content = None 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 @@ -1165,7 +1183,7 @@ async def begin_restart( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Restarts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1180,8 +1198,8 @@ async def begin_restart( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1229,7 +1247,9 @@ async def _start_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") @@ -1251,7 +1271,6 @@ async def _start_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1259,7 +1278,6 @@ async def _start_initial( body_content = None 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 @@ -1278,7 +1296,7 @@ async def begin_start( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1293,8 +1311,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1342,7 +1360,9 @@ async def _redeploy_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") @@ -1364,7 +1384,6 @@ async def _redeploy_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1372,7 +1391,6 @@ async def _redeploy_initial( body_content = None 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 @@ -1391,9 +1409,9 @@ async def begin_redeploy( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, - and powers them back on. + and powers them back on. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1407,8 +1425,8 @@ async def begin_redeploy( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1456,7 +1474,9 @@ async def _perform_maintenance_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") @@ -1478,7 +1498,6 @@ async def _perform_maintenance_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1486,7 +1505,6 @@ async def _perform_maintenance_initial( body_content = None 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 @@ -1505,11 +1523,11 @@ async def begin_perform_maintenance( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances - which are not eligible for perform maintenance will be failed. Please refer to best practices - for more details: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual- - machine-scale-sets-maintenance-notifications. + which are not eligible for perform maintenance will be failed. Please refer to best practices + for more details: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual- + machine-scale-sets-maintenance-notifications. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1523,8 +1541,8 @@ async def begin_perform_maintenance( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1572,7 +1590,9 @@ async def _update_instances_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") @@ -1594,12 +1614,10 @@ async def _update_instances_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -1618,7 +1636,7 @@ async def begin_update_instances( vm_scale_set_name: str, vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. :param resource_group_name: The name of the resource group. @@ -1633,8 +1651,8 @@ async def begin_update_instances( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1682,7 +1700,9 @@ async def _reimage_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") @@ -1704,7 +1724,6 @@ async def _reimage_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_scale_set_reimage_input is not None: body_content = self._serialize.body(vm_scale_set_reimage_input, 'VirtualMachineScaleSetReimageParameters') @@ -1712,7 +1731,6 @@ async def _reimage_initial( body_content = None 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 @@ -1731,10 +1749,10 @@ async def begin_reimage( vm_scale_set_name: str, vm_scale_set_reimage_input: Optional["models.VirtualMachineScaleSetReimageParameters"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which - don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual - machine is reset to initial state. + don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual + machine is reset to initial state. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1748,8 +1766,8 @@ async def begin_reimage( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1797,7 +1815,9 @@ async def _reimage_all_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") @@ -1819,7 +1839,6 @@ async def _reimage_all_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1827,7 +1846,6 @@ async def _reimage_all_initial( body_content = None 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 @@ -1846,9 +1864,9 @@ async def begin_reimage_all( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This - operation is only supported for managed disks. + operation is only supported for managed disks. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1862,8 +1880,8 @@ async def begin_reimage_all( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1926,9 +1944,12 @@ async def force_recovery_service_fabric_platform_update_domain_walk( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RecoveryWalkResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.force_recovery_service_fabric_platform_update_domain_walk.metadata['url'] # type: ignore @@ -1946,9 +1967,8 @@ async def force_recovery_service_fabric_platform_update_domain_walk( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_virtual_machine_sizes_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_sizes_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_virtual_machine_sizes_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_sizes_operations.py index 188320d65bc5..1f59de878e93 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_virtual_machine_sizes_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_sizes_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -47,7 +47,7 @@ def list( **kwargs ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: """This API is deprecated. Use `Resources Skus `_. + us/rest/api/compute/resourceskus/list>`_. :param location: The location upon which virtual-machine-sizes is queried. :type location: str @@ -57,11 +57,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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 @@ -74,15 +81,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_virtual_machines_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machines_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_virtual_machines_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machines_operations.py index 5c67fe45ec86..64f52f13e1ac 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/_virtual_machines_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machines_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -58,11 +58,18 @@ def list_by_location( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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_location.metadata['url'] # type: ignore @@ -75,15 +82,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -116,12 +119,15 @@ async def _capture_initial( vm_name: str, parameters: "models.VirtualMachineCaptureParameters", **kwargs - ) -> "models.VirtualMachineCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.VirtualMachineCaptureResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._capture_initial.metadata['url'] # type: ignore @@ -139,14 +145,12 @@ async def _capture_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineCaptureParameters') 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 @@ -170,9 +174,9 @@ async def begin_capture( vm_name: str, parameters: "models.VirtualMachineCaptureParameters", **kwargs - ) -> "models.VirtualMachineCaptureResult": + ) -> AsyncLROPoller["models.VirtualMachineCaptureResult"]: """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used - to create similar VMs. + to create similar VMs. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -186,8 +190,8 @@ async def begin_capture( 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: VirtualMachineCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_06_01.models.VirtualMachineCaptureResult + :return: An instance of AsyncLROPoller that returns either VirtualMachineCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineCaptureResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -238,10 +242,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachine": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -259,14 +266,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachine') 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 @@ -274,7 +279,6 @@ async def _create_or_update_initial( 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('VirtualMachine', pipeline_response) @@ -293,7 +297,7 @@ async def begin_create_or_update( vm_name: str, parameters: "models.VirtualMachine", **kwargs - ) -> "models.VirtualMachine": + ) -> AsyncLROPoller["models.VirtualMachine"]: """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -308,8 +312,8 @@ async def begin_create_or_update( 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: VirtualMachine, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_06_01.models.VirtualMachine + :return: An instance of AsyncLROPoller that returns either VirtualMachine or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_06_01.models.VirtualMachine] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,10 +364,13 @@ async def _update_initial( **kwargs ) -> "models.VirtualMachine": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -381,14 +388,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineUpdate') 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 @@ -396,7 +401,6 @@ async def _update_initial( 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('VirtualMachine', pipeline_response) @@ -415,7 +419,7 @@ async def begin_update( vm_name: str, parameters: "models.VirtualMachineUpdate", **kwargs - ) -> "models.VirtualMachine": + ) -> AsyncLROPoller["models.VirtualMachine"]: """The operation to update a virtual machine. :param resource_group_name: The name of the resource group. @@ -430,8 +434,8 @@ async def begin_update( 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: VirtualMachine, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_06_01.models.VirtualMachine + :return: An instance of AsyncLROPoller that returns either VirtualMachine or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_06_01.models.VirtualMachine] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -481,7 +485,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -501,7 +507,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -520,7 +525,7 @@ async def begin_delete( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to delete a virtual machine. :param resource_group_name: The name of the resource group. @@ -533,8 +538,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -594,9 +599,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -615,9 +623,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -652,9 +659,12 @@ async def instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.instance_view.metadata['url'] # type: ignore @@ -671,9 +681,8 @@ async def instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -697,7 +706,9 @@ async def _convert_to_managed_disks_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -717,7 +728,6 @@ async def _convert_to_managed_disks_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -736,9 +746,9 @@ async def begin_convert_to_managed_disks( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop- - deallocated before invoking this operation. + deallocated before invoking this operation. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -750,8 +760,8 @@ async def begin_convert_to_managed_disks( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -797,7 +807,9 @@ async def _deallocate_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -817,7 +829,6 @@ async def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -836,9 +847,9 @@ async def begin_deallocate( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Shuts down the virtual machine and releases the compute resources. You are not billed for the - compute resources that this virtual machine uses. + compute resources that this virtual machine uses. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -850,8 +861,8 @@ async def begin_deallocate( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -908,7 +919,9 @@ async def generalize( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -928,7 +941,6 @@ async def generalize( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -948,7 +960,7 @@ def list( **kwargs ) -> AsyncIterable["models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified resource group. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -958,11 +970,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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 @@ -975,15 +994,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1015,7 +1030,7 @@ def list_all( **kwargs ) -> AsyncIterable["models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified subscription. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineListResult or the result of cls(response) @@ -1023,11 +1038,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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_all.metadata['url'] # type: ignore @@ -1039,15 +1061,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1081,7 +1099,7 @@ def list_available_sizes( **kwargs ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes to which the specified virtual machine can be - resized. + resized. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1093,11 +1111,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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_available_sizes.metadata['url'] # type: ignore @@ -1111,15 +1136,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1153,7 +1174,9 @@ async def _power_off_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -1173,7 +1196,6 @@ async def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1192,9 +1214,9 @@ async def begin_power_off( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with - the same provisioned resources. You are still charged for this virtual machine. + the same provisioned resources. You are still charged for this virtual machine. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1206,8 +1228,8 @@ async def begin_power_off( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1253,7 +1275,9 @@ async def _restart_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -1273,7 +1297,6 @@ async def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1292,7 +1315,7 @@ async def begin_restart( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to restart a virtual machine. :param resource_group_name: The name of the resource group. @@ -1305,8 +1328,8 @@ async def begin_restart( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1352,7 +1375,9 @@ async def _start_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -1372,7 +1397,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1391,7 +1415,7 @@ async def begin_start( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to start a virtual machine. :param resource_group_name: The name of the resource group. @@ -1404,8 +1428,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1451,7 +1475,9 @@ async def _redeploy_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -1471,7 +1497,6 @@ async def _redeploy_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1490,7 +1515,7 @@ async def begin_redeploy( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Shuts down the virtual machine, moves it to a new node, and powers it back on. :param resource_group_name: The name of the resource group. @@ -1503,8 +1528,8 @@ async def begin_redeploy( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1551,7 +1576,9 @@ async def _reimage_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") @@ -1573,7 +1600,6 @@ async def _reimage_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: body_content = self._serialize.body(parameters, 'VirtualMachineReimageParameters') @@ -1581,7 +1607,6 @@ async def _reimage_initial( body_content = None 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 @@ -1600,7 +1625,7 @@ async def begin_reimage( vm_name: str, parameters: Optional["models.VirtualMachineReimageParameters"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Reimages the virtual machine which has an ephemeral OS disk back to its initial state. :param resource_group_name: The name of the resource group. @@ -1615,8 +1640,8 @@ async def begin_reimage( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1663,7 +1688,9 @@ async def _perform_maintenance_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -1683,7 +1710,6 @@ async def _perform_maintenance_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1702,7 +1728,7 @@ async def begin_perform_maintenance( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to perform maintenance on a virtual machine. :param resource_group_name: The name of the resource group. @@ -1715,8 +1741,8 @@ async def begin_perform_maintenance( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1761,12 +1787,15 @@ async def _run_command_initial( vm_name: str, parameters: "models.RunCommandInput", **kwargs - ) -> "models.RunCommandResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.RunCommandResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" # Construct URL url = self._run_command_initial.metadata['url'] # type: ignore @@ -1784,14 +1813,12 @@ async def _run_command_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RunCommandInput') 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 @@ -1815,7 +1842,7 @@ async def begin_run_command( vm_name: str, parameters: "models.RunCommandInput", **kwargs - ) -> "models.RunCommandResult": + ) -> AsyncLROPoller["models.RunCommandResult"]: """Run command on the VM. :param resource_group_name: The name of the resource group. @@ -1830,8 +1857,8 @@ async def begin_run_command( 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: RunCommandResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_06_01.models.RunCommandResult + :return: An instance of AsyncLROPoller that returns either RunCommandResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_06_01.models.RunCommandResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/__init__.py deleted file mode 100644 index 05bef6268f24..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations_async/__init__.py +++ /dev/null @@ -1,53 +0,0 @@ -# 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 ._operations_async import Operations -from ._availability_sets_operations_async import AvailabilitySetsOperations -from ._proximity_placement_groups_operations_async import ProximityPlacementGroupsOperations -from ._virtual_machine_extension_images_operations_async import VirtualMachineExtensionImagesOperations -from ._virtual_machine_extensions_operations_async import VirtualMachineExtensionsOperations -from ._virtual_machine_images_operations_async import VirtualMachineImagesOperations -from ._usage_operations_async import UsageOperations -from ._virtual_machines_operations_async import VirtualMachinesOperations -from ._virtual_machine_sizes_operations_async import VirtualMachineSizesOperations -from ._images_operations_async import ImagesOperations -from ._virtual_machine_scale_sets_operations_async import VirtualMachineScaleSetsOperations -from ._virtual_machine_scale_set_extensions_operations_async import VirtualMachineScaleSetExtensionsOperations -from ._virtual_machine_scale_set_rolling_upgrades_operations_async import VirtualMachineScaleSetRollingUpgradesOperations -from ._virtual_machine_scale_set_vms_operations_async import VirtualMachineScaleSetVMsOperations -from ._log_analytics_operations_async import LogAnalyticsOperations -from ._virtual_machine_run_commands_operations_async import VirtualMachineRunCommandsOperations -from ._galleries_operations_async import GalleriesOperations -from ._gallery_images_operations_async import GalleryImagesOperations -from ._gallery_image_versions_operations_async import GalleryImageVersionsOperations -from ._disks_operations_async import DisksOperations -from ._snapshots_operations_async import SnapshotsOperations - -__all__ = [ - 'Operations', - 'AvailabilitySetsOperations', - 'ProximityPlacementGroupsOperations', - 'VirtualMachineExtensionImagesOperations', - 'VirtualMachineExtensionsOperations', - 'VirtualMachineImagesOperations', - 'UsageOperations', - 'VirtualMachinesOperations', - 'VirtualMachineSizesOperations', - 'ImagesOperations', - 'VirtualMachineScaleSetsOperations', - 'VirtualMachineScaleSetExtensionsOperations', - 'VirtualMachineScaleSetRollingUpgradesOperations', - 'VirtualMachineScaleSetVMsOperations', - 'LogAnalyticsOperations', - 'VirtualMachineRunCommandsOperations', - 'GalleriesOperations', - 'GalleryImagesOperations', - 'GalleryImageVersionsOperations', - 'DisksOperations', - 'SnapshotsOperations', -] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/__init__.py index 472c67226df5..95ecd5b869e5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/__init__.py @@ -390,6 +390,7 @@ AggregatedReplicationState, AvailabilitySetSkuTypes, CachingTypes, + DiffDiskOptions, DiskCreateOption, DiskCreateOptionTypes, DiskStorageAccountTypes, @@ -405,6 +406,7 @@ ProtocolTypes, ProximityPlacementGroupType, ReplicationState, + ReplicationStatusTypes, ResourceIdentityType, RollingUpgradeActionType, RollingUpgradeStatusCode, @@ -614,6 +616,7 @@ 'AggregatedReplicationState', 'AvailabilitySetSkuTypes', 'CachingTypes', + 'DiffDiskOptions', 'DiskCreateOption', 'DiskCreateOptionTypes', 'DiskStorageAccountTypes', @@ -629,6 +632,7 @@ 'ProtocolTypes', 'ProximityPlacementGroupType', 'ReplicationState', + 'ReplicationStatusTypes', 'ResourceIdentityType', 'RollingUpgradeActionType', 'RollingUpgradeStatusCode', diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/_compute_management_client_enums.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/_compute_management_client_enums.py index 66b7154de9c1..e774871f47bc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/_compute_management_client_enums.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/_compute_management_client_enums.py @@ -6,53 +6,77 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum +from enum import Enum, EnumMeta +from six import with_metaclass -class AccessLevel(str, Enum): +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) - none = "None" - read = "Read" + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) -class AggregatedReplicationState(str, Enum): + +class AccessLevel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + NONE = "None" + READ = "Read" + +class AggregatedReplicationState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """This is the aggregated replication status based on all the regional replication status flags. """ - unknown = "Unknown" - in_progress = "InProgress" - completed = "Completed" - failed = "Failed" + UNKNOWN = "Unknown" + IN_PROGRESS = "InProgress" + COMPLETED = "Completed" + FAILED = "Failed" -class AvailabilitySetSkuTypes(str, Enum): +class AvailabilitySetSkuTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the sku of an Availability Set. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual machines with unmanaged disks. Default value is 'Classic'. """ - classic = "Classic" - aligned = "Aligned" + CLASSIC = "Classic" + ALIGNED = "Aligned" -class CachingTypes(str, Enum): +class CachingTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the caching requirements. :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **None** :code:`
`:code:`
` **ReadOnly** :code:`
`:code:`
` **ReadWrite** :code:`
`:code:`
` Default: **None for Standard storage. ReadOnly for Premium storage** """ - none = "None" - read_only = "ReadOnly" - read_write = "ReadWrite" + NONE = "None" + READ_ONLY = "ReadOnly" + READ_WRITE = "ReadWrite" + +class DiffDiskOptions(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the ephemeral disk option for operating system disk. + """ + + LOCAL = "Local" -class DiskCreateOption(str, Enum): +class DiskCreateOption(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """This enumerates the possible sources of a disk's creation. """ - empty = "Empty" - attach = "Attach" - from_image = "FromImage" - import_enum = "Import" - copy = "Copy" - restore = "Restore" + EMPTY = "Empty" + ATTACH = "Attach" + FROM_IMAGE = "FromImage" + IMPORT_ENUM = "Import" + COPY = "Copy" + RESTORE = "Restore" -class DiskCreateOptionTypes(str, Enum): +class DiskCreateOptionTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies how the virtual machine should be created.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` **Attach** \u2013 This value is used when you are using a specialized disk to create the virtual machine.:code:`
`:code:`
` **FromImage** \u2013 @@ -61,190 +85,194 @@ class DiskCreateOptionTypes(str, Enum): marketplace image, you also use the plan element previously described. """ - from_image = "FromImage" - empty = "Empty" - attach = "Attach" + FROM_IMAGE = "FromImage" + EMPTY = "Empty" + ATTACH = "Attach" -class DiskStorageAccountTypes(str, Enum): +class DiskStorageAccountTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The sku name. """ - standard_lrs = "Standard_LRS" - premium_lrs = "Premium_LRS" - standard_ssd_lrs = "StandardSSD_LRS" - ultra_ssd_lrs = "UltraSSD_LRS" + STANDARD_LRS = "Standard_LRS" + PREMIUM_LRS = "Premium_LRS" + STANDARD_SSD_LRS = "StandardSSD_LRS" + ULTRA_SSD_LRS = "UltraSSD_LRS" -class GalleryImagePropertiesProvisioningState(str, Enum): +class GalleryImagePropertiesProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The provisioning state, which only appears in the response. """ - creating = "Creating" - updating = "Updating" - failed = "Failed" - succeeded = "Succeeded" - deleting = "Deleting" - migrating = "Migrating" + CREATING = "Creating" + UPDATING = "Updating" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + DELETING = "Deleting" + MIGRATING = "Migrating" -class GalleryImageVersionPropertiesProvisioningState(str, Enum): +class GalleryImageVersionPropertiesProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The provisioning state, which only appears in the response. """ - creating = "Creating" - updating = "Updating" - failed = "Failed" - succeeded = "Succeeded" - deleting = "Deleting" - migrating = "Migrating" + CREATING = "Creating" + UPDATING = "Updating" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + DELETING = "Deleting" + MIGRATING = "Migrating" -class GalleryPropertiesProvisioningState(str, Enum): +class GalleryPropertiesProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The provisioning state, which only appears in the response. """ - creating = "Creating" - updating = "Updating" - failed = "Failed" - succeeded = "Succeeded" - deleting = "Deleting" - migrating = "Migrating" + CREATING = "Creating" + UPDATING = "Updating" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + DELETING = "Deleting" + MIGRATING = "Migrating" -class HostCaching(str, Enum): +class HostCaching(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' """ - none = "None" - read_only = "ReadOnly" - read_write = "ReadWrite" + NONE = "None" + READ_ONLY = "ReadOnly" + READ_WRITE = "ReadWrite" -class IntervalInMins(str, Enum): +class IntervalInMins(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Interval value in minutes used to create LogAnalytics call rate logs. """ - three_mins = "ThreeMins" - five_mins = "FiveMins" - thirty_mins = "ThirtyMins" - sixty_mins = "SixtyMins" + THREE_MINS = "ThreeMins" + FIVE_MINS = "FiveMins" + THIRTY_MINS = "ThirtyMins" + SIXTY_MINS = "SixtyMins" -class IPVersion(str, Enum): +class IPVersion(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. """ - i_pv4 = "IPv4" - i_pv6 = "IPv6" + I_PV4 = "IPv4" + I_PV6 = "IPv6" -class MaintenanceOperationResultCodeTypes(str, Enum): +class MaintenanceOperationResultCodeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The Last Maintenance Operation Result Code. """ - none = "None" - retry_later = "RetryLater" - maintenance_aborted = "MaintenanceAborted" - maintenance_completed = "MaintenanceCompleted" + NONE = "None" + RETRY_LATER = "RetryLater" + MAINTENANCE_ABORTED = "MaintenanceAborted" + MAINTENANCE_COMPLETED = "MaintenanceCompleted" -class OperatingSystemStateTypes(str, Enum): +class OperatingSystemStateTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The OS State. """ - generalized = "Generalized" - specialized = "Specialized" + GENERALIZED = "Generalized" + SPECIALIZED = "Specialized" -class OperatingSystemTypes(str, Enum): +class OperatingSystemTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The operating system of the osDiskImage. """ - windows = "Windows" - linux = "Linux" + WINDOWS = "Windows" + LINUX = "Linux" -class ProtocolTypes(str, Enum): +class ProtocolTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the protocol of listener. :code:`
`:code:`
` Possible values are: :code:`
`\ **http** :code:`
`:code:`
` **https** """ - http = "Http" - https = "Https" + HTTP = "Http" + HTTPS = "Https" -class ProximityPlacementGroupType(str, Enum): +class ProximityPlacementGroupType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the type of the proximity placement group. :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **Standard** : Co-locate resources within an Azure region or Availability Zone. :code:`
`:code:`
` **Ultra** : For future use. """ - standard = "Standard" - ultra = "Ultra" + STANDARD = "Standard" + ULTRA = "Ultra" -class ReplicationState(str, Enum): +class ReplicationState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """This is the regional replication state. """ - unknown = "Unknown" - replicating = "Replicating" - completed = "Completed" - failed = "Failed" + UNKNOWN = "Unknown" + REPLICATING = "Replicating" + COMPLETED = "Completed" + FAILED = "Failed" + +class ReplicationStatusTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + REPLICATION_STATUS = "ReplicationStatus" -class ResourceIdentityType(str, Enum): +class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The type of identity used for the virtual machine. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine. """ - system_assigned = "SystemAssigned" - user_assigned = "UserAssigned" - system_assigned_user_assigned = "SystemAssigned, UserAssigned" - none = "None" + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned, UserAssigned" + NONE = "None" -class RollingUpgradeActionType(str, Enum): +class RollingUpgradeActionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The last action performed on the rolling upgrade. """ - start = "Start" - cancel = "Cancel" + START = "Start" + CANCEL = "Cancel" -class RollingUpgradeStatusCode(str, Enum): +class RollingUpgradeStatusCode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Code indicating the current status of the upgrade. """ - rolling_forward = "RollingForward" - cancelled = "Cancelled" - completed = "Completed" - faulted = "Faulted" + ROLLING_FORWARD = "RollingForward" + CANCELLED = "Cancelled" + COMPLETED = "Completed" + FAULTED = "Faulted" -class SettingNames(str, Enum): +class SettingNames(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon. """ - auto_logon = "AutoLogon" - first_logon_commands = "FirstLogonCommands" + AUTO_LOGON = "AutoLogon" + FIRST_LOGON_COMMANDS = "FirstLogonCommands" -class SnapshotStorageAccountTypes(str, Enum): +class SnapshotStorageAccountTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The sku name. """ - standard_lrs = "Standard_LRS" - premium_lrs = "Premium_LRS" - standard_zrs = "Standard_ZRS" + STANDARD_LRS = "Standard_LRS" + PREMIUM_LRS = "Premium_LRS" + STANDARD_ZRS = "Standard_ZRS" -class StatusLevelTypes(str, Enum): +class StatusLevelTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The level code. """ - info = "Info" - warning = "Warning" - error = "Error" + INFO = "Info" + WARNING = "Warning" + ERROR = "Error" -class StorageAccountTypes(str, Enum): +class StorageAccountTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the storage account type for the managed disk. Managed OS disk storage account type can only be set when you create the scale set. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. """ - standard_lrs = "Standard_LRS" - premium_lrs = "Premium_LRS" - standard_ssd_lrs = "StandardSSD_LRS" - ultra_ssd_lrs = "UltraSSD_LRS" + STANDARD_LRS = "Standard_LRS" + PREMIUM_LRS = "Premium_LRS" + STANDARD_SSD_LRS = "StandardSSD_LRS" + ULTRA_SSD_LRS = "UltraSSD_LRS" -class UpgradeMode(str, Enum): +class UpgradeMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the mode of an upgrade to virtual machines in the scale set.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` **Manual** - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade @@ -252,51 +280,51 @@ class UpgradeMode(str, Enum): automatically updated at the same time. """ - automatic = "Automatic" - manual = "Manual" - rolling = "Rolling" + AUTOMATIC = "Automatic" + MANUAL = "Manual" + ROLLING = "Rolling" -class UpgradeOperationInvoker(str, Enum): +class UpgradeOperationInvoker(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Invoker of the Upgrade Operation """ - unknown = "Unknown" - user = "User" - platform = "Platform" + UNKNOWN = "Unknown" + USER = "User" + PLATFORM = "Platform" -class UpgradeState(str, Enum): +class UpgradeState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Code indicating the current status of the upgrade. """ - rolling_forward = "RollingForward" - cancelled = "Cancelled" - completed = "Completed" - faulted = "Faulted" + ROLLING_FORWARD = "RollingForward" + CANCELLED = "Cancelled" + COMPLETED = "Completed" + FAULTED = "Faulted" -class VirtualMachineEvictionPolicyTypes(str, Enum): +class VirtualMachineEvictionPolicyTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the eviction policy for virtual machines in a low priority scale set. :code:`
`:code:`
`Minimum api-version: 2017-10-30-preview """ - deallocate = "Deallocate" - delete = "Delete" + DEALLOCATE = "Deallocate" + DELETE = "Delete" -class VirtualMachinePriorityTypes(str, Enum): +class VirtualMachinePriorityTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the priority for the virtual machines in the scale set. :code:`
`:code:`
`Minimum api-version: 2017-10-30-preview """ - regular = "Regular" - low = "Low" + REGULAR = "Regular" + LOW = "Low" -class VirtualMachineScaleSetSkuScaleType(str, Enum): +class VirtualMachineScaleSetSkuScaleType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The scale type applicable to the sku. """ - automatic = "Automatic" - none = "None" + AUTOMATIC = "Automatic" + NONE = "None" -class VirtualMachineSizeTypes(str, Enum): +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 `_. @@ -310,169 +338,169 @@ class VirtualMachineSizeTypes(str, Enum): `_ """ - basic_a0 = "Basic_A0" - basic_a1 = "Basic_A1" - basic_a2 = "Basic_A2" - basic_a3 = "Basic_A3" - basic_a4 = "Basic_A4" - standard_a0 = "Standard_A0" - standard_a1 = "Standard_A1" - standard_a2 = "Standard_A2" - standard_a3 = "Standard_A3" - standard_a4 = "Standard_A4" - standard_a5 = "Standard_A5" - standard_a6 = "Standard_A6" - standard_a7 = "Standard_A7" - standard_a8 = "Standard_A8" - standard_a9 = "Standard_A9" - standard_a10 = "Standard_A10" - standard_a11 = "Standard_A11" - standard_a1_v2 = "Standard_A1_v2" - standard_a2_v2 = "Standard_A2_v2" - standard_a4_v2 = "Standard_A4_v2" - standard_a8_v2 = "Standard_A8_v2" - standard_a2_m_v2 = "Standard_A2m_v2" - standard_a4_m_v2 = "Standard_A4m_v2" - standard_a8_m_v2 = "Standard_A8m_v2" - standard_b1_s = "Standard_B1s" - standard_b1_ms = "Standard_B1ms" - standard_b2_s = "Standard_B2s" - standard_b2_ms = "Standard_B2ms" - standard_b4_ms = "Standard_B4ms" - standard_b8_ms = "Standard_B8ms" - standard_d1 = "Standard_D1" - standard_d2 = "Standard_D2" - standard_d3 = "Standard_D3" - standard_d4 = "Standard_D4" - standard_d11 = "Standard_D11" - standard_d12 = "Standard_D12" - standard_d13 = "Standard_D13" - standard_d14 = "Standard_D14" - standard_d1_v2 = "Standard_D1_v2" - standard_d2_v2 = "Standard_D2_v2" - standard_d3_v2 = "Standard_D3_v2" - standard_d4_v2 = "Standard_D4_v2" - standard_d5_v2 = "Standard_D5_v2" - standard_d2_v3 = "Standard_D2_v3" - standard_d4_v3 = "Standard_D4_v3" - standard_d8_v3 = "Standard_D8_v3" - standard_d16_v3 = "Standard_D16_v3" - standard_d32_v3 = "Standard_D32_v3" - standard_d64_v3 = "Standard_D64_v3" - standard_d2_s_v3 = "Standard_D2s_v3" - standard_d4_s_v3 = "Standard_D4s_v3" - standard_d8_s_v3 = "Standard_D8s_v3" - standard_d16_s_v3 = "Standard_D16s_v3" - standard_d32_s_v3 = "Standard_D32s_v3" - standard_d64_s_v3 = "Standard_D64s_v3" - standard_d11_v2 = "Standard_D11_v2" - standard_d12_v2 = "Standard_D12_v2" - standard_d13_v2 = "Standard_D13_v2" - standard_d14_v2 = "Standard_D14_v2" - standard_d15_v2 = "Standard_D15_v2" - standard_ds1 = "Standard_DS1" - standard_ds2 = "Standard_DS2" - standard_ds3 = "Standard_DS3" - standard_ds4 = "Standard_DS4" - standard_ds11 = "Standard_DS11" - standard_ds12 = "Standard_DS12" - standard_ds13 = "Standard_DS13" - standard_ds14 = "Standard_DS14" - standard_ds1_v2 = "Standard_DS1_v2" - standard_ds2_v2 = "Standard_DS2_v2" - standard_ds3_v2 = "Standard_DS3_v2" - standard_ds4_v2 = "Standard_DS4_v2" - standard_ds5_v2 = "Standard_DS5_v2" - standard_ds11_v2 = "Standard_DS11_v2" - standard_ds12_v2 = "Standard_DS12_v2" - standard_ds13_v2 = "Standard_DS13_v2" - standard_ds14_v2 = "Standard_DS14_v2" - standard_ds15_v2 = "Standard_DS15_v2" - standard_ds13_4_v2 = "Standard_DS13-4_v2" - standard_ds13_2_v2 = "Standard_DS13-2_v2" - standard_ds14_8_v2 = "Standard_DS14-8_v2" - standard_ds14_4_v2 = "Standard_DS14-4_v2" - standard_e2_v3 = "Standard_E2_v3" - standard_e4_v3 = "Standard_E4_v3" - standard_e8_v3 = "Standard_E8_v3" - standard_e16_v3 = "Standard_E16_v3" - standard_e32_v3 = "Standard_E32_v3" - standard_e64_v3 = "Standard_E64_v3" - standard_e2_s_v3 = "Standard_E2s_v3" - standard_e4_s_v3 = "Standard_E4s_v3" - standard_e8_s_v3 = "Standard_E8s_v3" - standard_e16_s_v3 = "Standard_E16s_v3" - standard_e32_s_v3 = "Standard_E32s_v3" - standard_e64_s_v3 = "Standard_E64s_v3" - standard_e32_16_v3 = "Standard_E32-16_v3" - standard_e32_8_s_v3 = "Standard_E32-8s_v3" - standard_e64_32_s_v3 = "Standard_E64-32s_v3" - standard_e64_16_s_v3 = "Standard_E64-16s_v3" - standard_f1 = "Standard_F1" - standard_f2 = "Standard_F2" - standard_f4 = "Standard_F4" - standard_f8 = "Standard_F8" - standard_f16 = "Standard_F16" - standard_f1_s = "Standard_F1s" - standard_f2_s = "Standard_F2s" - standard_f4_s = "Standard_F4s" - standard_f8_s = "Standard_F8s" - standard_f16_s = "Standard_F16s" - standard_f2_s_v2 = "Standard_F2s_v2" - standard_f4_s_v2 = "Standard_F4s_v2" - standard_f8_s_v2 = "Standard_F8s_v2" - standard_f16_s_v2 = "Standard_F16s_v2" - standard_f32_s_v2 = "Standard_F32s_v2" - standard_f64_s_v2 = "Standard_F64s_v2" - standard_f72_s_v2 = "Standard_F72s_v2" - standard_g1 = "Standard_G1" - standard_g2 = "Standard_G2" - standard_g3 = "Standard_G3" - standard_g4 = "Standard_G4" - standard_g5 = "Standard_G5" - standard_gs1 = "Standard_GS1" - standard_gs2 = "Standard_GS2" - standard_gs3 = "Standard_GS3" - standard_gs4 = "Standard_GS4" - standard_gs5 = "Standard_GS5" - standard_gs4_8 = "Standard_GS4-8" - standard_gs4_4 = "Standard_GS4-4" - standard_gs5_16 = "Standard_GS5-16" - standard_gs5_8 = "Standard_GS5-8" - standard_h8 = "Standard_H8" - standard_h16 = "Standard_H16" - standard_h8_m = "Standard_H8m" - standard_h16_m = "Standard_H16m" - standard_h16_r = "Standard_H16r" - standard_h16_mr = "Standard_H16mr" - standard_l4_s = "Standard_L4s" - standard_l8_s = "Standard_L8s" - standard_l16_s = "Standard_L16s" - standard_l32_s = "Standard_L32s" - standard_m64_s = "Standard_M64s" - standard_m64_ms = "Standard_M64ms" - standard_m128_s = "Standard_M128s" - standard_m128_ms = "Standard_M128ms" - standard_m64_32_ms = "Standard_M64-32ms" - standard_m64_16_ms = "Standard_M64-16ms" - standard_m128_64_ms = "Standard_M128-64ms" - standard_m128_32_ms = "Standard_M128-32ms" - standard_nc6 = "Standard_NC6" - standard_nc12 = "Standard_NC12" - standard_nc24 = "Standard_NC24" - standard_nc24_r = "Standard_NC24r" - standard_nc6_s_v2 = "Standard_NC6s_v2" - standard_nc12_s_v2 = "Standard_NC12s_v2" - standard_nc24_s_v2 = "Standard_NC24s_v2" - standard_nc24_rs_v2 = "Standard_NC24rs_v2" - standard_nc6_s_v3 = "Standard_NC6s_v3" - standard_nc12_s_v3 = "Standard_NC12s_v3" - standard_nc24_s_v3 = "Standard_NC24s_v3" - standard_nc24_rs_v3 = "Standard_NC24rs_v3" - standard_nd6_s = "Standard_ND6s" - standard_nd12_s = "Standard_ND12s" - standard_nd24_s = "Standard_ND24s" - standard_nd24_rs = "Standard_ND24rs" - standard_nv6 = "Standard_NV6" - standard_nv12 = "Standard_NV12" - standard_nv24 = "Standard_NV24" + BASIC_A0 = "Basic_A0" + BASIC_A1 = "Basic_A1" + BASIC_A2 = "Basic_A2" + BASIC_A3 = "Basic_A3" + BASIC_A4 = "Basic_A4" + STANDARD_A0 = "Standard_A0" + STANDARD_A1 = "Standard_A1" + STANDARD_A2 = "Standard_A2" + STANDARD_A3 = "Standard_A3" + STANDARD_A4 = "Standard_A4" + STANDARD_A5 = "Standard_A5" + STANDARD_A6 = "Standard_A6" + STANDARD_A7 = "Standard_A7" + STANDARD_A8 = "Standard_A8" + STANDARD_A9 = "Standard_A9" + STANDARD_A10 = "Standard_A10" + STANDARD_A11 = "Standard_A11" + STANDARD_A1_V2 = "Standard_A1_v2" + STANDARD_A2_V2 = "Standard_A2_v2" + STANDARD_A4_V2 = "Standard_A4_v2" + STANDARD_A8_V2 = "Standard_A8_v2" + STANDARD_A2_M_V2 = "Standard_A2m_v2" + STANDARD_A4_M_V2 = "Standard_A4m_v2" + STANDARD_A8_M_V2 = "Standard_A8m_v2" + STANDARD_B1_S = "Standard_B1s" + STANDARD_B1_MS = "Standard_B1ms" + STANDARD_B2_S = "Standard_B2s" + STANDARD_B2_MS = "Standard_B2ms" + STANDARD_B4_MS = "Standard_B4ms" + STANDARD_B8_MS = "Standard_B8ms" + STANDARD_D1 = "Standard_D1" + STANDARD_D2 = "Standard_D2" + STANDARD_D3 = "Standard_D3" + STANDARD_D4 = "Standard_D4" + STANDARD_D11 = "Standard_D11" + STANDARD_D12 = "Standard_D12" + STANDARD_D13 = "Standard_D13" + STANDARD_D14 = "Standard_D14" + STANDARD_D1_V2 = "Standard_D1_v2" + STANDARD_D2_V2 = "Standard_D2_v2" + STANDARD_D3_V2 = "Standard_D3_v2" + STANDARD_D4_V2 = "Standard_D4_v2" + STANDARD_D5_V2 = "Standard_D5_v2" + STANDARD_D2_V3 = "Standard_D2_v3" + STANDARD_D4_V3 = "Standard_D4_v3" + STANDARD_D8_V3 = "Standard_D8_v3" + STANDARD_D16_V3 = "Standard_D16_v3" + STANDARD_D32_V3 = "Standard_D32_v3" + STANDARD_D64_V3 = "Standard_D64_v3" + STANDARD_D2_S_V3 = "Standard_D2s_v3" + STANDARD_D4_S_V3 = "Standard_D4s_v3" + STANDARD_D8_S_V3 = "Standard_D8s_v3" + STANDARD_D16_S_V3 = "Standard_D16s_v3" + STANDARD_D32_S_V3 = "Standard_D32s_v3" + STANDARD_D64_S_V3 = "Standard_D64s_v3" + STANDARD_D11_V2 = "Standard_D11_v2" + STANDARD_D12_V2 = "Standard_D12_v2" + STANDARD_D13_V2 = "Standard_D13_v2" + STANDARD_D14_V2 = "Standard_D14_v2" + STANDARD_D15_V2 = "Standard_D15_v2" + STANDARD_DS1 = "Standard_DS1" + STANDARD_DS2 = "Standard_DS2" + STANDARD_DS3 = "Standard_DS3" + STANDARD_DS4 = "Standard_DS4" + STANDARD_DS11 = "Standard_DS11" + STANDARD_DS12 = "Standard_DS12" + STANDARD_DS13 = "Standard_DS13" + STANDARD_DS14 = "Standard_DS14" + STANDARD_DS1_V2 = "Standard_DS1_v2" + STANDARD_DS2_V2 = "Standard_DS2_v2" + STANDARD_DS3_V2 = "Standard_DS3_v2" + STANDARD_DS4_V2 = "Standard_DS4_v2" + STANDARD_DS5_V2 = "Standard_DS5_v2" + STANDARD_DS11_V2 = "Standard_DS11_v2" + STANDARD_DS12_V2 = "Standard_DS12_v2" + STANDARD_DS13_V2 = "Standard_DS13_v2" + STANDARD_DS14_V2 = "Standard_DS14_v2" + STANDARD_DS15_V2 = "Standard_DS15_v2" + STANDARD_DS13_4_V2 = "Standard_DS13-4_v2" + STANDARD_DS13_2_V2 = "Standard_DS13-2_v2" + STANDARD_DS14_8_V2 = "Standard_DS14-8_v2" + STANDARD_DS14_4_V2 = "Standard_DS14-4_v2" + STANDARD_E2_V3 = "Standard_E2_v3" + STANDARD_E4_V3 = "Standard_E4_v3" + STANDARD_E8_V3 = "Standard_E8_v3" + STANDARD_E16_V3 = "Standard_E16_v3" + STANDARD_E32_V3 = "Standard_E32_v3" + STANDARD_E64_V3 = "Standard_E64_v3" + STANDARD_E2_S_V3 = "Standard_E2s_v3" + STANDARD_E4_S_V3 = "Standard_E4s_v3" + STANDARD_E8_S_V3 = "Standard_E8s_v3" + STANDARD_E16_S_V3 = "Standard_E16s_v3" + STANDARD_E32_S_V3 = "Standard_E32s_v3" + STANDARD_E64_S_V3 = "Standard_E64s_v3" + STANDARD_E32_16_V3 = "Standard_E32-16_v3" + STANDARD_E32_8_S_V3 = "Standard_E32-8s_v3" + STANDARD_E64_32_S_V3 = "Standard_E64-32s_v3" + STANDARD_E64_16_S_V3 = "Standard_E64-16s_v3" + STANDARD_F1 = "Standard_F1" + STANDARD_F2 = "Standard_F2" + STANDARD_F4 = "Standard_F4" + STANDARD_F8 = "Standard_F8" + STANDARD_F16 = "Standard_F16" + STANDARD_F1_S = "Standard_F1s" + STANDARD_F2_S = "Standard_F2s" + STANDARD_F4_S = "Standard_F4s" + STANDARD_F8_S = "Standard_F8s" + STANDARD_F16_S = "Standard_F16s" + STANDARD_F2_S_V2 = "Standard_F2s_v2" + STANDARD_F4_S_V2 = "Standard_F4s_v2" + STANDARD_F8_S_V2 = "Standard_F8s_v2" + STANDARD_F16_S_V2 = "Standard_F16s_v2" + STANDARD_F32_S_V2 = "Standard_F32s_v2" + STANDARD_F64_S_V2 = "Standard_F64s_v2" + STANDARD_F72_S_V2 = "Standard_F72s_v2" + STANDARD_G1 = "Standard_G1" + STANDARD_G2 = "Standard_G2" + STANDARD_G3 = "Standard_G3" + STANDARD_G4 = "Standard_G4" + STANDARD_G5 = "Standard_G5" + STANDARD_GS1 = "Standard_GS1" + STANDARD_GS2 = "Standard_GS2" + STANDARD_GS3 = "Standard_GS3" + STANDARD_GS4 = "Standard_GS4" + STANDARD_GS5 = "Standard_GS5" + STANDARD_GS4_8 = "Standard_GS4-8" + STANDARD_GS4_4 = "Standard_GS4-4" + STANDARD_GS5_16 = "Standard_GS5-16" + STANDARD_GS5_8 = "Standard_GS5-8" + STANDARD_H8 = "Standard_H8" + STANDARD_H16 = "Standard_H16" + STANDARD_H8_M = "Standard_H8m" + STANDARD_H16_M = "Standard_H16m" + STANDARD_H16_R = "Standard_H16r" + STANDARD_H16_MR = "Standard_H16mr" + STANDARD_L4_S = "Standard_L4s" + STANDARD_L8_S = "Standard_L8s" + STANDARD_L16_S = "Standard_L16s" + STANDARD_L32_S = "Standard_L32s" + STANDARD_M64_S = "Standard_M64s" + STANDARD_M64_MS = "Standard_M64ms" + STANDARD_M128_S = "Standard_M128s" + STANDARD_M128_MS = "Standard_M128ms" + STANDARD_M64_32_MS = "Standard_M64-32ms" + STANDARD_M64_16_MS = "Standard_M64-16ms" + STANDARD_M128_64_MS = "Standard_M128-64ms" + STANDARD_M128_32_MS = "Standard_M128-32ms" + STANDARD_NC6 = "Standard_NC6" + STANDARD_NC12 = "Standard_NC12" + STANDARD_NC24 = "Standard_NC24" + STANDARD_NC24_R = "Standard_NC24r" + STANDARD_NC6_S_V2 = "Standard_NC6s_v2" + STANDARD_NC12_S_V2 = "Standard_NC12s_v2" + STANDARD_NC24_S_V2 = "Standard_NC24s_v2" + STANDARD_NC24_RS_V2 = "Standard_NC24rs_v2" + STANDARD_NC6_S_V3 = "Standard_NC6s_v3" + STANDARD_NC12_S_V3 = "Standard_NC12s_v3" + STANDARD_NC24_S_V3 = "Standard_NC24s_v3" + STANDARD_NC24_RS_V3 = "Standard_NC24rs_v3" + STANDARD_ND6_S = "Standard_ND6s" + STANDARD_ND12_S = "Standard_ND12s" + STANDARD_ND24_S = "Standard_ND24s" + STANDARD_ND24_RS = "Standard_ND24rs" + STANDARD_NV6 = "Standard_NV6" + STANDARD_NV12 = "Standard_NV12" + STANDARD_NV24 = "Standard_NV24" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/_models.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/_models.py index 7a70363fef8f..829c0f4aaaee 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/_models.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/_models.py @@ -786,28 +786,21 @@ def __init__( class DiffDiskSettings(msrest.serialization.Model): """Describes the parameters of ephemeral disk settings that can be specified for operating system disk. :code:`
`:code:`
` NOTE: The ephemeral disk settings can only be specified for managed disk. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar option: Specifies the ephemeral disk settings for operating system disk. Default value: - "Local". - :vartype option: str + :param option: Specifies the ephemeral disk settings for operating system disk. Possible values + include: "Local". + :type option: str or ~azure.mgmt.compute.v2018_06_01.models.DiffDiskOptions """ - _validation = { - 'option': {'constant': True}, - } - _attribute_map = { 'option': {'key': 'option', 'type': 'str'}, } - option = "Local" - def __init__( self, **kwargs ): super(DiffDiskSettings, self).__init__(**kwargs) + self.option = kwargs.get('option', None) class Disallowed(msrest.serialization.Model): @@ -7367,8 +7360,7 @@ class WindowsConfiguration(msrest.serialization.Model): the VM so that extensions can be added to the VM later. :type provision_vm_agent: bool :param enable_automatic_updates: Indicates whether virtual machine is enabled for automatic - Windows updates. Default value is true. :code:`
`:code:`
` For virtual machine scale - sets, this property can be updated and updates will take effect on OS reprovisioning. + updates. :type enable_automatic_updates: bool :param time_zone: Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time". :type time_zone: str diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/_models_py3.py index eccd9afb82b4..4c0cdcb2d3e9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/_models_py3.py @@ -854,28 +854,23 @@ def __init__( class DiffDiskSettings(msrest.serialization.Model): """Describes the parameters of ephemeral disk settings that can be specified for operating system disk. :code:`
`:code:`
` NOTE: The ephemeral disk settings can only be specified for managed disk. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar option: Specifies the ephemeral disk settings for operating system disk. Default value: - "Local". - :vartype option: str + :param option: Specifies the ephemeral disk settings for operating system disk. Possible values + include: "Local". + :type option: str or ~azure.mgmt.compute.v2018_06_01.models.DiffDiskOptions """ - _validation = { - 'option': {'constant': True}, - } - _attribute_map = { 'option': {'key': 'option', 'type': 'str'}, } - option = "Local" - def __init__( self, + *, + option: Optional[Union[str, "DiffDiskOptions"]] = None, **kwargs ): super(DiffDiskSettings, self).__init__(**kwargs) + self.option = option class Disallowed(msrest.serialization.Model): @@ -8125,8 +8120,7 @@ class WindowsConfiguration(msrest.serialization.Model): the VM so that extensions can be added to the VM later. :type provision_vm_agent: bool :param enable_automatic_updates: Indicates whether virtual machine is enabled for automatic - Windows updates. Default value is true. :code:`
`:code:`
` For virtual machine scale - sets, this property can be updated and updates will take effect on OS reprovisioning. + updates. :type enable_automatic_updates: bool :param time_zone: Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time". :type time_zone: str diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_availability_sets_operations.py index 0b055a0e13a2..21f921de79ff 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_availability_sets_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -67,10 +67,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -88,14 +91,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailabilitySet') 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 @@ -133,10 +134,13 @@ def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -154,14 +158,12 @@ def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailabilitySetUpdate') 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 @@ -196,7 +198,9 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -216,7 +220,6 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,9 +252,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -268,9 +274,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -295,7 +300,8 @@ def list_by_subscription( # type: (...) -> Iterable["models.AvailabilitySetListResult"] """Lists all availability sets in a subscription. - :param expand: The expand expression to apply to the operation. + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AvailabilitySetListResult or the result of cls(response) @@ -303,11 +309,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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_subscription.metadata['url'] # type: ignore @@ -321,15 +334,11 @@ def prepare_request(next_link=None): if expand is not None: query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -372,11 +381,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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 @@ -389,15 +405,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -432,7 +444,7 @@ def list_available_sizes( ): # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes that can be used to create a new virtual machine in - an existing availability set. + an existing availability set. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -444,11 +456,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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_available_sizes.metadata['url'] # type: ignore @@ -462,15 +481,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_disks_operations.py index 8a459bb1a8e3..4bba7562aa28 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_disks_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.Disk" cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('Disk', pipeline_response) @@ -112,14 +112,14 @@ def begin_create_or_update( disk, # type: "models.Disk" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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.v2018_06_01.models.Disk @@ -182,10 +182,13 @@ def _update_initial( ): # type: (...) -> "models.Disk" cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -203,14 +206,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -218,7 +219,6 @@ def _update_initial( 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('Disk', pipeline_response) @@ -238,14 +238,14 @@ def begin_update( disk, # type: "models.DiskUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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.v2018_06_01.models.DiskUpdate @@ -320,9 +320,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -339,9 +342,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -366,7 +368,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -386,7 +390,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -406,14 +409,14 @@ def begin_delete( disk_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. @@ -477,11 +480,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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 @@ -494,15 +504,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -542,11 +548,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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 @@ -558,15 +571,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -600,12 +609,15 @@ def _grant_access_initial( grant_access_data, # type: "models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> "models.AccessUri" - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # 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 = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._grant_access_initial.metadata['url'] # type: ignore @@ -623,14 +635,12 @@ def _grant_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -655,17 +665,17 @@ def begin_grant_access( grant_access_data, # type: "models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. + operation. :type grant_access_data: ~azure.mgmt.compute.v2018_06_01.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. @@ -725,7 +735,9 @@ def _revoke_access_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -745,7 +757,6 @@ def _revoke_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -765,14 +776,14 @@ def begin_revoke_access( disk_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_galleries_operations.py index 0441db937b9d..120e3554f413 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_galleries_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.Gallery" cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery, 'Gallery') 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('Gallery', pipeline_response) @@ -115,13 +115,13 @@ def begin_create_or_update( gallery, # type: "models.Gallery" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Gallery"] """Create or update a Shared Image Gallery. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery. The allowed characters are alphabets - and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. + and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. :type gallery_name: str :param gallery: Parameters supplied to the create or update Shared Image Gallery operation. :type gallery: ~azure.mgmt.compute.v2018_06_01.models.Gallery @@ -194,9 +194,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -213,9 +216,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -240,9 +242,12 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -259,8 +264,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -280,7 +285,7 @@ def begin_delete( gallery_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Delete a Shared Image Gallery. :param resource_group_name: The name of the resource group. @@ -349,11 +354,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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 @@ -366,15 +378,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -414,11 +422,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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 @@ -430,15 +445,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_gallery_image_versions_operations.py index 487b2021ad5c..f235045ac12f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_gallery_image_versions_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -58,10 +58,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.GalleryImageVersion" cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -81,14 +84,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_image_version, 'GalleryImageVersion') 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 @@ -96,7 +97,6 @@ def _create_or_update_initial( 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('GalleryImageVersion', pipeline_response) @@ -121,24 +121,24 @@ def begin_create_or_update( gallery_image_version, # type: "models.GalleryImageVersion" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GalleryImageVersion"] """Create or update a gallery Image Version. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. + resides. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition in which the Image Version - is to be created. + is to be created. :type gallery_image_name: str :param gallery_image_version_name: The name of the gallery Image Version to be created. Needs - to follow semantic version name pattern: The allowed characters are digit and period. Digits - must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. + to follow semantic version name pattern: The allowed characters are digit and period. Digits + must be within the range of a 32-bit integer. Format: + :code:``.:code:``.:code:``. :type gallery_image_version_name: str :param gallery_image_version: Parameters supplied to the create or update gallery Image Version - operation. + operation. :type gallery_image_version: ~azure.mgmt.compute.v2018_06_01.models.GalleryImageVersion :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. @@ -198,7 +198,7 @@ def get( gallery_name, # type: str gallery_image_name, # type: str gallery_image_version_name, # type: str - expand="ReplicationStatus", # type: Optional[str] + expand=None, # type: Optional[Union[str, "models.ReplicationStatusTypes"]] **kwargs # type: Any ): # type: (...) -> "models.GalleryImageVersion" @@ -215,16 +215,19 @@ def get( :param gallery_image_version_name: The name of the gallery Image Version to be retrieved. :type gallery_image_version_name: str :param expand: The expand expression to apply on the operation. - :type expand: str + :type expand: str or ~azure.mgmt.compute.v2018_06_01.models.ReplicationStatusTypes :keyword callable cls: A custom type or function that will be passed the direct response :return: GalleryImageVersion, or the result of cls(response) :rtype: ~azure.mgmt.compute.v2018_06_01.models.GalleryImageVersion :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -245,9 +248,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -274,9 +276,12 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -295,8 +300,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -318,16 +323,16 @@ def begin_delete( gallery_image_version_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Delete a gallery Image Version. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. + resides. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition in which the Image Version - resides. + resides. :type gallery_image_name: str :param gallery_image_version_name: The name of the gallery Image Version to be deleted. :type gallery_image_version_name: str @@ -392,10 +397,10 @@ def list_by_gallery_image( :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. + resides. :type gallery_name: str :param gallery_image_name: The name of the Shared Image Gallery Image Definition from which the - Image Versions are to be listed. + Image Versions are to be listed. :type gallery_image_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GalleryImageVersionList or the result of cls(response) @@ -403,11 +408,18 @@ def list_by_gallery_image( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersionList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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_gallery_image.metadata['url'] # type: ignore @@ -422,15 +434,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_gallery_images_operations.py index 5e9925c768d5..2ac6299f0d00 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_gallery_images_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -57,10 +57,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.GalleryImage" cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -79,14 +82,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_image, 'GalleryImage') 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 @@ -94,7 +95,6 @@ def _create_or_update_initial( 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('GalleryImage', pipeline_response) @@ -118,17 +118,17 @@ def begin_create_or_update( gallery_image, # type: "models.GalleryImage" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GalleryImage"] """Create or update a gallery Image Definition. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to - be created. + be created. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition to be created or updated. - The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the - middle. The maximum length is 80 characters. + The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the + middle. The maximum length is 80 characters. :type gallery_image_name: str :param gallery_image: Parameters supplied to the create or update gallery image operation. :type gallery_image: ~azure.mgmt.compute.v2018_06_01.models.GalleryImage @@ -206,9 +206,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -226,9 +229,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,9 +256,12 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -274,8 +279,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -296,13 +301,13 @@ def begin_delete( gallery_image_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Delete a gallery image. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to - be deleted. + be deleted. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition to be deleted. :type gallery_image_name: str @@ -365,7 +370,7 @@ def list_by_gallery( :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery from which Image Definitions are to - be listed. + be listed. :type gallery_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GalleryImageList or the result of cls(response) @@ -373,11 +378,18 @@ def list_by_gallery( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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_gallery.metadata['url'] # type: ignore @@ -391,15 +403,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_images_operations.py index 375cde2e91b8..32ed41d3ef4b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_images_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.Image" cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'Image') 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('Image', pipeline_response) @@ -112,7 +112,7 @@ def begin_create_or_update( parameters, # type: "models.Image" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Image"] """Create or update an image. :param resource_group_name: The name of the resource group. @@ -180,10 +180,13 @@ def _update_initial( ): # type: (...) -> "models.Image" cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -201,14 +204,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ImageUpdate') 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 @@ -216,7 +217,6 @@ def _update_initial( 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('Image', pipeline_response) @@ -236,7 +236,7 @@ def begin_update( parameters, # type: "models.ImageUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Image"] """Update an image. :param resource_group_name: The name of the resource group. @@ -303,7 +303,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -323,7 +325,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -343,7 +344,7 @@ def begin_delete( image_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes an Image. :param resource_group_name: The name of the resource group. @@ -418,9 +419,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -439,9 +443,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -474,11 +477,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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 @@ -491,15 +501,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -532,7 +538,7 @@ def list( ): # type: (...) -> Iterable["models.ImageListResult"] """Gets the list of Images in the subscription. Use nextLink property in the response to get the - next page of Images. Do this till nextLink is null to fetch all the Images. + next page of Images. Do this till nextLink is null to fetch all the Images. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ImageListResult or the result of cls(response) @@ -540,11 +546,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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 @@ -556,15 +569,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_log_analytics_operations.py index 46e5a24be4e3..e2a607b062f2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_log_analytics_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod @@ -52,12 +52,15 @@ def _export_request_rate_by_interval_initial( parameters, # type: "models.RequestRateByIntervalInput" **kwargs # type: Any ): - # type: (...) -> "models.LogAnalyticsOperationResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._export_request_rate_by_interval_initial.metadata['url'] # type: ignore @@ -74,14 +77,12 @@ def _export_request_rate_by_interval_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RequestRateByIntervalInput') 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 @@ -105,9 +106,9 @@ def begin_export_request_rate_by_interval( parameters, # type: "models.RequestRateByIntervalInput" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LogAnalyticsOperationResult"] """Export logs that show Api requests made by this subscription in the given time window to show - throttling activities. + throttling activities. :param location: The location upon which virtual-machine-sizes is queried. :type location: str @@ -168,12 +169,15 @@ def _export_throttled_requests_initial( parameters, # type: "models.LogAnalyticsInputBase" **kwargs # type: Any ): - # type: (...) -> "models.LogAnalyticsOperationResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._export_throttled_requests_initial.metadata['url'] # type: ignore @@ -190,14 +194,12 @@ def _export_throttled_requests_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LogAnalyticsInputBase') 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 @@ -221,9 +223,9 @@ def begin_export_throttled_requests( parameters, # type: "models.LogAnalyticsInputBase" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LogAnalyticsOperationResult"] """Export logs that show total throttled Api requests for this subscription in the given time - window. + window. :param location: The location upon which virtual-machine-sizes is queried. :type location: str diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_operations.py index 688c159b1d7f..6a2801b31f2b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -58,11 +58,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeOperationListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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 @@ -70,15 +77,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_proximity_placement_groups_operations.py index 5b875019b304..0fe788f27d6d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_proximity_placement_groups_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -67,10 +67,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -88,14 +91,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ProximityPlacementGroup') 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 @@ -103,7 +104,6 @@ def create_or_update( 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('ProximityPlacementGroup', pipeline_response) @@ -138,10 +138,13 @@ def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -159,14 +162,12 @@ def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'UpdateResource') 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 @@ -201,7 +202,9 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -221,7 +224,6 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,9 +256,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -273,9 +278,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -305,11 +309,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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_subscription.metadata['url'] # type: ignore @@ -321,15 +332,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -372,11 +379,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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 @@ -389,15 +403,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_snapshots_operations.py index 1d997e019c74..9cf24d7f51df 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_snapshots_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.Snapshot" cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('Snapshot', pipeline_response) @@ -112,14 +112,14 @@ def begin_create_or_update( snapshot, # type: "models.Snapshot" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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.v2018_06_01.models.Snapshot @@ -182,10 +182,13 @@ def _update_initial( ): # type: (...) -> "models.Snapshot" cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -203,14 +206,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -218,7 +219,6 @@ def _update_initial( 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('Snapshot', pipeline_response) @@ -238,14 +238,14 @@ def begin_update( snapshot, # type: "models.SnapshotUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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.v2018_06_01.models.SnapshotUpdate @@ -320,9 +320,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -339,9 +342,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -366,7 +368,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -386,7 +390,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -406,14 +409,14 @@ def begin_delete( snapshot_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. @@ -477,11 +480,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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 @@ -494,15 +504,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -542,11 +548,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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 @@ -558,15 +571,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -600,12 +609,15 @@ def _grant_access_initial( grant_access_data, # type: "models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> "models.AccessUri" - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # 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 = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._grant_access_initial.metadata['url'] # type: ignore @@ -623,14 +635,12 @@ def _grant_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -655,17 +665,17 @@ def begin_grant_access( grant_access_data, # type: "models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. + operation. :type grant_access_data: ~azure.mgmt.compute.v2018_06_01.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. @@ -725,7 +735,9 @@ def _revoke_access_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -745,7 +757,6 @@ def _revoke_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -765,14 +776,14 @@ def begin_revoke_access( snapshot_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_usage_operations.py index 3047f35cb2e7..1a0d934a23a7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_usage_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,7 +52,7 @@ def list( ): # type: (...) -> Iterable["models.ListUsagesResult"] """Gets, for the specified location, the current compute resource usage information as well as the - limits for compute resources under the subscription. + limits for compute resources under the subscription. :param location: The location for which resource usage is queried. :type location: str @@ -62,11 +62,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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 @@ -79,15 +86,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_extension_images_operations.py index 524683e6e040..b3d8b8c8029e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_extension_images_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -69,9 +69,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -90,9 +93,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -128,9 +130,12 @@ def list_types( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.list_types.metadata['url'] # type: ignore @@ -147,9 +152,8 @@ def list_types( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -197,9 +201,12 @@ def list_versions( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.list_versions.metadata['url'] # type: ignore @@ -223,9 +230,8 @@ def list_versions( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_extensions_operations.py index 2c66d06881e9..983b8c0d3271 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_extensions_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachineExtension" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -78,14 +81,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtension') 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 @@ -93,7 +94,6 @@ def _create_or_update_initial( 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('VirtualMachineExtension', pipeline_response) @@ -114,18 +114,18 @@ def begin_create_or_update( extension_parameters, # type: "models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineExtension"] """The operation to create or update the extension. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_name: The name of the virtual machine where the extension should be created or - updated. + updated. :type vm_name: str :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Create Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2018_06_01.models.VirtualMachineExtension :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. @@ -188,10 +188,13 @@ def _update_initial( ): # type: (...) -> "models.VirtualMachineExtension" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -210,14 +213,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtensionUpdate') 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 @@ -241,7 +242,7 @@ def begin_update( extension_parameters, # type: "models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineExtension"] """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -251,7 +252,7 @@ def begin_update( :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Update Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2018_06_01.models.VirtualMachineExtensionUpdate :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. @@ -313,7 +314,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -334,7 +337,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -355,7 +357,7 @@ def begin_delete( vm_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -436,9 +438,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -458,9 +463,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -499,9 +503,12 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -520,9 +527,8 @@ def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_images_operations.py index c0d6cb2e9877..32f6e72db23a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_images_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -72,9 +72,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -94,9 +97,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -148,9 +150,12 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -175,9 +180,8 @@ def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -213,9 +217,12 @@ def list_offers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.list_offers.metadata['url'] # type: ignore @@ -232,9 +239,8 @@ def list_offers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -267,9 +273,12 @@ def list_publishers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.list_publishers.metadata['url'] # type: ignore @@ -285,9 +294,8 @@ def list_publishers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -326,9 +334,12 @@ def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.list_skus.metadata['url'] # type: ignore @@ -346,9 +357,8 @@ def list_skus( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_run_commands_operations.py index 1468b5aa5c90..7a731e0a646e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_run_commands_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -61,11 +61,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json, text/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 @@ -78,15 +85,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -132,9 +135,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandDocument"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json, text/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -151,9 +157,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_extensions_operations.py index 6fcfe35b35a3..a46a768e2a36 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -57,10 +57,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachineScaleSetExtension" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -79,14 +82,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineScaleSetExtension') 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 @@ -94,7 +95,6 @@ def _create_or_update_initial( 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('VirtualMachineScaleSetExtension', pipeline_response) @@ -115,18 +115,18 @@ def begin_create_or_update( extension_parameters, # type: "models.VirtualMachineScaleSetExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineScaleSetExtension"] """The operation to create or update an extension. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_scale_set_name: The name of the VM scale set where the extension should be create or - updated. + updated. :type vm_scale_set_name: str :param vmss_extension_name: The name of the VM scale set extension. :type vmss_extension_name: str :param extension_parameters: Parameters supplied to the Create VM scale set Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2018_06_01.models.VirtualMachineScaleSetExtension :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. @@ -188,7 +188,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -209,7 +211,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -230,7 +231,7 @@ def begin_delete( vmss_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -311,9 +312,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -333,9 +337,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -371,11 +374,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtensionListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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 @@ -389,15 +399,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index d45f3cf70f73..7412e62f6bbf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod @@ -54,7 +54,9 @@ def _cancel_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -74,7 +76,6 @@ def _cancel_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -94,7 +95,7 @@ def begin_cancel( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Cancels the current virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -155,7 +156,9 @@ def _start_os_upgrade_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -175,7 +178,6 @@ def _start_os_upgrade_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -195,10 +197,10 @@ def begin_start_os_upgrade( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts a rolling upgrade to move all virtual machine scale set instances to the latest - available Platform Image OS version. Instances which are already running the latest available - OS version are not affected. + available Platform Image OS version. Instances which are already running the latest available + OS version are not affected. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -258,7 +260,9 @@ def _start_extension_upgrade_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -278,7 +282,6 @@ def _start_extension_upgrade_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -298,10 +301,10 @@ def begin_start_extension_upgrade( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to - the latest available extension version. Instances which are already running the latest - extension versions are not affected. + the latest available extension version. Instances which are already running the latest + extension versions are not affected. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -372,9 +375,12 @@ def get_latest( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RollingUpgradeStatusInfo"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.get_latest.metadata['url'] # type: ignore @@ -391,9 +397,8 @@ def get_latest( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_vms_operations.py index 7642c8bac121..0c2ade06ca41 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -57,7 +57,9 @@ def _reimage_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") @@ -80,7 +82,6 @@ def _reimage_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_scale_set_vm_reimage_input is not None: body_content = self._serialize.body(vm_scale_set_vm_reimage_input, 'VirtualMachineReimageParameters') @@ -88,7 +89,6 @@ def _reimage_initial( body_content = None 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 @@ -109,7 +109,7 @@ def begin_reimage( vm_scale_set_vm_reimage_input=None, # type: Optional["models.VirtualMachineReimageParameters"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -177,7 +177,9 @@ def _reimage_all_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -198,7 +200,6 @@ def _reimage_all_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -219,9 +220,9 @@ def begin_reimage_all( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. - This operation is only supported for managed disks. + This operation is only supported for managed disks. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -285,7 +286,9 @@ def _deallocate_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -306,7 +309,6 @@ def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -327,10 +329,10 @@ def begin_deallocate( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and - releases the compute resources it uses. You are not billed for the compute resources of this - virtual machine once it is deallocated. + releases the compute resources it uses. You are not billed for the compute resources of this + virtual machine once it is deallocated. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -395,10 +397,13 @@ def _update_initial( ): # type: (...) -> "models.VirtualMachineScaleSetVM" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -417,14 +422,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSetVM') 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 @@ -432,7 +435,6 @@ def _update_initial( 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('VirtualMachineScaleSetVM', pipeline_response) @@ -453,13 +455,13 @@ def begin_update( parameters, # type: "models.VirtualMachineScaleSetVM" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineScaleSetVM"] """Updates a virtual machine of a VM scale set. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_scale_set_name: The name of the VM scale set where the extension should be create or - updated. + updated. :type vm_scale_set_name: str :param instance_id: The instance ID of the virtual machine. :type instance_id: str @@ -525,7 +527,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -546,7 +550,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -567,7 +570,7 @@ def begin_delete( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -645,9 +648,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -665,9 +671,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -706,9 +711,12 @@ def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -726,9 +734,8 @@ def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -761,11 +768,14 @@ def list( :type resource_group_name: str :param virtual_machine_scale_set_name: The name of the VM scale set. :type virtual_machine_scale_set_name: str - :param filter: The filter to apply to the operation. + :param filter: The filter to apply to the operation. Allowed values are + 'startswith(instanceView/statuses/code, 'PowerState') eq true', 'properties/latestModelApplied + eq true', 'properties/latestModelApplied eq false'. :type filter: str - :param select: The list parameters. + :param select: The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. :type select: str - :param expand: The expand expression to apply to the operation. + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetVMListResult or the result of cls(response) @@ -773,11 +783,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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 @@ -797,15 +814,11 @@ def prepare_request(next_link=None): query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -841,7 +854,9 @@ def _power_off_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -862,7 +877,6 @@ def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -883,10 +897,10 @@ def begin_power_off( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached - and you are getting charged for the resources. Instead, use deallocate to release resources and - avoid charges. + and you are getting charged for the resources. Instead, use deallocate to release resources and + avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -950,7 +964,9 @@ def _restart_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -971,7 +987,6 @@ def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -992,7 +1007,7 @@ def begin_restart( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Restarts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1057,7 +1072,9 @@ def _start_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -1078,7 +1095,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1099,7 +1115,7 @@ def begin_start( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1164,7 +1180,9 @@ def _redeploy_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -1185,7 +1203,6 @@ def _redeploy_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1206,9 +1223,9 @@ def begin_redeploy( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and - powers it back on. + powers it back on. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1272,7 +1289,9 @@ def _perform_maintenance_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -1293,7 +1312,6 @@ def _perform_maintenance_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1314,7 +1332,7 @@ def begin_perform_maintenance( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Performs maintenance on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1378,12 +1396,15 @@ def _run_command_initial( parameters, # type: "models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> "models.RunCommandResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" # Construct URL url = self._run_command_initial.metadata['url'] # type: ignore @@ -1402,14 +1423,12 @@ def _run_command_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RunCommandInput') 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 @@ -1435,7 +1454,7 @@ def begin_run_command( parameters, # type: "models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RunCommandResult"] """Run command on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_sets_operations.py index 075026741b46..dc0cfc850af4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_sets_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachineScaleSet" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSet') 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('VirtualMachineScaleSet', pipeline_response) @@ -112,7 +112,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualMachineScaleSet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -180,10 +180,13 @@ def _update_initial( ): # type: (...) -> "models.VirtualMachineScaleSet" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -201,14 +204,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSetUpdate') 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 @@ -231,7 +232,7 @@ def begin_update( parameters, # type: "models.VirtualMachineScaleSetUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] """Update a VM scale set. :param resource_group_name: The name of the resource group. @@ -298,7 +299,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -318,7 +321,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -338,7 +340,7 @@ def begin_delete( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VM scale set. :param resource_group_name: The name of the resource group. @@ -410,9 +412,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -429,9 +434,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -457,7 +461,9 @@ def _deallocate_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") @@ -479,7 +485,6 @@ def _deallocate_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -487,7 +492,6 @@ def _deallocate_initial( body_content = None 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 @@ -507,10 +511,10 @@ def begin_deallocate( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and - releases the compute resources. You are not billed for the compute resources that this virtual - machine scale set deallocates. + releases the compute resources. You are not billed for the compute resources that this virtual + machine scale set deallocates. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -574,7 +578,9 @@ def _delete_instances_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") @@ -596,12 +602,10 @@ def _delete_instances_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -621,7 +625,7 @@ def begin_delete_instances( vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -696,9 +700,12 @@ def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -715,9 +722,8 @@ def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -750,11 +756,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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 @@ -767,15 +780,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -808,8 +817,8 @@ def list_all( ): # type: (...) -> Iterable["models.VirtualMachineScaleSetListWithLinkResult"] """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource - group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this - till nextLink is null to fetch all the VM Scale Sets. + group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this + till nextLink is null to fetch all the VM Scale Sets. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetListWithLinkResult or the result of cls(response) @@ -817,11 +826,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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_all.metadata['url'] # type: ignore @@ -833,15 +849,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -876,7 +888,7 @@ def list_skus( ): # type: (...) -> Iterable["models.VirtualMachineScaleSetListSkusResult"] """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM - instances allowed for each SKU. + instances allowed for each SKU. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -888,11 +900,18 @@ def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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_skus.metadata['url'] # type: ignore @@ -906,15 +925,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -960,11 +975,18 @@ def get_os_upgrade_history( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListOSUpgradeHistory"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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.get_os_upgrade_history.metadata['url'] # type: ignore @@ -978,15 +1000,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1022,7 +1040,9 @@ def _power_off_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") @@ -1044,7 +1064,6 @@ def _power_off_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1052,7 +1071,6 @@ def _power_off_initial( body_content = None 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 @@ -1072,10 +1090,10 @@ def begin_power_off( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still - attached and you are getting charged for the resources. Instead, use deallocate to release - resources and avoid charges. + attached and you are getting charged for the resources. Instead, use deallocate to release + resources and avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1139,7 +1157,9 @@ def _restart_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") @@ -1161,7 +1181,6 @@ def _restart_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1169,7 +1188,6 @@ def _restart_initial( body_content = None 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 @@ -1189,7 +1207,7 @@ def begin_restart( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Restarts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1254,7 +1272,9 @@ def _start_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") @@ -1276,7 +1296,6 @@ def _start_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1284,7 +1303,6 @@ def _start_initial( body_content = None 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 @@ -1304,7 +1322,7 @@ def begin_start( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1369,7 +1387,9 @@ def _redeploy_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") @@ -1391,7 +1411,6 @@ def _redeploy_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1399,7 +1418,6 @@ def _redeploy_initial( body_content = None 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 @@ -1419,9 +1437,9 @@ def begin_redeploy( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, - and powers them back on. + and powers them back on. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1485,7 +1503,9 @@ def _perform_maintenance_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") @@ -1507,7 +1527,6 @@ def _perform_maintenance_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1515,7 +1534,6 @@ def _perform_maintenance_initial( body_content = None 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 @@ -1535,11 +1553,11 @@ def begin_perform_maintenance( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances - which are not eligible for perform maintenance will be failed. Please refer to best practices - for more details: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual- - machine-scale-sets-maintenance-notifications. + which are not eligible for perform maintenance will be failed. Please refer to best practices + for more details: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual- + machine-scale-sets-maintenance-notifications. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1603,7 +1621,9 @@ def _update_instances_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") @@ -1625,12 +1645,10 @@ def _update_instances_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -1650,7 +1668,7 @@ def begin_update_instances( vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. :param resource_group_name: The name of the resource group. @@ -1715,7 +1733,9 @@ def _reimage_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") @@ -1737,7 +1757,6 @@ def _reimage_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_scale_set_reimage_input is not None: body_content = self._serialize.body(vm_scale_set_reimage_input, 'VirtualMachineScaleSetReimageParameters') @@ -1745,7 +1764,6 @@ def _reimage_initial( body_content = None 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 @@ -1765,10 +1783,10 @@ def begin_reimage( vm_scale_set_reimage_input=None, # type: Optional["models.VirtualMachineScaleSetReimageParameters"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which - don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual - machine is reset to initial state. + don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual + machine is reset to initial state. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1832,7 +1850,9 @@ def _reimage_all_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") @@ -1854,7 +1874,6 @@ def _reimage_all_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1862,7 +1881,6 @@ def _reimage_all_initial( body_content = None 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 @@ -1882,9 +1900,9 @@ def begin_reimage_all( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This - operation is only supported for managed disks. + operation is only supported for managed disks. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1963,9 +1981,12 @@ def force_recovery_service_fabric_platform_update_domain_walk( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RecoveryWalkResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.force_recovery_service_fabric_platform_update_domain_walk.metadata['url'] # type: ignore @@ -1983,9 +2004,8 @@ def force_recovery_service_fabric_platform_update_domain_walk( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_sizes_operations.py index 82c9e12a01cc..b42cff81154a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_sizes_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,7 +52,7 @@ def list( ): # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] """This API is deprecated. Use `Resources Skus `_. + us/rest/api/compute/resourceskus/list>`_. :param location: The location upon which virtual-machine-sizes is queried. :type location: str @@ -62,11 +62,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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 @@ -79,15 +86,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machines_operations.py index b8fdc99d3e01..ea4497cdb4ea 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machines_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -63,11 +63,18 @@ def list_by_location( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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_location.metadata['url'] # type: ignore @@ -80,15 +87,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -122,12 +125,15 @@ def _capture_initial( parameters, # type: "models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._capture_initial.metadata['url'] # type: ignore @@ -145,14 +151,12 @@ def _capture_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineCaptureParameters') 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 @@ -177,9 +181,9 @@ def begin_capture( parameters, # type: "models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineCaptureResult"] """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used - to create similar VMs. + to create similar VMs. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -246,10 +250,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachine" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -267,14 +274,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachine') 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 @@ -282,7 +287,6 @@ def _create_or_update_initial( 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('VirtualMachine', pipeline_response) @@ -302,7 +306,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualMachine" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachine"] """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -370,10 +374,13 @@ def _update_initial( ): # type: (...) -> "models.VirtualMachine" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -391,14 +398,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineUpdate') 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 @@ -406,7 +411,6 @@ def _update_initial( 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('VirtualMachine', pipeline_response) @@ -426,7 +430,7 @@ def begin_update( parameters, # type: "models.VirtualMachineUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachine"] """The operation to update a virtual machine. :param resource_group_name: The name of the resource group. @@ -493,7 +497,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -513,7 +519,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -533,7 +538,7 @@ def begin_delete( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to delete a virtual machine. :param resource_group_name: The name of the resource group. @@ -608,9 +613,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -629,9 +637,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -667,9 +674,12 @@ def instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + accept = "application/json" # Construct URL url = self.instance_view.metadata['url'] # type: ignore @@ -686,9 +696,8 @@ def instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -713,7 +722,9 @@ def _convert_to_managed_disks_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -733,7 +744,6 @@ def _convert_to_managed_disks_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -753,9 +763,9 @@ def begin_convert_to_managed_disks( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop- - deallocated before invoking this operation. + deallocated before invoking this operation. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -815,7 +825,9 @@ def _deallocate_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -835,7 +847,6 @@ def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -855,9 +866,9 @@ def begin_deallocate( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Shuts down the virtual machine and releases the compute resources. You are not billed for the - compute resources that this virtual machine uses. + compute resources that this virtual machine uses. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -928,7 +939,9 @@ def generalize( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -948,7 +961,6 @@ def generalize( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -969,7 +981,7 @@ def list( ): # type: (...) -> Iterable["models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified resource group. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -979,11 +991,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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 @@ -996,15 +1015,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1037,7 +1052,7 @@ def list_all( ): # type: (...) -> Iterable["models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified subscription. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineListResult or the result of cls(response) @@ -1045,11 +1060,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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_all.metadata['url'] # type: ignore @@ -1061,15 +1083,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1104,7 +1122,7 @@ def list_available_sizes( ): # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes to which the specified virtual machine can be - resized. + resized. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1116,11 +1134,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" + 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_available_sizes.metadata['url'] # type: ignore @@ -1134,15 +1159,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1177,7 +1198,9 @@ def _power_off_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -1197,7 +1220,6 @@ def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1217,9 +1239,9 @@ def begin_power_off( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with - the same provisioned resources. You are still charged for this virtual machine. + the same provisioned resources. You are still charged for this virtual machine. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1279,7 +1301,9 @@ def _restart_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -1299,7 +1323,6 @@ def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1319,7 +1342,7 @@ def begin_restart( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to restart a virtual machine. :param resource_group_name: The name of the resource group. @@ -1380,7 +1403,9 @@ def _start_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -1400,7 +1425,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1420,7 +1444,7 @@ def begin_start( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to start a virtual machine. :param resource_group_name: The name of the resource group. @@ -1481,7 +1505,9 @@ def _redeploy_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -1501,7 +1527,6 @@ def _redeploy_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1521,7 +1546,7 @@ def begin_redeploy( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Shuts down the virtual machine, moves it to a new node, and powers it back on. :param resource_group_name: The name of the resource group. @@ -1583,7 +1608,9 @@ def _reimage_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") @@ -1605,7 +1632,6 @@ def _reimage_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: body_content = self._serialize.body(parameters, 'VirtualMachineReimageParameters') @@ -1613,7 +1639,6 @@ def _reimage_initial( body_content = None 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 @@ -1633,7 +1658,7 @@ def begin_reimage( parameters=None, # type: Optional["models.VirtualMachineReimageParameters"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Reimages the virtual machine which has an ephemeral OS disk back to its initial state. :param resource_group_name: The name of the resource group. @@ -1697,7 +1722,9 @@ def _perform_maintenance_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -1717,7 +1744,6 @@ def _perform_maintenance_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1737,7 +1763,7 @@ def begin_perform_maintenance( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to perform maintenance on a virtual machine. :param resource_group_name: The name of the resource group. @@ -1797,12 +1823,15 @@ def _run_command_initial( parameters, # type: "models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> "models.RunCommandResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" # Construct URL url = self._run_command_initial.metadata['url'] # type: ignore @@ -1820,14 +1849,12 @@ def _run_command_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RunCommandInput') 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 @@ -1852,7 +1879,7 @@ def begin_run_command( parameters, # type: "models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RunCommandResult"] """Run command on the VM. :param resource_group_name: The name of the resource group. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/__init__.py index 20a4019e9c23..cdc7f7a1709a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/__init__.py @@ -10,7 +10,7 @@ __all__ = ['ComputeManagementClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass 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 0b41e738e9af..d85a35770ba6 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,6 +53,7 @@ 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/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_configuration.py index 2a387e07af44..7801cdce2453 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -47,8 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2018-09-30" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-compute/{}'.format(VERSION)) self._configure(**kwargs) @@ -61,6 +61,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) 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 6589f8cbb988..0f60a6edcf79 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 @@ -4,7 +4,11 @@ "client": { "name": "ComputeManagementClient", "filename": "_compute_management_client", - "description": "Compute Client." + "description": "Compute Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true }, "global_parameters": { "sync_method": { @@ -41,7 +45,10 @@ }, "config": { "credential": true, - "credential_scopes": ["https://management.azure.com/.default"] + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null }, "operation_groups": { "disks": "DisksOperations", diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/__init__.py index c8a8b4817269..9e9459635989 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._compute_management_client_async import ComputeManagementClient +from ._compute_management_client import ComputeManagementClient __all__ = ['ComputeManagementClient'] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/_compute_management_client_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/_compute_management_client.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/_compute_management_client_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/_compute_management_client.py index 1631890a0ec4..41d9fcafc629 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/_compute_management_client_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/_compute_management_client.py @@ -15,9 +15,9 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration_async import ComputeManagementClientConfiguration -from .operations_async import DisksOperations -from .operations_async import SnapshotsOperations +from ._configuration import ComputeManagementClientConfiguration +from .operations import DisksOperations +from .operations import SnapshotsOperations from .. import models @@ -25,9 +25,9 @@ class ComputeManagementClient(object): """Compute Client. :ivar disks: DisksOperations operations - :vartype disks: azure.mgmt.compute.v2018_09_30.aio.operations_async.DisksOperations + :vartype disks: azure.mgmt.compute.v2018_09_30.aio.operations.DisksOperations :ivar snapshots: SnapshotsOperations operations - :vartype snapshots: azure.mgmt.compute.v2018_09_30.aio.operations_async.SnapshotsOperations + :vartype snapshots: azure.mgmt.compute.v2018_09_30.aio.operations.SnapshotsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. @@ -50,6 +50,7 @@ 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/aio/_configuration_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/_configuration.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/_configuration_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/_configuration.py index 3c58a0887f4a..327ec20f41c5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/_configuration_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -44,8 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2018-09-30" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-compute/{}'.format(VERSION)) self._configure(**kwargs) @@ -57,6 +57,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations_async/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations/__init__.py similarity index 82% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations_async/__init__.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations/__init__.py index 08ea8c143c22..65a114a2a1fb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations_async/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations/__init__.py @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._disks_operations_async import DisksOperations -from ._snapshots_operations_async import SnapshotsOperations +from ._disks_operations import DisksOperations +from ._snapshots_operations import SnapshotsOperations __all__ = [ 'DisksOperations', diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations_async/_disks_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations/_disks_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations_async/_disks_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations/_disks_operations.py index 2406838a2404..a019b5498207 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations_async/_disks_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations/_disks_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.Disk": cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-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 @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('Disk', pipeline_response) @@ -106,14 +106,14 @@ async def begin_create_or_update( disk_name: str, disk: "models.Disk", **kwargs - ) -> "models.Disk": + ) -> 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. + 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.v2018_09_30.models.Disk @@ -123,8 +123,8 @@ async def begin_create_or_update( 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: Disk, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_09_30.models.Disk + :return: An instance of AsyncLROPoller that returns either Disk or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_09_30.models.Disk] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -175,10 +175,13 @@ async def _update_initial( **kwargs ) -> "models.Disk": cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-09-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -196,14 +199,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -211,7 +212,6 @@ async def _update_initial( 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('Disk', pipeline_response) @@ -230,14 +230,14 @@ async def begin_update( disk_name: str, disk: "models.DiskUpdate", **kwargs - ) -> "models.Disk": + ) -> 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. + 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.v2018_09_30.models.DiskUpdate @@ -247,8 +247,8 @@ async def begin_update( 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: Disk, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_09_30.models.Disk + :return: An instance of AsyncLROPoller that returns either Disk or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_09_30.models.Disk] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -311,9 +311,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-09-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -330,9 +333,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -356,7 +358,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-09-30" @@ -376,7 +380,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -395,14 +398,14 @@ async def begin_delete( resource_group_name: str, disk_name: str, **kwargs - ) -> None: + ) -> 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. + 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. @@ -410,8 +413,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -465,11 +468,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-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 @@ -482,15 +492,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -529,11 +535,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-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 @@ -545,15 +558,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -586,12 +595,15 @@ async def _grant_access_initial( disk_name: str, grant_access_data: "models.GrantAccessData", **kwargs - ) -> "models.AccessUri": - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> 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 = "2018-09-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._grant_access_initial.metadata['url'] # type: ignore @@ -609,14 +621,12 @@ async def _grant_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -640,17 +650,17 @@ async def begin_grant_access( disk_name: str, grant_access_data: "models.GrantAccessData", **kwargs - ) -> "models.AccessUri": + ) -> 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. + 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. + operation. :type grant_access_data: ~azure.mgmt.compute.v2018_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. @@ -658,8 +668,8 @@ async def begin_grant_access( 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: AccessUri, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_09_30.models.AccessUri + :return: An instance of AsyncLROPoller that returns either AccessUri or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_09_30.models.AccessUri] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -709,7 +719,9 @@ async def _revoke_access_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-09-30" @@ -729,7 +741,6 @@ async def _revoke_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -748,14 +759,14 @@ async def begin_revoke_access( resource_group_name: str, disk_name: str, **kwargs - ) -> None: + ) -> 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. + 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. @@ -763,8 +774,8 @@ async def begin_revoke_access( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations_async/_snapshots_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations/_snapshots_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations_async/_snapshots_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations/_snapshots_operations.py index c9d065a57a83..a88b96a45389 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations_async/_snapshots_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations/_snapshots_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.Snapshot": cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-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 @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('Snapshot', pipeline_response) @@ -106,14 +106,14 @@ async def begin_create_or_update( snapshot_name: str, snapshot: "models.Snapshot", **kwargs - ) -> "models.Snapshot": + ) -> 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. + 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.v2018_09_30.models.Snapshot @@ -123,8 +123,8 @@ async def begin_create_or_update( 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: Snapshot, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_09_30.models.Snapshot + :return: An instance of AsyncLROPoller that returns either Snapshot or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_09_30.models.Snapshot] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -175,10 +175,13 @@ async def _update_initial( **kwargs ) -> "models.Snapshot": cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-09-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -196,14 +199,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -211,7 +212,6 @@ async def _update_initial( 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('Snapshot', pipeline_response) @@ -230,14 +230,14 @@ async def begin_update( snapshot_name: str, snapshot: "models.SnapshotUpdate", **kwargs - ) -> "models.Snapshot": + ) -> 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. + 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.v2018_09_30.models.SnapshotUpdate @@ -247,8 +247,8 @@ async def begin_update( 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: Snapshot, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_09_30.models.Snapshot + :return: An instance of AsyncLROPoller that returns either Snapshot or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_09_30.models.Snapshot] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -311,9 +311,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-09-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -330,9 +333,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -356,7 +358,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-09-30" @@ -376,7 +380,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -395,14 +398,14 @@ async def begin_delete( resource_group_name: str, snapshot_name: str, **kwargs - ) -> None: + ) -> 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. + 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. @@ -410,8 +413,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -465,11 +468,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-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 @@ -482,15 +492,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -529,11 +535,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-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 @@ -545,15 +558,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -586,12 +595,15 @@ async def _grant_access_initial( snapshot_name: str, grant_access_data: "models.GrantAccessData", **kwargs - ) -> "models.AccessUri": - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> 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 = "2018-09-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._grant_access_initial.metadata['url'] # type: ignore @@ -609,14 +621,12 @@ async def _grant_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -640,17 +650,17 @@ async def begin_grant_access( snapshot_name: str, grant_access_data: "models.GrantAccessData", **kwargs - ) -> "models.AccessUri": + ) -> 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. + 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. + operation. :type grant_access_data: ~azure.mgmt.compute.v2018_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. @@ -658,8 +668,8 @@ async def begin_grant_access( 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: AccessUri, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_09_30.models.AccessUri + :return: An instance of AsyncLROPoller that returns either AccessUri or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_09_30.models.AccessUri] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -709,7 +719,9 @@ async def _revoke_access_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-09-30" @@ -729,7 +741,6 @@ async def _revoke_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -748,14 +759,14 @@ async def begin_revoke_access( resource_group_name: str, snapshot_name: str, **kwargs - ) -> None: + ) -> 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. + 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. @@ -763,8 +774,8 @@ async def begin_revoke_access( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/models/_compute_management_client_enums.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/models/_compute_management_client_enums.py index 41475bfd4c25..c06ca084e8e9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/models/_compute_management_client_enums.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/models/_compute_management_client_enums.py @@ -6,64 +6,82 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum +from enum import Enum, EnumMeta +from six import with_metaclass -class AccessLevel(str, Enum): +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) - none = "None" - read = "Read" - write = "Write" + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) -class DiskCreateOption(str, Enum): + +class AccessLevel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + NONE = "None" + READ = "Read" + WRITE = "Write" + +class DiskCreateOption(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """This enumerates the possible sources of a disk's creation. """ - empty = "Empty" - attach = "Attach" - from_image = "FromImage" - import_enum = "Import" - copy = "Copy" - restore = "Restore" - upload = "Upload" + EMPTY = "Empty" + ATTACH = "Attach" + FROM_IMAGE = "FromImage" + IMPORT_ENUM = "Import" + COPY = "Copy" + RESTORE = "Restore" + UPLOAD = "Upload" -class DiskState(str, Enum): +class DiskState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The state of the disk. """ - unattached = "Unattached" - attached = "Attached" - reserved = "Reserved" - active_sas = "ActiveSAS" - ready_to_upload = "ReadyToUpload" - active_upload = "ActiveUpload" + UNATTACHED = "Unattached" + ATTACHED = "Attached" + RESERVED = "Reserved" + ACTIVE_SAS = "ActiveSAS" + READY_TO_UPLOAD = "ReadyToUpload" + ACTIVE_UPLOAD = "ActiveUpload" -class DiskStorageAccountTypes(str, Enum): +class DiskStorageAccountTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The sku name. """ - standard_lrs = "Standard_LRS" - premium_lrs = "Premium_LRS" - standard_ssd_lrs = "StandardSSD_LRS" - ultra_ssd_lrs = "UltraSSD_LRS" + STANDARD_LRS = "Standard_LRS" + PREMIUM_LRS = "Premium_LRS" + STANDARD_SSD_LRS = "StandardSSD_LRS" + ULTRA_SSD_LRS = "UltraSSD_LRS" -class HyperVGeneration(str, Enum): +class HyperVGeneration(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The hypervisor generation of the Virtual Machine. Applicable to OS disks only. """ - v1 = "V1" - v2 = "V2" + V1 = "V1" + V2 = "V2" -class OperatingSystemTypes(str, Enum): +class OperatingSystemTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The Operating System type. """ - windows = "Windows" - linux = "Linux" + WINDOWS = "Windows" + LINUX = "Linux" -class SnapshotStorageAccountTypes(str, Enum): +class SnapshotStorageAccountTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The sku name. """ - standard_lrs = "Standard_LRS" - premium_lrs = "Premium_LRS" - standard_zrs = "Standard_ZRS" + STANDARD_LRS = "Standard_LRS" + PREMIUM_LRS = "Premium_LRS" + STANDARD_ZRS = "Standard_ZRS" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/operations/_disks_operations.py index a9928deb6aa9..6125a88bd0d2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/operations/_disks_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.Disk" cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-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 @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('Disk', pipeline_response) @@ -112,14 +112,14 @@ def begin_create_or_update( disk, # type: "models.Disk" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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.v2018_09_30.models.Disk @@ -182,10 +182,13 @@ def _update_initial( ): # type: (...) -> "models.Disk" cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-09-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -203,14 +206,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -218,7 +219,6 @@ def _update_initial( 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('Disk', pipeline_response) @@ -238,14 +238,14 @@ def begin_update( disk, # type: "models.DiskUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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.v2018_09_30.models.DiskUpdate @@ -320,9 +320,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-09-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -339,9 +342,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -366,7 +368,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-09-30" @@ -386,7 +390,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -406,14 +409,14 @@ def begin_delete( disk_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. @@ -477,11 +480,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-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 @@ -494,15 +504,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -542,11 +548,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-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 @@ -558,15 +571,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -600,12 +609,15 @@ def _grant_access_initial( grant_access_data, # type: "models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> "models.AccessUri" - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # 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 = "2018-09-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._grant_access_initial.metadata['url'] # type: ignore @@ -623,14 +635,12 @@ def _grant_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -655,17 +665,17 @@ def begin_grant_access( grant_access_data, # type: "models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. + operation. :type grant_access_data: ~azure.mgmt.compute.v2018_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. @@ -725,7 +735,9 @@ def _revoke_access_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-09-30" @@ -745,7 +757,6 @@ def _revoke_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -765,14 +776,14 @@ def begin_revoke_access( disk_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/operations/_snapshots_operations.py index 598a0c04ddc1..e1f514608065 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/operations/_snapshots_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.Snapshot" cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-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 @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('Snapshot', pipeline_response) @@ -112,14 +112,14 @@ def begin_create_or_update( snapshot, # type: "models.Snapshot" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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.v2018_09_30.models.Snapshot @@ -182,10 +182,13 @@ def _update_initial( ): # type: (...) -> "models.Snapshot" cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-09-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -203,14 +206,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -218,7 +219,6 @@ def _update_initial( 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('Snapshot', pipeline_response) @@ -238,14 +238,14 @@ def begin_update( snapshot, # type: "models.SnapshotUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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.v2018_09_30.models.SnapshotUpdate @@ -320,9 +320,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-09-30" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -339,9 +342,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -366,7 +368,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-09-30" @@ -386,7 +390,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -406,14 +409,14 @@ def begin_delete( snapshot_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. @@ -477,11 +480,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-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 @@ -494,15 +504,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -542,11 +548,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-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 @@ -558,15 +571,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -600,12 +609,15 @@ def _grant_access_initial( grant_access_data, # type: "models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> "models.AccessUri" - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # 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 = "2018-09-30" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._grant_access_initial.metadata['url'] # type: ignore @@ -623,14 +635,12 @@ def _grant_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -655,17 +665,17 @@ def begin_grant_access( grant_access_data, # type: "models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. + operation. :type grant_access_data: ~azure.mgmt.compute.v2018_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. @@ -725,7 +735,9 @@ def _revoke_access_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-09-30" @@ -745,7 +757,6 @@ def _revoke_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -765,14 +776,14 @@ def begin_revoke_access( snapshot_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/__init__.py index 20a4019e9c23..cdc7f7a1709a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/__init__.py @@ -10,7 +10,7 @@ __all__ = ['ComputeManagementClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass 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 8891128c9fd0..f205577bc9ed 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,6 +95,7 @@ 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/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_configuration.py index 3f0f86a91d5c..56f50ffd73c1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -47,8 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2018-10-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-compute/{}'.format(VERSION)) self._configure(**kwargs) @@ -61,6 +61,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) 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 c66bea74cf6f..5de12bc8c9e1 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 @@ -4,7 +4,11 @@ "client": { "name": "ComputeManagementClient", "filename": "_compute_management_client", - "description": "Compute Client." + "description": "Compute Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true }, "global_parameters": { "sync_method": { @@ -41,7 +45,10 @@ }, "config": { "credential": true, - "credential_scopes": ["https://management.azure.com/.default"] + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null }, "operation_groups": { "operations": "Operations", diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/__init__.py index c8a8b4817269..9e9459635989 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._compute_management_client_async import ComputeManagementClient +from ._compute_management_client import ComputeManagementClient __all__ = ['ComputeManagementClient'] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/_compute_management_client_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/_compute_management_client.py similarity index 78% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/_compute_management_client_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/_compute_management_client.py index 77e1479d6a05..4109da03e7d8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/_compute_management_client_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/_compute_management_client.py @@ -15,23 +15,23 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration_async import ComputeManagementClientConfiguration -from .operations_async import Operations -from .operations_async import AvailabilitySetsOperations -from .operations_async import ProximityPlacementGroupsOperations -from .operations_async import VirtualMachineExtensionImagesOperations -from .operations_async import VirtualMachineExtensionsOperations -from .operations_async import VirtualMachineImagesOperations -from .operations_async import UsageOperations -from .operations_async import VirtualMachinesOperations -from .operations_async import VirtualMachineSizesOperations -from .operations_async import ImagesOperations -from .operations_async import VirtualMachineScaleSetsOperations -from .operations_async import VirtualMachineScaleSetExtensionsOperations -from .operations_async import VirtualMachineScaleSetRollingUpgradesOperations -from .operations_async import VirtualMachineScaleSetVMsOperations -from .operations_async import LogAnalyticsOperations -from .operations_async import VirtualMachineRunCommandsOperations +from ._configuration import ComputeManagementClientConfiguration +from .operations import Operations +from .operations import AvailabilitySetsOperations +from .operations import ProximityPlacementGroupsOperations +from .operations import VirtualMachineExtensionImagesOperations +from .operations import VirtualMachineExtensionsOperations +from .operations import VirtualMachineImagesOperations +from .operations import UsageOperations +from .operations import VirtualMachinesOperations +from .operations import VirtualMachineSizesOperations +from .operations import ImagesOperations +from .operations import VirtualMachineScaleSetsOperations +from .operations import VirtualMachineScaleSetExtensionsOperations +from .operations import VirtualMachineScaleSetRollingUpgradesOperations +from .operations import VirtualMachineScaleSetVMsOperations +from .operations import LogAnalyticsOperations +from .operations import VirtualMachineRunCommandsOperations from .. import models @@ -39,37 +39,37 @@ class ComputeManagementClient(object): """Compute Client. :ivar operations: Operations operations - :vartype operations: azure.mgmt.compute.v2018_10_01.aio.operations_async.Operations + :vartype operations: azure.mgmt.compute.v2018_10_01.aio.operations.Operations :ivar availability_sets: AvailabilitySetsOperations operations - :vartype availability_sets: azure.mgmt.compute.v2018_10_01.aio.operations_async.AvailabilitySetsOperations + :vartype availability_sets: azure.mgmt.compute.v2018_10_01.aio.operations.AvailabilitySetsOperations :ivar proximity_placement_groups: ProximityPlacementGroupsOperations operations - :vartype proximity_placement_groups: azure.mgmt.compute.v2018_10_01.aio.operations_async.ProximityPlacementGroupsOperations + :vartype proximity_placement_groups: azure.mgmt.compute.v2018_10_01.aio.operations.ProximityPlacementGroupsOperations :ivar virtual_machine_extension_images: VirtualMachineExtensionImagesOperations operations - :vartype virtual_machine_extension_images: azure.mgmt.compute.v2018_10_01.aio.operations_async.VirtualMachineExtensionImagesOperations + :vartype virtual_machine_extension_images: azure.mgmt.compute.v2018_10_01.aio.operations.VirtualMachineExtensionImagesOperations :ivar virtual_machine_extensions: VirtualMachineExtensionsOperations operations - :vartype virtual_machine_extensions: azure.mgmt.compute.v2018_10_01.aio.operations_async.VirtualMachineExtensionsOperations + :vartype virtual_machine_extensions: azure.mgmt.compute.v2018_10_01.aio.operations.VirtualMachineExtensionsOperations :ivar virtual_machine_images: VirtualMachineImagesOperations operations - :vartype virtual_machine_images: azure.mgmt.compute.v2018_10_01.aio.operations_async.VirtualMachineImagesOperations + :vartype virtual_machine_images: azure.mgmt.compute.v2018_10_01.aio.operations.VirtualMachineImagesOperations :ivar usage: UsageOperations operations - :vartype usage: azure.mgmt.compute.v2018_10_01.aio.operations_async.UsageOperations + :vartype usage: azure.mgmt.compute.v2018_10_01.aio.operations.UsageOperations :ivar virtual_machines: VirtualMachinesOperations operations - :vartype virtual_machines: azure.mgmt.compute.v2018_10_01.aio.operations_async.VirtualMachinesOperations + :vartype virtual_machines: azure.mgmt.compute.v2018_10_01.aio.operations.VirtualMachinesOperations :ivar virtual_machine_sizes: VirtualMachineSizesOperations operations - :vartype virtual_machine_sizes: azure.mgmt.compute.v2018_10_01.aio.operations_async.VirtualMachineSizesOperations + :vartype virtual_machine_sizes: azure.mgmt.compute.v2018_10_01.aio.operations.VirtualMachineSizesOperations :ivar images: ImagesOperations operations - :vartype images: azure.mgmt.compute.v2018_10_01.aio.operations_async.ImagesOperations + :vartype images: azure.mgmt.compute.v2018_10_01.aio.operations.ImagesOperations :ivar virtual_machine_scale_sets: VirtualMachineScaleSetsOperations operations - :vartype virtual_machine_scale_sets: azure.mgmt.compute.v2018_10_01.aio.operations_async.VirtualMachineScaleSetsOperations + :vartype virtual_machine_scale_sets: azure.mgmt.compute.v2018_10_01.aio.operations.VirtualMachineScaleSetsOperations :ivar virtual_machine_scale_set_extensions: VirtualMachineScaleSetExtensionsOperations operations - :vartype virtual_machine_scale_set_extensions: azure.mgmt.compute.v2018_10_01.aio.operations_async.VirtualMachineScaleSetExtensionsOperations + :vartype virtual_machine_scale_set_extensions: azure.mgmt.compute.v2018_10_01.aio.operations.VirtualMachineScaleSetExtensionsOperations :ivar virtual_machine_scale_set_rolling_upgrades: VirtualMachineScaleSetRollingUpgradesOperations operations - :vartype virtual_machine_scale_set_rolling_upgrades: azure.mgmt.compute.v2018_10_01.aio.operations_async.VirtualMachineScaleSetRollingUpgradesOperations + :vartype virtual_machine_scale_set_rolling_upgrades: azure.mgmt.compute.v2018_10_01.aio.operations.VirtualMachineScaleSetRollingUpgradesOperations :ivar virtual_machine_scale_set_vms: VirtualMachineScaleSetVMsOperations operations - :vartype virtual_machine_scale_set_vms: azure.mgmt.compute.v2018_10_01.aio.operations_async.VirtualMachineScaleSetVMsOperations + :vartype virtual_machine_scale_set_vms: azure.mgmt.compute.v2018_10_01.aio.operations.VirtualMachineScaleSetVMsOperations :ivar log_analytics: LogAnalyticsOperations operations - :vartype log_analytics: azure.mgmt.compute.v2018_10_01.aio.operations_async.LogAnalyticsOperations + :vartype log_analytics: azure.mgmt.compute.v2018_10_01.aio.operations.LogAnalyticsOperations :ivar virtual_machine_run_commands: VirtualMachineRunCommandsOperations operations - :vartype virtual_machine_run_commands: azure.mgmt.compute.v2018_10_01.aio.operations_async.VirtualMachineRunCommandsOperations + :vartype virtual_machine_run_commands: azure.mgmt.compute.v2018_10_01.aio.operations.VirtualMachineRunCommandsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. @@ -92,6 +92,7 @@ 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/aio/_configuration_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/_configuration.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/_configuration_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/_configuration.py index 4db3800f1ad1..d226c1829dd6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/_configuration_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -44,8 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2018-10-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-compute/{}'.format(VERSION)) self._configure(**kwargs) @@ -57,6 +57,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/__init__.py new file mode 100644 index 000000000000..d803388388c3 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/__init__.py @@ -0,0 +1,43 @@ +# 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 ._operations import Operations +from ._availability_sets_operations import AvailabilitySetsOperations +from ._proximity_placement_groups_operations import ProximityPlacementGroupsOperations +from ._virtual_machine_extension_images_operations import VirtualMachineExtensionImagesOperations +from ._virtual_machine_extensions_operations import VirtualMachineExtensionsOperations +from ._virtual_machine_images_operations import VirtualMachineImagesOperations +from ._usage_operations import UsageOperations +from ._virtual_machines_operations import VirtualMachinesOperations +from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations +from ._images_operations import ImagesOperations +from ._virtual_machine_scale_sets_operations import VirtualMachineScaleSetsOperations +from ._virtual_machine_scale_set_extensions_operations import VirtualMachineScaleSetExtensionsOperations +from ._virtual_machine_scale_set_rolling_upgrades_operations import VirtualMachineScaleSetRollingUpgradesOperations +from ._virtual_machine_scale_set_vms_operations import VirtualMachineScaleSetVMsOperations +from ._log_analytics_operations import LogAnalyticsOperations +from ._virtual_machine_run_commands_operations import VirtualMachineRunCommandsOperations + +__all__ = [ + 'Operations', + 'AvailabilitySetsOperations', + 'ProximityPlacementGroupsOperations', + 'VirtualMachineExtensionImagesOperations', + 'VirtualMachineExtensionsOperations', + 'VirtualMachineImagesOperations', + 'UsageOperations', + 'VirtualMachinesOperations', + 'VirtualMachineSizesOperations', + 'ImagesOperations', + 'VirtualMachineScaleSetsOperations', + 'VirtualMachineScaleSetExtensionsOperations', + 'VirtualMachineScaleSetRollingUpgradesOperations', + 'VirtualMachineScaleSetVMsOperations', + 'LogAnalyticsOperations', + 'VirtualMachineRunCommandsOperations', +] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_availability_sets_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_availability_sets_operations.py similarity index 90% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_availability_sets_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_availability_sets_operations.py index 3f9130a6edfa..dcfc7d96f5bd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_availability_sets_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_availability_sets_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -62,10 +62,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -83,14 +86,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailabilitySet') 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 @@ -127,10 +128,13 @@ async def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -148,14 +152,12 @@ async def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailabilitySetUpdate') 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 @@ -189,7 +191,9 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -209,7 +213,6 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -241,9 +244,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -260,9 +266,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -286,7 +291,8 @@ def list_by_subscription( ) -> AsyncIterable["models.AvailabilitySetListResult"]: """Lists all availability sets in a subscription. - :param expand: The expand expression to apply to the operation. + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AvailabilitySetListResult or the result of cls(response) @@ -294,11 +300,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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_subscription.metadata['url'] # type: ignore @@ -312,15 +325,11 @@ def prepare_request(next_link=None): if expand is not None: query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -362,11 +371,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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 @@ -379,15 +395,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -421,7 +433,7 @@ def list_available_sizes( **kwargs ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes that can be used to create a new virtual machine in - an existing availability set. + an existing availability set. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -433,11 +445,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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_available_sizes.metadata['url'] # type: ignore @@ -451,15 +470,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_images_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_images_operations.py similarity index 90% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_images_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_images_operations.py index 2cc8de647ce2..73f1400bf8b6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_images_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_images_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.Image": cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'Image') 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('Image', pipeline_response) @@ -106,7 +106,7 @@ async def begin_create_or_update( image_name: str, parameters: "models.Image", **kwargs - ) -> "models.Image": + ) -> AsyncLROPoller["models.Image"]: """Create or update an image. :param resource_group_name: The name of the resource group. @@ -121,8 +121,8 @@ async def begin_create_or_update( 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: Image, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_10_01.models.Image + :return: An instance of AsyncLROPoller that returns either Image or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_10_01.models.Image] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -173,10 +173,13 @@ async def _update_initial( **kwargs ) -> "models.Image": cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -194,14 +197,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ImageUpdate') 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 @@ -209,7 +210,6 @@ async def _update_initial( 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('Image', pipeline_response) @@ -228,7 +228,7 @@ async def begin_update( image_name: str, parameters: "models.ImageUpdate", **kwargs - ) -> "models.Image": + ) -> AsyncLROPoller["models.Image"]: """Update an image. :param resource_group_name: The name of the resource group. @@ -243,8 +243,8 @@ async def begin_update( 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: Image, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_10_01.models.Image + :return: An instance of AsyncLROPoller that returns either Image or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_10_01.models.Image] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -294,7 +294,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -314,7 +316,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -333,7 +334,7 @@ async def begin_delete( resource_group_name: str, image_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes an Image. :param resource_group_name: The name of the resource group. @@ -346,8 +347,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -407,9 +408,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -428,9 +432,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -462,11 +465,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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 @@ -479,15 +489,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -519,7 +525,7 @@ def list( **kwargs ) -> AsyncIterable["models.ImageListResult"]: """Gets the list of Images in the subscription. Use nextLink property in the response to get the - next page of Images. Do this till nextLink is null to fetch all the Images. + next page of Images. Do this till nextLink is null to fetch all the Images. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ImageListResult or the result of cls(response) @@ -527,11 +533,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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 @@ -543,15 +556,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_log_analytics_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_log_analytics_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_log_analytics_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_log_analytics_operations.py index 5f31269e5fc1..8a1e2573fc6e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_log_analytics_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_log_analytics_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -47,12 +47,15 @@ async def _export_request_rate_by_interval_initial( location: str, parameters: "models.RequestRateByIntervalInput", **kwargs - ) -> "models.LogAnalyticsOperationResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.LogAnalyticsOperationResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._export_request_rate_by_interval_initial.metadata['url'] # type: ignore @@ -69,14 +72,12 @@ async def _export_request_rate_by_interval_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RequestRateByIntervalInput') 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 @@ -99,9 +100,9 @@ async def begin_export_request_rate_by_interval( location: str, parameters: "models.RequestRateByIntervalInput", **kwargs - ) -> "models.LogAnalyticsOperationResult": + ) -> AsyncLROPoller["models.LogAnalyticsOperationResult"]: """Export logs that show Api requests made by this subscription in the given time window to show - throttling activities. + throttling activities. :param location: The location upon which virtual-machine-sizes is queried. :type location: str @@ -113,8 +114,8 @@ async def begin_export_request_rate_by_interval( 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: LogAnalyticsOperationResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_10_01.models.LogAnalyticsOperationResult + :return: An instance of AsyncLROPoller that returns either LogAnalyticsOperationResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_10_01.models.LogAnalyticsOperationResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -161,12 +162,15 @@ async def _export_throttled_requests_initial( location: str, parameters: "models.LogAnalyticsInputBase", **kwargs - ) -> "models.LogAnalyticsOperationResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.LogAnalyticsOperationResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._export_throttled_requests_initial.metadata['url'] # type: ignore @@ -183,14 +187,12 @@ async def _export_throttled_requests_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LogAnalyticsInputBase') 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 @@ -213,9 +215,9 @@ async def begin_export_throttled_requests( location: str, parameters: "models.LogAnalyticsInputBase", **kwargs - ) -> "models.LogAnalyticsOperationResult": + ) -> AsyncLROPoller["models.LogAnalyticsOperationResult"]: """Export logs that show total throttled Api requests for this subscription in the given time - window. + window. :param location: The location upon which virtual-machine-sizes is queried. :type location: str @@ -227,8 +229,8 @@ async def begin_export_throttled_requests( 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: LogAnalyticsOperationResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_10_01.models.LogAnalyticsOperationResult + :return: An instance of AsyncLROPoller that returns either LogAnalyticsOperationResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_10_01.models.LogAnalyticsOperationResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_operations.py similarity index 87% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_operations.py index effba0ce8f73..b7bd4f44fd5c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -53,11 +53,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeOperationListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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 @@ -65,15 +72,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_proximity_placement_groups_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_proximity_placement_groups_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_proximity_placement_groups_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_proximity_placement_groups_operations.py index fa85b36788b7..e20a4779acf1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_proximity_placement_groups_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_proximity_placement_groups_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -62,10 +62,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -83,14 +86,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ProximityPlacementGroup') 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 @@ -98,7 +99,6 @@ async def create_or_update( 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('ProximityPlacementGroup', pipeline_response) @@ -132,10 +132,13 @@ async def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -153,14 +156,12 @@ async def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'UpdateResource') 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 @@ -194,7 +195,9 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -214,7 +217,6 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -246,9 +248,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -265,9 +270,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -296,11 +300,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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_subscription.metadata['url'] # type: ignore @@ -312,15 +323,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -362,11 +369,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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 @@ -379,15 +393,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_usage_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_usage_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_usage_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_usage_operations.py index e03dc2f73ccb..e1a888a3410d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_usage_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_usage_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -47,7 +47,7 @@ def list( **kwargs ) -> AsyncIterable["models.ListUsagesResult"]: """Gets, for the specified location, the current compute resource usage information as well as the - limits for compute resources under the subscription. + limits for compute resources under the subscription. :param location: The location for which resource usage is queried. :type location: str @@ -57,11 +57,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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 @@ -74,15 +81,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_virtual_machine_extension_images_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_extension_images_operations.py similarity index 92% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_virtual_machine_extension_images_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_extension_images_operations.py index 296bc9476972..e3bba4df7f2f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_virtual_machine_extension_images_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -64,9 +64,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -85,9 +88,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -122,9 +124,12 @@ async def list_types( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.list_types.metadata['url'] # type: ignore @@ -141,9 +146,8 @@ async def list_types( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -190,9 +194,12 @@ async def list_versions( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.list_versions.metadata['url'] # type: ignore @@ -216,9 +223,8 @@ async def list_versions( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_virtual_machine_extensions_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_extensions_operations.py similarity index 92% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_virtual_machine_extensions_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_extensions_operations.py index 7ac8ba6f68c5..6919b7208d07 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_virtual_machine_extensions_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_extensions_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachineExtension": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -73,14 +76,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtension') 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 @@ -88,7 +89,6 @@ async def _create_or_update_initial( 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('VirtualMachineExtension', pipeline_response) @@ -108,18 +108,18 @@ async def begin_create_or_update( vm_extension_name: str, extension_parameters: "models.VirtualMachineExtension", **kwargs - ) -> "models.VirtualMachineExtension": + ) -> AsyncLROPoller["models.VirtualMachineExtension"]: """The operation to create or update the extension. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_name: The name of the virtual machine where the extension should be created or - updated. + updated. :type vm_name: str :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Create Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2018_10_01.models.VirtualMachineExtension :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. @@ -127,8 +127,8 @@ async def begin_create_or_update( 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: VirtualMachineExtension, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_10_01.models.VirtualMachineExtension + :return: An instance of AsyncLROPoller that returns either VirtualMachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -181,10 +181,13 @@ async def _update_initial( **kwargs ) -> "models.VirtualMachineExtension": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -203,14 +206,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtensionUpdate') 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 @@ -233,7 +234,7 @@ async def begin_update( vm_extension_name: str, extension_parameters: "models.VirtualMachineExtensionUpdate", **kwargs - ) -> "models.VirtualMachineExtension": + ) -> AsyncLROPoller["models.VirtualMachineExtension"]: """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -243,7 +244,7 @@ async def begin_update( :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Update Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2018_10_01.models.VirtualMachineExtensionUpdate :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. @@ -251,8 +252,8 @@ async def begin_update( 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: VirtualMachineExtension, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_10_01.models.VirtualMachineExtension + :return: An instance of AsyncLROPoller that returns either VirtualMachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -304,7 +305,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -325,7 +328,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -345,7 +347,7 @@ async def begin_delete( vm_name: str, vm_extension_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -360,8 +362,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -425,9 +427,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -447,9 +452,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -487,9 +491,12 @@ async def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -508,9 +515,8 @@ async def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_virtual_machine_images_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_images_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_virtual_machine_images_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_images_operations.py index 33af682cf4ce..1dd01edc9418 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_virtual_machine_images_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_images_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -67,9 +67,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -89,9 +92,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -142,9 +144,12 @@ async def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -169,9 +174,8 @@ async def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -206,9 +210,12 @@ async def list_offers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.list_offers.metadata['url'] # type: ignore @@ -225,9 +232,8 @@ async def list_offers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -259,9 +265,12 @@ async def list_publishers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.list_publishers.metadata['url'] # type: ignore @@ -277,9 +286,8 @@ async def list_publishers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -317,9 +325,12 @@ async def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.list_skus.metadata['url'] # type: ignore @@ -337,9 +348,8 @@ async def list_skus( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_virtual_machine_run_commands_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_run_commands_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_virtual_machine_run_commands_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_run_commands_operations.py index 6c7d5035c4f7..23b11859fa2a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_virtual_machine_run_commands_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,11 +56,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json, text/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 @@ -73,15 +80,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -126,9 +129,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandDocument"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json, text/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -145,9 +151,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_virtual_machine_scale_set_extensions_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_virtual_machine_scale_set_extensions_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index c298e27dc838..c20989f40bff 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_virtual_machine_scale_set_extensions_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,10 +52,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachineScaleSetExtension": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -74,14 +77,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineScaleSetExtension') 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 @@ -89,7 +90,6 @@ async def _create_or_update_initial( 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('VirtualMachineScaleSetExtension', pipeline_response) @@ -109,18 +109,18 @@ async def begin_create_or_update( vmss_extension_name: str, extension_parameters: "models.VirtualMachineScaleSetExtension", **kwargs - ) -> "models.VirtualMachineScaleSetExtension": + ) -> AsyncLROPoller["models.VirtualMachineScaleSetExtension"]: """The operation to create or update an extension. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_scale_set_name: The name of the VM scale set where the extension should be create or - updated. + updated. :type vm_scale_set_name: str :param vmss_extension_name: The name of the VM scale set extension. :type vmss_extension_name: str :param extension_parameters: Parameters supplied to the Create VM scale set Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2018_10_01.models.VirtualMachineScaleSetExtension :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. @@ -128,8 +128,8 @@ async def begin_create_or_update( 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: VirtualMachineScaleSetExtension, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_10_01.models.VirtualMachineScaleSetExtension + :return: An instance of AsyncLROPoller that returns either VirtualMachineScaleSetExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineScaleSetExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -181,7 +181,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -202,7 +204,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -222,7 +223,7 @@ async def begin_delete( vm_scale_set_name: str, vmss_extension_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -237,8 +238,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -302,9 +303,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -324,9 +328,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -361,11 +364,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtensionListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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 @@ -379,15 +389,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_virtual_machine_scale_set_rolling_upgrades_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_virtual_machine_scale_set_rolling_upgrades_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 9f83ecd68661..b5fdc6b300a1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_virtual_machine_scale_set_rolling_upgrades_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -49,7 +49,9 @@ async def _cancel_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -69,7 +71,6 @@ async def _cancel_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -88,7 +89,7 @@ async def begin_cancel( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Cancels the current virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -101,8 +102,8 @@ async def begin_cancel( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -148,7 +149,9 @@ async def _start_os_upgrade_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -168,7 +171,6 @@ async def _start_os_upgrade_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -187,10 +189,10 @@ async def begin_start_os_upgrade( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts a rolling upgrade to move all virtual machine scale set instances to the latest - available Platform Image OS version. Instances which are already running the latest available - OS version are not affected. + available Platform Image OS version. Instances which are already running the latest available + OS version are not affected. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -202,8 +204,8 @@ async def begin_start_os_upgrade( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -249,7 +251,9 @@ async def _start_extension_upgrade_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -269,7 +273,6 @@ async def _start_extension_upgrade_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -288,10 +291,10 @@ async def begin_start_extension_upgrade( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to - the latest available extension version. Instances which are already running the latest - extension versions are not affected. + the latest available extension version. Instances which are already running the latest + extension versions are not affected. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -303,8 +306,8 @@ async def begin_start_extension_upgrade( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -361,9 +364,12 @@ async def get_latest( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RollingUpgradeStatusInfo"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.get_latest.metadata['url'] # type: ignore @@ -380,9 +386,8 @@ async def get_latest( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_virtual_machine_scale_set_vms_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_vms_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_virtual_machine_scale_set_vms_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index 816963cbbf4d..e650f108cb98 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_virtual_machine_scale_set_vms_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,7 +52,9 @@ async def _reimage_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") @@ -75,7 +77,6 @@ async def _reimage_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_scale_set_vm_reimage_input is not None: body_content = self._serialize.body(vm_scale_set_vm_reimage_input, 'VirtualMachineReimageParameters') @@ -83,7 +84,6 @@ async def _reimage_initial( body_content = None 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 @@ -103,7 +103,7 @@ async def begin_reimage( instance_id: str, vm_scale_set_vm_reimage_input: Optional["models.VirtualMachineReimageParameters"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -120,8 +120,8 @@ async def begin_reimage( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -170,7 +170,9 @@ async def _reimage_all_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -191,7 +193,6 @@ async def _reimage_all_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -211,9 +212,9 @@ async def begin_reimage_all( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. - This operation is only supported for managed disks. + This operation is only supported for managed disks. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -227,8 +228,8 @@ async def begin_reimage_all( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -276,7 +277,9 @@ async def _deallocate_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -297,7 +300,6 @@ async def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -317,10 +319,10 @@ async def begin_deallocate( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and - releases the compute resources it uses. You are not billed for the compute resources of this - virtual machine once it is deallocated. + releases the compute resources it uses. You are not billed for the compute resources of this + virtual machine once it is deallocated. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -334,8 +336,8 @@ async def begin_deallocate( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -384,10 +386,13 @@ async def _update_initial( **kwargs ) -> "models.VirtualMachineScaleSetVM": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -406,14 +411,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSetVM') 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 @@ -421,7 +424,6 @@ async def _update_initial( 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('VirtualMachineScaleSetVM', pipeline_response) @@ -441,13 +443,13 @@ async def begin_update( instance_id: str, parameters: "models.VirtualMachineScaleSetVM", **kwargs - ) -> "models.VirtualMachineScaleSetVM": + ) -> AsyncLROPoller["models.VirtualMachineScaleSetVM"]: """Updates a virtual machine of a VM scale set. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_scale_set_name: The name of the VM scale set where the extension should be create or - updated. + updated. :type vm_scale_set_name: str :param instance_id: The instance ID of the virtual machine. :type instance_id: str @@ -459,8 +461,8 @@ async def begin_update( 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: VirtualMachineScaleSetVM, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_10_01.models.VirtualMachineScaleSetVM + :return: An instance of AsyncLROPoller that returns either VirtualMachineScaleSetVM or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineScaleSetVM] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -512,7 +514,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -533,7 +537,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -553,7 +556,7 @@ async def begin_delete( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -568,8 +571,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -630,9 +633,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -650,9 +656,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -690,9 +695,12 @@ async def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -710,9 +718,8 @@ async def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -744,11 +751,14 @@ def list( :type resource_group_name: str :param virtual_machine_scale_set_name: The name of the VM scale set. :type virtual_machine_scale_set_name: str - :param filter: The filter to apply to the operation. + :param filter: The filter to apply to the operation. Allowed values are + 'startswith(instanceView/statuses/code, 'PowerState') eq true', 'properties/latestModelApplied + eq true', 'properties/latestModelApplied eq false'. :type filter: str - :param select: The list parameters. + :param select: The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. :type select: str - :param expand: The expand expression to apply to the operation. + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetVMListResult or the result of cls(response) @@ -756,11 +766,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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 @@ -780,15 +797,11 @@ def prepare_request(next_link=None): query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -823,7 +836,9 @@ async def _power_off_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -844,7 +859,6 @@ async def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -864,10 +878,10 @@ async def begin_power_off( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached - and you are getting charged for the resources. Instead, use deallocate to release resources and - avoid charges. + and you are getting charged for the resources. Instead, use deallocate to release resources and + avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -881,8 +895,8 @@ async def begin_power_off( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -930,7 +944,9 @@ async def _restart_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -951,7 +967,6 @@ async def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -971,7 +986,7 @@ async def begin_restart( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Restarts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -986,8 +1001,8 @@ async def begin_restart( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1035,7 +1050,9 @@ async def _start_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -1056,7 +1073,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1076,7 +1092,7 @@ async def begin_start( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1091,8 +1107,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1140,7 +1156,9 @@ async def _redeploy_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -1161,7 +1179,6 @@ async def _redeploy_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1181,9 +1198,9 @@ async def begin_redeploy( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and - powers it back on. + powers it back on. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1197,8 +1214,8 @@ async def begin_redeploy( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1246,7 +1263,9 @@ async def _perform_maintenance_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -1267,7 +1286,6 @@ async def _perform_maintenance_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1287,7 +1305,7 @@ async def begin_perform_maintenance( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Performs maintenance on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1302,8 +1320,8 @@ async def begin_perform_maintenance( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1350,12 +1368,15 @@ async def _run_command_initial( instance_id: str, parameters: "models.RunCommandInput", **kwargs - ) -> "models.RunCommandResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.RunCommandResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" # Construct URL url = self._run_command_initial.metadata['url'] # type: ignore @@ -1374,14 +1395,12 @@ async def _run_command_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RunCommandInput') 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 @@ -1406,7 +1425,7 @@ async def begin_run_command( instance_id: str, parameters: "models.RunCommandInput", **kwargs - ) -> "models.RunCommandResult": + ) -> AsyncLROPoller["models.RunCommandResult"]: """Run command on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1423,8 +1442,8 @@ async def begin_run_command( 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: RunCommandResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_10_01.models.RunCommandResult + :return: An instance of AsyncLROPoller that returns either RunCommandResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_10_01.models.RunCommandResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_virtual_machine_scale_sets_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_sets_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_virtual_machine_scale_sets_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_sets_operations.py index bf071a46b461..9739ddc65635 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_virtual_machine_scale_sets_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachineScaleSet": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSet') 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('VirtualMachineScaleSet', pipeline_response) @@ -106,7 +106,7 @@ async def begin_create_or_update( vm_scale_set_name: str, parameters: "models.VirtualMachineScaleSet", **kwargs - ) -> "models.VirtualMachineScaleSet": + ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -121,8 +121,8 @@ async def begin_create_or_update( 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: VirtualMachineScaleSet, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_10_01.models.VirtualMachineScaleSet + :return: An instance of AsyncLROPoller that returns either VirtualMachineScaleSet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineScaleSet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -173,10 +173,13 @@ async def _update_initial( **kwargs ) -> "models.VirtualMachineScaleSet": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -194,14 +197,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSetUpdate') 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 @@ -223,7 +224,7 @@ async def begin_update( vm_scale_set_name: str, parameters: "models.VirtualMachineScaleSetUpdate", **kwargs - ) -> "models.VirtualMachineScaleSet": + ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: """Update a VM scale set. :param resource_group_name: The name of the resource group. @@ -238,8 +239,8 @@ async def begin_update( 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: VirtualMachineScaleSet, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_10_01.models.VirtualMachineScaleSet + :return: An instance of AsyncLROPoller that returns either VirtualMachineScaleSet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineScaleSet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -289,7 +290,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -309,7 +312,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -328,7 +330,7 @@ async def begin_delete( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VM scale set. :param resource_group_name: The name of the resource group. @@ -341,8 +343,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -399,9 +401,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -418,9 +423,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -445,7 +449,9 @@ async def _deallocate_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") @@ -467,7 +473,6 @@ async def _deallocate_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -475,7 +480,6 @@ async def _deallocate_initial( body_content = None 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 @@ -494,10 +498,10 @@ async def begin_deallocate( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and - releases the compute resources. You are not billed for the compute resources that this virtual - machine scale set deallocates. + releases the compute resources. You are not billed for the compute resources that this virtual + machine scale set deallocates. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -511,8 +515,8 @@ async def begin_deallocate( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -560,7 +564,9 @@ async def _delete_instances_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") @@ -582,12 +588,10 @@ async def _delete_instances_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -606,7 +610,7 @@ async def begin_delete_instances( vm_scale_set_name: str, vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -621,8 +625,8 @@ async def begin_delete_instances( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -680,9 +684,12 @@ async def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -699,9 +706,8 @@ async def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -733,11 +739,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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 @@ -750,15 +763,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -790,8 +799,8 @@ def list_all( **kwargs ) -> AsyncIterable["models.VirtualMachineScaleSetListWithLinkResult"]: """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource - group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this - till nextLink is null to fetch all the VM Scale Sets. + group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this + till nextLink is null to fetch all the VM Scale Sets. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetListWithLinkResult or the result of cls(response) @@ -799,11 +808,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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_all.metadata['url'] # type: ignore @@ -815,15 +831,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -857,7 +869,7 @@ def list_skus( **kwargs ) -> AsyncIterable["models.VirtualMachineScaleSetListSkusResult"]: """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM - instances allowed for each SKU. + instances allowed for each SKU. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -869,11 +881,18 @@ def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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_skus.metadata['url'] # type: ignore @@ -887,15 +906,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -940,11 +955,18 @@ def get_os_upgrade_history( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListOSUpgradeHistory"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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.get_os_upgrade_history.metadata['url'] # type: ignore @@ -958,15 +980,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1001,7 +1019,9 @@ async def _power_off_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") @@ -1023,7 +1043,6 @@ async def _power_off_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1031,7 +1050,6 @@ async def _power_off_initial( body_content = None 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 @@ -1050,10 +1068,10 @@ async def begin_power_off( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still - attached and you are getting charged for the resources. Instead, use deallocate to release - resources and avoid charges. + attached and you are getting charged for the resources. Instead, use deallocate to release + resources and avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1067,8 +1085,8 @@ async def begin_power_off( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1116,7 +1134,9 @@ async def _restart_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") @@ -1138,7 +1158,6 @@ async def _restart_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1146,7 +1165,6 @@ async def _restart_initial( body_content = None 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 @@ -1165,7 +1183,7 @@ async def begin_restart( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Restarts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1180,8 +1198,8 @@ async def begin_restart( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1229,7 +1247,9 @@ async def _start_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") @@ -1251,7 +1271,6 @@ async def _start_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1259,7 +1278,6 @@ async def _start_initial( body_content = None 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 @@ -1278,7 +1296,7 @@ async def begin_start( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1293,8 +1311,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1342,7 +1360,9 @@ async def _redeploy_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") @@ -1364,7 +1384,6 @@ async def _redeploy_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1372,7 +1391,6 @@ async def _redeploy_initial( body_content = None 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 @@ -1391,9 +1409,9 @@ async def begin_redeploy( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, - and powers them back on. + and powers them back on. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1407,8 +1425,8 @@ async def begin_redeploy( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1456,7 +1474,9 @@ async def _perform_maintenance_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") @@ -1478,7 +1498,6 @@ async def _perform_maintenance_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1486,7 +1505,6 @@ async def _perform_maintenance_initial( body_content = None 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 @@ -1505,11 +1523,11 @@ async def begin_perform_maintenance( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances - which are not eligible for perform maintenance will be failed. Please refer to best practices - for more details: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual- - machine-scale-sets-maintenance-notifications. + which are not eligible for perform maintenance will be failed. Please refer to best practices + for more details: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual- + machine-scale-sets-maintenance-notifications. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1523,8 +1541,8 @@ async def begin_perform_maintenance( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1572,7 +1590,9 @@ async def _update_instances_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") @@ -1594,12 +1614,10 @@ async def _update_instances_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -1618,7 +1636,7 @@ async def begin_update_instances( vm_scale_set_name: str, vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. :param resource_group_name: The name of the resource group. @@ -1633,8 +1651,8 @@ async def begin_update_instances( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1682,7 +1700,9 @@ async def _reimage_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") @@ -1704,7 +1724,6 @@ async def _reimage_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_scale_set_reimage_input is not None: body_content = self._serialize.body(vm_scale_set_reimage_input, 'VirtualMachineScaleSetReimageParameters') @@ -1712,7 +1731,6 @@ async def _reimage_initial( body_content = None 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 @@ -1731,10 +1749,10 @@ async def begin_reimage( vm_scale_set_name: str, vm_scale_set_reimage_input: Optional["models.VirtualMachineScaleSetReimageParameters"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which - don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual - machine is reset to initial state. + don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual + machine is reset to initial state. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1748,8 +1766,8 @@ async def begin_reimage( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1797,7 +1815,9 @@ async def _reimage_all_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") @@ -1819,7 +1839,6 @@ async def _reimage_all_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1827,7 +1846,6 @@ async def _reimage_all_initial( body_content = None 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 @@ -1846,9 +1864,9 @@ async def begin_reimage_all( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This - operation is only supported for managed disks. + operation is only supported for managed disks. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1862,8 +1880,8 @@ async def begin_reimage_all( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1926,9 +1944,12 @@ async def force_recovery_service_fabric_platform_update_domain_walk( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RecoveryWalkResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.force_recovery_service_fabric_platform_update_domain_walk.metadata['url'] # type: ignore @@ -1946,9 +1967,8 @@ async def force_recovery_service_fabric_platform_update_domain_walk( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_virtual_machine_sizes_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_sizes_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_virtual_machine_sizes_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_sizes_operations.py index 0d341908f730..dbcc7aa672d5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_virtual_machine_sizes_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_sizes_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -47,7 +47,7 @@ def list( **kwargs ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: """This API is deprecated. Use `Resources Skus `_. + us/rest/api/compute/resourceskus/list>`_. :param location: The location upon which virtual-machine-sizes is queried. :type location: str @@ -57,11 +57,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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 @@ -74,15 +81,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_virtual_machines_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machines_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_virtual_machines_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machines_operations.py index 7a623bc8ed4c..7748cd0d4173 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/_virtual_machines_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machines_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -58,11 +58,18 @@ def list_by_location( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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_location.metadata['url'] # type: ignore @@ -75,15 +82,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -116,12 +119,15 @@ async def _capture_initial( vm_name: str, parameters: "models.VirtualMachineCaptureParameters", **kwargs - ) -> "models.VirtualMachineCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.VirtualMachineCaptureResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._capture_initial.metadata['url'] # type: ignore @@ -139,14 +145,12 @@ async def _capture_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineCaptureParameters') 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 @@ -170,9 +174,9 @@ async def begin_capture( vm_name: str, parameters: "models.VirtualMachineCaptureParameters", **kwargs - ) -> "models.VirtualMachineCaptureResult": + ) -> AsyncLROPoller["models.VirtualMachineCaptureResult"]: """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used - to create similar VMs. + to create similar VMs. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -186,8 +190,8 @@ async def begin_capture( 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: VirtualMachineCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_10_01.models.VirtualMachineCaptureResult + :return: An instance of AsyncLROPoller that returns either VirtualMachineCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineCaptureResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -238,10 +242,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachine": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -259,14 +266,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachine') 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 @@ -274,7 +279,6 @@ async def _create_or_update_initial( 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('VirtualMachine', pipeline_response) @@ -293,7 +297,7 @@ async def begin_create_or_update( vm_name: str, parameters: "models.VirtualMachine", **kwargs - ) -> "models.VirtualMachine": + ) -> AsyncLROPoller["models.VirtualMachine"]: """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -308,8 +312,8 @@ async def begin_create_or_update( 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: VirtualMachine, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_10_01.models.VirtualMachine + :return: An instance of AsyncLROPoller that returns either VirtualMachine or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_10_01.models.VirtualMachine] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,10 +364,13 @@ async def _update_initial( **kwargs ) -> "models.VirtualMachine": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -381,14 +388,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineUpdate') 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 @@ -396,7 +401,6 @@ async def _update_initial( 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('VirtualMachine', pipeline_response) @@ -415,7 +419,7 @@ async def begin_update( vm_name: str, parameters: "models.VirtualMachineUpdate", **kwargs - ) -> "models.VirtualMachine": + ) -> AsyncLROPoller["models.VirtualMachine"]: """The operation to update a virtual machine. :param resource_group_name: The name of the resource group. @@ -430,8 +434,8 @@ async def begin_update( 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: VirtualMachine, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_10_01.models.VirtualMachine + :return: An instance of AsyncLROPoller that returns either VirtualMachine or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_10_01.models.VirtualMachine] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -481,7 +485,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -501,7 +507,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -520,7 +525,7 @@ async def begin_delete( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to delete a virtual machine. :param resource_group_name: The name of the resource group. @@ -533,8 +538,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -594,9 +599,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -615,9 +623,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -652,9 +659,12 @@ async def instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.instance_view.metadata['url'] # type: ignore @@ -671,9 +681,8 @@ async def instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -697,7 +706,9 @@ async def _convert_to_managed_disks_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -717,7 +728,6 @@ async def _convert_to_managed_disks_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -736,9 +746,9 @@ async def begin_convert_to_managed_disks( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop- - deallocated before invoking this operation. + deallocated before invoking this operation. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -750,8 +760,8 @@ async def begin_convert_to_managed_disks( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -797,7 +807,9 @@ async def _deallocate_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -817,7 +829,6 @@ async def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -836,9 +847,9 @@ async def begin_deallocate( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Shuts down the virtual machine and releases the compute resources. You are not billed for the - compute resources that this virtual machine uses. + compute resources that this virtual machine uses. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -850,8 +861,8 @@ async def begin_deallocate( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -908,7 +919,9 @@ async def generalize( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -928,7 +941,6 @@ async def generalize( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -948,7 +960,7 @@ def list( **kwargs ) -> AsyncIterable["models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified resource group. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -958,11 +970,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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 @@ -975,15 +994,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1015,7 +1030,7 @@ def list_all( **kwargs ) -> AsyncIterable["models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified subscription. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineListResult or the result of cls(response) @@ -1023,11 +1038,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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_all.metadata['url'] # type: ignore @@ -1039,15 +1061,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1081,7 +1099,7 @@ def list_available_sizes( **kwargs ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes to which the specified virtual machine can be - resized. + resized. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1093,11 +1111,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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_available_sizes.metadata['url'] # type: ignore @@ -1111,15 +1136,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1153,7 +1174,9 @@ async def _power_off_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -1173,7 +1196,6 @@ async def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1192,9 +1214,9 @@ async def begin_power_off( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with - the same provisioned resources. You are still charged for this virtual machine. + the same provisioned resources. You are still charged for this virtual machine. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1206,8 +1228,8 @@ async def begin_power_off( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1253,7 +1275,9 @@ async def _restart_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -1273,7 +1297,6 @@ async def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1292,7 +1315,7 @@ async def begin_restart( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to restart a virtual machine. :param resource_group_name: The name of the resource group. @@ -1305,8 +1328,8 @@ async def begin_restart( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1352,7 +1375,9 @@ async def _start_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -1372,7 +1397,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1391,7 +1415,7 @@ async def begin_start( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to start a virtual machine. :param resource_group_name: The name of the resource group. @@ -1404,8 +1428,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1451,7 +1475,9 @@ async def _redeploy_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -1471,7 +1497,6 @@ async def _redeploy_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1490,7 +1515,7 @@ async def begin_redeploy( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Shuts down the virtual machine, moves it to a new node, and powers it back on. :param resource_group_name: The name of the resource group. @@ -1503,8 +1528,8 @@ async def begin_redeploy( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1551,7 +1576,9 @@ async def _reimage_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") @@ -1573,7 +1600,6 @@ async def _reimage_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: body_content = self._serialize.body(parameters, 'VirtualMachineReimageParameters') @@ -1581,7 +1607,6 @@ async def _reimage_initial( body_content = None 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 @@ -1600,7 +1625,7 @@ async def begin_reimage( vm_name: str, parameters: Optional["models.VirtualMachineReimageParameters"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Reimages the virtual machine which has an ephemeral OS disk back to its initial state. :param resource_group_name: The name of the resource group. @@ -1615,8 +1640,8 @@ async def begin_reimage( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1663,7 +1688,9 @@ async def _perform_maintenance_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -1683,7 +1710,6 @@ async def _perform_maintenance_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1702,7 +1728,7 @@ async def begin_perform_maintenance( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to perform maintenance on a virtual machine. :param resource_group_name: The name of the resource group. @@ -1715,8 +1741,8 @@ async def begin_perform_maintenance( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1761,12 +1787,15 @@ async def _run_command_initial( vm_name: str, parameters: "models.RunCommandInput", **kwargs - ) -> "models.RunCommandResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.RunCommandResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" # Construct URL url = self._run_command_initial.metadata['url'] # type: ignore @@ -1784,14 +1813,12 @@ async def _run_command_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RunCommandInput') 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 @@ -1815,7 +1842,7 @@ async def begin_run_command( vm_name: str, parameters: "models.RunCommandInput", **kwargs - ) -> "models.RunCommandResult": + ) -> AsyncLROPoller["models.RunCommandResult"]: """Run command on the VM. :param resource_group_name: The name of the resource group. @@ -1830,8 +1857,8 @@ async def begin_run_command( 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: RunCommandResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2018_10_01.models.RunCommandResult + :return: An instance of AsyncLROPoller that returns either RunCommandResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2018_10_01.models.RunCommandResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/__init__.py deleted file mode 100644 index 272d3c44a4e5..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations_async/__init__.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 ._operations_async import Operations -from ._availability_sets_operations_async import AvailabilitySetsOperations -from ._proximity_placement_groups_operations_async import ProximityPlacementGroupsOperations -from ._virtual_machine_extension_images_operations_async import VirtualMachineExtensionImagesOperations -from ._virtual_machine_extensions_operations_async import VirtualMachineExtensionsOperations -from ._virtual_machine_images_operations_async import VirtualMachineImagesOperations -from ._usage_operations_async import UsageOperations -from ._virtual_machines_operations_async import VirtualMachinesOperations -from ._virtual_machine_sizes_operations_async import VirtualMachineSizesOperations -from ._images_operations_async import ImagesOperations -from ._virtual_machine_scale_sets_operations_async import VirtualMachineScaleSetsOperations -from ._virtual_machine_scale_set_extensions_operations_async import VirtualMachineScaleSetExtensionsOperations -from ._virtual_machine_scale_set_rolling_upgrades_operations_async import VirtualMachineScaleSetRollingUpgradesOperations -from ._virtual_machine_scale_set_vms_operations_async import VirtualMachineScaleSetVMsOperations -from ._log_analytics_operations_async import LogAnalyticsOperations -from ._virtual_machine_run_commands_operations_async import VirtualMachineRunCommandsOperations - -__all__ = [ - 'Operations', - 'AvailabilitySetsOperations', - 'ProximityPlacementGroupsOperations', - 'VirtualMachineExtensionImagesOperations', - 'VirtualMachineExtensionsOperations', - 'VirtualMachineImagesOperations', - 'UsageOperations', - 'VirtualMachinesOperations', - 'VirtualMachineSizesOperations', - 'ImagesOperations', - 'VirtualMachineScaleSetsOperations', - 'VirtualMachineScaleSetExtensionsOperations', - 'VirtualMachineScaleSetRollingUpgradesOperations', - 'VirtualMachineScaleSetVMsOperations', - 'LogAnalyticsOperations', - 'VirtualMachineRunCommandsOperations', -] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/__init__.py index 046e2214c628..1c402e150e24 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/__init__.py @@ -314,6 +314,7 @@ from ._compute_management_client_enums import ( AvailabilitySetSkuTypes, CachingTypes, + DiffDiskOptions, DiskCreateOptionTypes, IPVersion, IntervalInMins, @@ -491,6 +492,7 @@ 'WindowsConfiguration', 'AvailabilitySetSkuTypes', 'CachingTypes', + 'DiffDiskOptions', 'DiskCreateOptionTypes', 'IPVersion', 'IntervalInMins', diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/_compute_management_client_enums.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/_compute_management_client_enums.py index b5bea340c4af..3858534ce5cc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/_compute_management_client_enums.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/_compute_management_client_enums.py @@ -6,28 +6,52 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum - -class AvailabilitySetSkuTypes(str, Enum): +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class AvailabilitySetSkuTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the sku of an Availability Set. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual machines with unmanaged disks. Default value is 'Classic'. """ - classic = "Classic" - aligned = "Aligned" + CLASSIC = "Classic" + ALIGNED = "Aligned" -class CachingTypes(str, Enum): +class CachingTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the caching requirements. :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **None** :code:`
`:code:`
` **ReadOnly** :code:`
`:code:`
` **ReadWrite** :code:`
`:code:`
` Default: **None for Standard storage. ReadOnly for Premium storage** """ - none = "None" - read_only = "ReadOnly" - read_write = "ReadWrite" + NONE = "None" + READ_ONLY = "ReadOnly" + READ_WRITE = "ReadWrite" + +class DiffDiskOptions(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the ephemeral disk option for operating system disk. + """ + + LOCAL = "Local" -class DiskCreateOptionTypes(str, Enum): +class DiskCreateOptionTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies how the virtual machine should be created.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` **Attach** \u2013 This value is used when you are using a specialized disk to create the virtual machine.:code:`
`:code:`
` **FromImage** \u2013 @@ -36,123 +60,123 @@ class DiskCreateOptionTypes(str, Enum): marketplace image, you also use the plan element previously described. """ - from_image = "FromImage" - empty = "Empty" - attach = "Attach" + FROM_IMAGE = "FromImage" + EMPTY = "Empty" + ATTACH = "Attach" -class IntervalInMins(str, Enum): +class IntervalInMins(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Interval value in minutes used to create LogAnalytics call rate logs. """ - three_mins = "ThreeMins" - five_mins = "FiveMins" - thirty_mins = "ThirtyMins" - sixty_mins = "SixtyMins" + THREE_MINS = "ThreeMins" + FIVE_MINS = "FiveMins" + THIRTY_MINS = "ThirtyMins" + SIXTY_MINS = "SixtyMins" -class IPVersion(str, Enum): +class IPVersion(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. """ - i_pv4 = "IPv4" - i_pv6 = "IPv6" + I_PV4 = "IPv4" + I_PV6 = "IPv6" -class MaintenanceOperationResultCodeTypes(str, Enum): +class MaintenanceOperationResultCodeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The Last Maintenance Operation Result Code. """ - none = "None" - retry_later = "RetryLater" - maintenance_aborted = "MaintenanceAborted" - maintenance_completed = "MaintenanceCompleted" + NONE = "None" + RETRY_LATER = "RetryLater" + MAINTENANCE_ABORTED = "MaintenanceAborted" + MAINTENANCE_COMPLETED = "MaintenanceCompleted" -class OperatingSystemStateTypes(str, Enum): +class OperatingSystemStateTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The OS State. """ - generalized = "Generalized" - specialized = "Specialized" + GENERALIZED = "Generalized" + SPECIALIZED = "Specialized" -class OperatingSystemTypes(str, Enum): +class OperatingSystemTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The operating system of the osDiskImage. """ - windows = "Windows" - linux = "Linux" + WINDOWS = "Windows" + LINUX = "Linux" -class ProtocolTypes(str, Enum): +class ProtocolTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the protocol of listener. :code:`
`:code:`
` Possible values are: :code:`
`\ **http** :code:`
`:code:`
` **https** """ - http = "Http" - https = "Https" + HTTP = "Http" + HTTPS = "Https" -class ProximityPlacementGroupType(str, Enum): +class ProximityPlacementGroupType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the type of the proximity placement group. :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **Standard** : Co-locate resources within an Azure region or Availability Zone. :code:`
`:code:`
` **Ultra** : For future use. """ - standard = "Standard" - ultra = "Ultra" + STANDARD = "Standard" + ULTRA = "Ultra" -class ResourceIdentityType(str, Enum): +class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The type of identity used for the virtual machine. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine. """ - system_assigned = "SystemAssigned" - user_assigned = "UserAssigned" - system_assigned_user_assigned = "SystemAssigned, UserAssigned" - none = "None" + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned, UserAssigned" + NONE = "None" -class RollingUpgradeActionType(str, Enum): +class RollingUpgradeActionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The last action performed on the rolling upgrade. """ - start = "Start" - cancel = "Cancel" + START = "Start" + CANCEL = "Cancel" -class RollingUpgradeStatusCode(str, Enum): +class RollingUpgradeStatusCode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Code indicating the current status of the upgrade. """ - rolling_forward = "RollingForward" - cancelled = "Cancelled" - completed = "Completed" - faulted = "Faulted" + ROLLING_FORWARD = "RollingForward" + CANCELLED = "Cancelled" + COMPLETED = "Completed" + FAULTED = "Faulted" -class SettingNames(str, Enum): +class SettingNames(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon. """ - auto_logon = "AutoLogon" - first_logon_commands = "FirstLogonCommands" + AUTO_LOGON = "AutoLogon" + FIRST_LOGON_COMMANDS = "FirstLogonCommands" -class StatusLevelTypes(str, Enum): +class StatusLevelTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The level code. """ - info = "Info" - warning = "Warning" - error = "Error" + INFO = "Info" + WARNING = "Warning" + ERROR = "Error" -class StorageAccountTypes(str, Enum): +class StorageAccountTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the storage account type for the managed disk. Managed OS disk storage account type can only be set when you create the scale set. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. """ - standard_lrs = "Standard_LRS" - premium_lrs = "Premium_LRS" - standard_ssd_lrs = "StandardSSD_LRS" - ultra_ssd_lrs = "UltraSSD_LRS" + STANDARD_LRS = "Standard_LRS" + PREMIUM_LRS = "Premium_LRS" + STANDARD_SSD_LRS = "StandardSSD_LRS" + ULTRA_SSD_LRS = "UltraSSD_LRS" -class UpgradeMode(str, Enum): +class UpgradeMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the mode of an upgrade to virtual machines in the scale set.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` **Manual** - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade @@ -160,51 +184,51 @@ class UpgradeMode(str, Enum): automatically updated at the same time. """ - automatic = "Automatic" - manual = "Manual" - rolling = "Rolling" + AUTOMATIC = "Automatic" + MANUAL = "Manual" + ROLLING = "Rolling" -class UpgradeOperationInvoker(str, Enum): +class UpgradeOperationInvoker(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Invoker of the Upgrade Operation """ - unknown = "Unknown" - user = "User" - platform = "Platform" + UNKNOWN = "Unknown" + USER = "User" + PLATFORM = "Platform" -class UpgradeState(str, Enum): +class UpgradeState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Code indicating the current status of the upgrade. """ - rolling_forward = "RollingForward" - cancelled = "Cancelled" - completed = "Completed" - faulted = "Faulted" + ROLLING_FORWARD = "RollingForward" + CANCELLED = "Cancelled" + COMPLETED = "Completed" + FAULTED = "Faulted" -class VirtualMachineEvictionPolicyTypes(str, Enum): +class VirtualMachineEvictionPolicyTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the eviction policy for virtual machines in a low priority scale set. :code:`
`:code:`
`Minimum api-version: 2017-10-30-preview """ - deallocate = "Deallocate" - delete = "Delete" + DEALLOCATE = "Deallocate" + DELETE = "Delete" -class VirtualMachinePriorityTypes(str, Enum): +class VirtualMachinePriorityTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the priority for the virtual machines in the scale set. :code:`
`:code:`
`Minimum api-version: 2017-10-30-preview """ - regular = "Regular" - low = "Low" + REGULAR = "Regular" + LOW = "Low" -class VirtualMachineScaleSetSkuScaleType(str, Enum): +class VirtualMachineScaleSetSkuScaleType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The scale type applicable to the sku. """ - automatic = "Automatic" - none = "None" + AUTOMATIC = "Automatic" + NONE = "None" -class VirtualMachineSizeTypes(str, Enum): +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 `_. @@ -218,169 +242,169 @@ class VirtualMachineSizeTypes(str, Enum): `_ """ - basic_a0 = "Basic_A0" - basic_a1 = "Basic_A1" - basic_a2 = "Basic_A2" - basic_a3 = "Basic_A3" - basic_a4 = "Basic_A4" - standard_a0 = "Standard_A0" - standard_a1 = "Standard_A1" - standard_a2 = "Standard_A2" - standard_a3 = "Standard_A3" - standard_a4 = "Standard_A4" - standard_a5 = "Standard_A5" - standard_a6 = "Standard_A6" - standard_a7 = "Standard_A7" - standard_a8 = "Standard_A8" - standard_a9 = "Standard_A9" - standard_a10 = "Standard_A10" - standard_a11 = "Standard_A11" - standard_a1_v2 = "Standard_A1_v2" - standard_a2_v2 = "Standard_A2_v2" - standard_a4_v2 = "Standard_A4_v2" - standard_a8_v2 = "Standard_A8_v2" - standard_a2_m_v2 = "Standard_A2m_v2" - standard_a4_m_v2 = "Standard_A4m_v2" - standard_a8_m_v2 = "Standard_A8m_v2" - standard_b1_s = "Standard_B1s" - standard_b1_ms = "Standard_B1ms" - standard_b2_s = "Standard_B2s" - standard_b2_ms = "Standard_B2ms" - standard_b4_ms = "Standard_B4ms" - standard_b8_ms = "Standard_B8ms" - standard_d1 = "Standard_D1" - standard_d2 = "Standard_D2" - standard_d3 = "Standard_D3" - standard_d4 = "Standard_D4" - standard_d11 = "Standard_D11" - standard_d12 = "Standard_D12" - standard_d13 = "Standard_D13" - standard_d14 = "Standard_D14" - standard_d1_v2 = "Standard_D1_v2" - standard_d2_v2 = "Standard_D2_v2" - standard_d3_v2 = "Standard_D3_v2" - standard_d4_v2 = "Standard_D4_v2" - standard_d5_v2 = "Standard_D5_v2" - standard_d2_v3 = "Standard_D2_v3" - standard_d4_v3 = "Standard_D4_v3" - standard_d8_v3 = "Standard_D8_v3" - standard_d16_v3 = "Standard_D16_v3" - standard_d32_v3 = "Standard_D32_v3" - standard_d64_v3 = "Standard_D64_v3" - standard_d2_s_v3 = "Standard_D2s_v3" - standard_d4_s_v3 = "Standard_D4s_v3" - standard_d8_s_v3 = "Standard_D8s_v3" - standard_d16_s_v3 = "Standard_D16s_v3" - standard_d32_s_v3 = "Standard_D32s_v3" - standard_d64_s_v3 = "Standard_D64s_v3" - standard_d11_v2 = "Standard_D11_v2" - standard_d12_v2 = "Standard_D12_v2" - standard_d13_v2 = "Standard_D13_v2" - standard_d14_v2 = "Standard_D14_v2" - standard_d15_v2 = "Standard_D15_v2" - standard_ds1 = "Standard_DS1" - standard_ds2 = "Standard_DS2" - standard_ds3 = "Standard_DS3" - standard_ds4 = "Standard_DS4" - standard_ds11 = "Standard_DS11" - standard_ds12 = "Standard_DS12" - standard_ds13 = "Standard_DS13" - standard_ds14 = "Standard_DS14" - standard_ds1_v2 = "Standard_DS1_v2" - standard_ds2_v2 = "Standard_DS2_v2" - standard_ds3_v2 = "Standard_DS3_v2" - standard_ds4_v2 = "Standard_DS4_v2" - standard_ds5_v2 = "Standard_DS5_v2" - standard_ds11_v2 = "Standard_DS11_v2" - standard_ds12_v2 = "Standard_DS12_v2" - standard_ds13_v2 = "Standard_DS13_v2" - standard_ds14_v2 = "Standard_DS14_v2" - standard_ds15_v2 = "Standard_DS15_v2" - standard_ds13_4_v2 = "Standard_DS13-4_v2" - standard_ds13_2_v2 = "Standard_DS13-2_v2" - standard_ds14_8_v2 = "Standard_DS14-8_v2" - standard_ds14_4_v2 = "Standard_DS14-4_v2" - standard_e2_v3 = "Standard_E2_v3" - standard_e4_v3 = "Standard_E4_v3" - standard_e8_v3 = "Standard_E8_v3" - standard_e16_v3 = "Standard_E16_v3" - standard_e32_v3 = "Standard_E32_v3" - standard_e64_v3 = "Standard_E64_v3" - standard_e2_s_v3 = "Standard_E2s_v3" - standard_e4_s_v3 = "Standard_E4s_v3" - standard_e8_s_v3 = "Standard_E8s_v3" - standard_e16_s_v3 = "Standard_E16s_v3" - standard_e32_s_v3 = "Standard_E32s_v3" - standard_e64_s_v3 = "Standard_E64s_v3" - standard_e32_16_v3 = "Standard_E32-16_v3" - standard_e32_8_s_v3 = "Standard_E32-8s_v3" - standard_e64_32_s_v3 = "Standard_E64-32s_v3" - standard_e64_16_s_v3 = "Standard_E64-16s_v3" - standard_f1 = "Standard_F1" - standard_f2 = "Standard_F2" - standard_f4 = "Standard_F4" - standard_f8 = "Standard_F8" - standard_f16 = "Standard_F16" - standard_f1_s = "Standard_F1s" - standard_f2_s = "Standard_F2s" - standard_f4_s = "Standard_F4s" - standard_f8_s = "Standard_F8s" - standard_f16_s = "Standard_F16s" - standard_f2_s_v2 = "Standard_F2s_v2" - standard_f4_s_v2 = "Standard_F4s_v2" - standard_f8_s_v2 = "Standard_F8s_v2" - standard_f16_s_v2 = "Standard_F16s_v2" - standard_f32_s_v2 = "Standard_F32s_v2" - standard_f64_s_v2 = "Standard_F64s_v2" - standard_f72_s_v2 = "Standard_F72s_v2" - standard_g1 = "Standard_G1" - standard_g2 = "Standard_G2" - standard_g3 = "Standard_G3" - standard_g4 = "Standard_G4" - standard_g5 = "Standard_G5" - standard_gs1 = "Standard_GS1" - standard_gs2 = "Standard_GS2" - standard_gs3 = "Standard_GS3" - standard_gs4 = "Standard_GS4" - standard_gs5 = "Standard_GS5" - standard_gs4_8 = "Standard_GS4-8" - standard_gs4_4 = "Standard_GS4-4" - standard_gs5_16 = "Standard_GS5-16" - standard_gs5_8 = "Standard_GS5-8" - standard_h8 = "Standard_H8" - standard_h16 = "Standard_H16" - standard_h8_m = "Standard_H8m" - standard_h16_m = "Standard_H16m" - standard_h16_r = "Standard_H16r" - standard_h16_mr = "Standard_H16mr" - standard_l4_s = "Standard_L4s" - standard_l8_s = "Standard_L8s" - standard_l16_s = "Standard_L16s" - standard_l32_s = "Standard_L32s" - standard_m64_s = "Standard_M64s" - standard_m64_ms = "Standard_M64ms" - standard_m128_s = "Standard_M128s" - standard_m128_ms = "Standard_M128ms" - standard_m64_32_ms = "Standard_M64-32ms" - standard_m64_16_ms = "Standard_M64-16ms" - standard_m128_64_ms = "Standard_M128-64ms" - standard_m128_32_ms = "Standard_M128-32ms" - standard_nc6 = "Standard_NC6" - standard_nc12 = "Standard_NC12" - standard_nc24 = "Standard_NC24" - standard_nc24_r = "Standard_NC24r" - standard_nc6_s_v2 = "Standard_NC6s_v2" - standard_nc12_s_v2 = "Standard_NC12s_v2" - standard_nc24_s_v2 = "Standard_NC24s_v2" - standard_nc24_rs_v2 = "Standard_NC24rs_v2" - standard_nc6_s_v3 = "Standard_NC6s_v3" - standard_nc12_s_v3 = "Standard_NC12s_v3" - standard_nc24_s_v3 = "Standard_NC24s_v3" - standard_nc24_rs_v3 = "Standard_NC24rs_v3" - standard_nd6_s = "Standard_ND6s" - standard_nd12_s = "Standard_ND12s" - standard_nd24_s = "Standard_ND24s" - standard_nd24_rs = "Standard_ND24rs" - standard_nv6 = "Standard_NV6" - standard_nv12 = "Standard_NV12" - standard_nv24 = "Standard_NV24" + BASIC_A0 = "Basic_A0" + BASIC_A1 = "Basic_A1" + BASIC_A2 = "Basic_A2" + BASIC_A3 = "Basic_A3" + BASIC_A4 = "Basic_A4" + STANDARD_A0 = "Standard_A0" + STANDARD_A1 = "Standard_A1" + STANDARD_A2 = "Standard_A2" + STANDARD_A3 = "Standard_A3" + STANDARD_A4 = "Standard_A4" + STANDARD_A5 = "Standard_A5" + STANDARD_A6 = "Standard_A6" + STANDARD_A7 = "Standard_A7" + STANDARD_A8 = "Standard_A8" + STANDARD_A9 = "Standard_A9" + STANDARD_A10 = "Standard_A10" + STANDARD_A11 = "Standard_A11" + STANDARD_A1_V2 = "Standard_A1_v2" + STANDARD_A2_V2 = "Standard_A2_v2" + STANDARD_A4_V2 = "Standard_A4_v2" + STANDARD_A8_V2 = "Standard_A8_v2" + STANDARD_A2_M_V2 = "Standard_A2m_v2" + STANDARD_A4_M_V2 = "Standard_A4m_v2" + STANDARD_A8_M_V2 = "Standard_A8m_v2" + STANDARD_B1_S = "Standard_B1s" + STANDARD_B1_MS = "Standard_B1ms" + STANDARD_B2_S = "Standard_B2s" + STANDARD_B2_MS = "Standard_B2ms" + STANDARD_B4_MS = "Standard_B4ms" + STANDARD_B8_MS = "Standard_B8ms" + STANDARD_D1 = "Standard_D1" + STANDARD_D2 = "Standard_D2" + STANDARD_D3 = "Standard_D3" + STANDARD_D4 = "Standard_D4" + STANDARD_D11 = "Standard_D11" + STANDARD_D12 = "Standard_D12" + STANDARD_D13 = "Standard_D13" + STANDARD_D14 = "Standard_D14" + STANDARD_D1_V2 = "Standard_D1_v2" + STANDARD_D2_V2 = "Standard_D2_v2" + STANDARD_D3_V2 = "Standard_D3_v2" + STANDARD_D4_V2 = "Standard_D4_v2" + STANDARD_D5_V2 = "Standard_D5_v2" + STANDARD_D2_V3 = "Standard_D2_v3" + STANDARD_D4_V3 = "Standard_D4_v3" + STANDARD_D8_V3 = "Standard_D8_v3" + STANDARD_D16_V3 = "Standard_D16_v3" + STANDARD_D32_V3 = "Standard_D32_v3" + STANDARD_D64_V3 = "Standard_D64_v3" + STANDARD_D2_S_V3 = "Standard_D2s_v3" + STANDARD_D4_S_V3 = "Standard_D4s_v3" + STANDARD_D8_S_V3 = "Standard_D8s_v3" + STANDARD_D16_S_V3 = "Standard_D16s_v3" + STANDARD_D32_S_V3 = "Standard_D32s_v3" + STANDARD_D64_S_V3 = "Standard_D64s_v3" + STANDARD_D11_V2 = "Standard_D11_v2" + STANDARD_D12_V2 = "Standard_D12_v2" + STANDARD_D13_V2 = "Standard_D13_v2" + STANDARD_D14_V2 = "Standard_D14_v2" + STANDARD_D15_V2 = "Standard_D15_v2" + STANDARD_DS1 = "Standard_DS1" + STANDARD_DS2 = "Standard_DS2" + STANDARD_DS3 = "Standard_DS3" + STANDARD_DS4 = "Standard_DS4" + STANDARD_DS11 = "Standard_DS11" + STANDARD_DS12 = "Standard_DS12" + STANDARD_DS13 = "Standard_DS13" + STANDARD_DS14 = "Standard_DS14" + STANDARD_DS1_V2 = "Standard_DS1_v2" + STANDARD_DS2_V2 = "Standard_DS2_v2" + STANDARD_DS3_V2 = "Standard_DS3_v2" + STANDARD_DS4_V2 = "Standard_DS4_v2" + STANDARD_DS5_V2 = "Standard_DS5_v2" + STANDARD_DS11_V2 = "Standard_DS11_v2" + STANDARD_DS12_V2 = "Standard_DS12_v2" + STANDARD_DS13_V2 = "Standard_DS13_v2" + STANDARD_DS14_V2 = "Standard_DS14_v2" + STANDARD_DS15_V2 = "Standard_DS15_v2" + STANDARD_DS13_4_V2 = "Standard_DS13-4_v2" + STANDARD_DS13_2_V2 = "Standard_DS13-2_v2" + STANDARD_DS14_8_V2 = "Standard_DS14-8_v2" + STANDARD_DS14_4_V2 = "Standard_DS14-4_v2" + STANDARD_E2_V3 = "Standard_E2_v3" + STANDARD_E4_V3 = "Standard_E4_v3" + STANDARD_E8_V3 = "Standard_E8_v3" + STANDARD_E16_V3 = "Standard_E16_v3" + STANDARD_E32_V3 = "Standard_E32_v3" + STANDARD_E64_V3 = "Standard_E64_v3" + STANDARD_E2_S_V3 = "Standard_E2s_v3" + STANDARD_E4_S_V3 = "Standard_E4s_v3" + STANDARD_E8_S_V3 = "Standard_E8s_v3" + STANDARD_E16_S_V3 = "Standard_E16s_v3" + STANDARD_E32_S_V3 = "Standard_E32s_v3" + STANDARD_E64_S_V3 = "Standard_E64s_v3" + STANDARD_E32_16_V3 = "Standard_E32-16_v3" + STANDARD_E32_8_S_V3 = "Standard_E32-8s_v3" + STANDARD_E64_32_S_V3 = "Standard_E64-32s_v3" + STANDARD_E64_16_S_V3 = "Standard_E64-16s_v3" + STANDARD_F1 = "Standard_F1" + STANDARD_F2 = "Standard_F2" + STANDARD_F4 = "Standard_F4" + STANDARD_F8 = "Standard_F8" + STANDARD_F16 = "Standard_F16" + STANDARD_F1_S = "Standard_F1s" + STANDARD_F2_S = "Standard_F2s" + STANDARD_F4_S = "Standard_F4s" + STANDARD_F8_S = "Standard_F8s" + STANDARD_F16_S = "Standard_F16s" + STANDARD_F2_S_V2 = "Standard_F2s_v2" + STANDARD_F4_S_V2 = "Standard_F4s_v2" + STANDARD_F8_S_V2 = "Standard_F8s_v2" + STANDARD_F16_S_V2 = "Standard_F16s_v2" + STANDARD_F32_S_V2 = "Standard_F32s_v2" + STANDARD_F64_S_V2 = "Standard_F64s_v2" + STANDARD_F72_S_V2 = "Standard_F72s_v2" + STANDARD_G1 = "Standard_G1" + STANDARD_G2 = "Standard_G2" + STANDARD_G3 = "Standard_G3" + STANDARD_G4 = "Standard_G4" + STANDARD_G5 = "Standard_G5" + STANDARD_GS1 = "Standard_GS1" + STANDARD_GS2 = "Standard_GS2" + STANDARD_GS3 = "Standard_GS3" + STANDARD_GS4 = "Standard_GS4" + STANDARD_GS5 = "Standard_GS5" + STANDARD_GS4_8 = "Standard_GS4-8" + STANDARD_GS4_4 = "Standard_GS4-4" + STANDARD_GS5_16 = "Standard_GS5-16" + STANDARD_GS5_8 = "Standard_GS5-8" + STANDARD_H8 = "Standard_H8" + STANDARD_H16 = "Standard_H16" + STANDARD_H8_M = "Standard_H8m" + STANDARD_H16_M = "Standard_H16m" + STANDARD_H16_R = "Standard_H16r" + STANDARD_H16_MR = "Standard_H16mr" + STANDARD_L4_S = "Standard_L4s" + STANDARD_L8_S = "Standard_L8s" + STANDARD_L16_S = "Standard_L16s" + STANDARD_L32_S = "Standard_L32s" + STANDARD_M64_S = "Standard_M64s" + STANDARD_M64_MS = "Standard_M64ms" + STANDARD_M128_S = "Standard_M128s" + STANDARD_M128_MS = "Standard_M128ms" + STANDARD_M64_32_MS = "Standard_M64-32ms" + STANDARD_M64_16_MS = "Standard_M64-16ms" + STANDARD_M128_64_MS = "Standard_M128-64ms" + STANDARD_M128_32_MS = "Standard_M128-32ms" + STANDARD_NC6 = "Standard_NC6" + STANDARD_NC12 = "Standard_NC12" + STANDARD_NC24 = "Standard_NC24" + STANDARD_NC24_R = "Standard_NC24r" + STANDARD_NC6_S_V2 = "Standard_NC6s_v2" + STANDARD_NC12_S_V2 = "Standard_NC12s_v2" + STANDARD_NC24_S_V2 = "Standard_NC24s_v2" + STANDARD_NC24_RS_V2 = "Standard_NC24rs_v2" + STANDARD_NC6_S_V3 = "Standard_NC6s_v3" + STANDARD_NC12_S_V3 = "Standard_NC12s_v3" + STANDARD_NC24_S_V3 = "Standard_NC24s_v3" + STANDARD_NC24_RS_V3 = "Standard_NC24rs_v3" + STANDARD_ND6_S = "Standard_ND6s" + STANDARD_ND12_S = "Standard_ND12s" + STANDARD_ND24_S = "Standard_ND24s" + STANDARD_ND24_RS = "Standard_ND24rs" + STANDARD_NV6 = "Standard_NV6" + STANDARD_NV12 = "Standard_NV12" + STANDARD_NV24 = "Standard_NV24" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/_models.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/_models.py index f4b1653ed718..9f0d6d71a6db 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/_models.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/_models.py @@ -778,28 +778,21 @@ def __init__( class DiffDiskSettings(msrest.serialization.Model): """Describes the parameters of ephemeral disk settings that can be specified for operating system disk. :code:`
`:code:`
` NOTE: The ephemeral disk settings can only be specified for managed disk. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar option: Specifies the ephemeral disk settings for operating system disk. Default value: - "Local". - :vartype option: str + :param option: Specifies the ephemeral disk settings for operating system disk. Possible values + include: "Local". + :type option: str or ~azure.mgmt.compute.v2018_10_01.models.DiffDiskOptions """ - _validation = { - 'option': {'constant': True}, - } - _attribute_map = { 'option': {'key': 'option', 'type': 'str'}, } - option = "Local" - def __init__( self, **kwargs ): super(DiffDiskSettings, self).__init__(**kwargs) + self.option = kwargs.get('option', None) class DiskEncryptionSettings(msrest.serialization.Model): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/_models_py3.py index 83e0b9419f62..9462ced9ffc1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/_models_py3.py @@ -846,28 +846,23 @@ def __init__( class DiffDiskSettings(msrest.serialization.Model): """Describes the parameters of ephemeral disk settings that can be specified for operating system disk. :code:`
`:code:`
` NOTE: The ephemeral disk settings can only be specified for managed disk. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar option: Specifies the ephemeral disk settings for operating system disk. Default value: - "Local". - :vartype option: str + :param option: Specifies the ephemeral disk settings for operating system disk. Possible values + include: "Local". + :type option: str or ~azure.mgmt.compute.v2018_10_01.models.DiffDiskOptions """ - _validation = { - 'option': {'constant': True}, - } - _attribute_map = { 'option': {'key': 'option', 'type': 'str'}, } - option = "Local" - def __init__( self, + *, + option: Optional[Union[str, "DiffDiskOptions"]] = None, **kwargs ): super(DiffDiskSettings, self).__init__(**kwargs) + self.option = option class DiskEncryptionSettings(msrest.serialization.Model): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_availability_sets_operations.py index 791bd0a3ed14..acf61367ed39 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_availability_sets_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -67,10 +67,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -88,14 +91,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailabilitySet') 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 @@ -133,10 +134,13 @@ def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -154,14 +158,12 @@ def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailabilitySetUpdate') 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 @@ -196,7 +198,9 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -216,7 +220,6 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,9 +252,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -268,9 +274,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -295,7 +300,8 @@ def list_by_subscription( # type: (...) -> Iterable["models.AvailabilitySetListResult"] """Lists all availability sets in a subscription. - :param expand: The expand expression to apply to the operation. + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AvailabilitySetListResult or the result of cls(response) @@ -303,11 +309,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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_subscription.metadata['url'] # type: ignore @@ -321,15 +334,11 @@ def prepare_request(next_link=None): if expand is not None: query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -372,11 +381,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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 @@ -389,15 +405,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -432,7 +444,7 @@ def list_available_sizes( ): # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes that can be used to create a new virtual machine in - an existing availability set. + an existing availability set. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -444,11 +456,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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_available_sizes.metadata['url'] # type: ignore @@ -462,15 +481,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_images_operations.py index 3da9c7fa0b00..feabf898b7f2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_images_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.Image" cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'Image') 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('Image', pipeline_response) @@ -112,7 +112,7 @@ def begin_create_or_update( parameters, # type: "models.Image" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Image"] """Create or update an image. :param resource_group_name: The name of the resource group. @@ -180,10 +180,13 @@ def _update_initial( ): # type: (...) -> "models.Image" cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -201,14 +204,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ImageUpdate') 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 @@ -216,7 +217,6 @@ def _update_initial( 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('Image', pipeline_response) @@ -236,7 +236,7 @@ def begin_update( parameters, # type: "models.ImageUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Image"] """Update an image. :param resource_group_name: The name of the resource group. @@ -303,7 +303,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -323,7 +325,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -343,7 +344,7 @@ def begin_delete( image_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes an Image. :param resource_group_name: The name of the resource group. @@ -418,9 +419,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -439,9 +443,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -474,11 +477,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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 @@ -491,15 +501,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -532,7 +538,7 @@ def list( ): # type: (...) -> Iterable["models.ImageListResult"] """Gets the list of Images in the subscription. Use nextLink property in the response to get the - next page of Images. Do this till nextLink is null to fetch all the Images. + next page of Images. Do this till nextLink is null to fetch all the Images. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ImageListResult or the result of cls(response) @@ -540,11 +546,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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 @@ -556,15 +569,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_log_analytics_operations.py index dee6953ca189..a7d76e56302b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_log_analytics_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod @@ -52,12 +52,15 @@ def _export_request_rate_by_interval_initial( parameters, # type: "models.RequestRateByIntervalInput" **kwargs # type: Any ): - # type: (...) -> "models.LogAnalyticsOperationResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._export_request_rate_by_interval_initial.metadata['url'] # type: ignore @@ -74,14 +77,12 @@ def _export_request_rate_by_interval_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RequestRateByIntervalInput') 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 @@ -105,9 +106,9 @@ def begin_export_request_rate_by_interval( parameters, # type: "models.RequestRateByIntervalInput" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LogAnalyticsOperationResult"] """Export logs that show Api requests made by this subscription in the given time window to show - throttling activities. + throttling activities. :param location: The location upon which virtual-machine-sizes is queried. :type location: str @@ -168,12 +169,15 @@ def _export_throttled_requests_initial( parameters, # type: "models.LogAnalyticsInputBase" **kwargs # type: Any ): - # type: (...) -> "models.LogAnalyticsOperationResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._export_throttled_requests_initial.metadata['url'] # type: ignore @@ -190,14 +194,12 @@ def _export_throttled_requests_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LogAnalyticsInputBase') 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 @@ -221,9 +223,9 @@ def begin_export_throttled_requests( parameters, # type: "models.LogAnalyticsInputBase" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LogAnalyticsOperationResult"] """Export logs that show total throttled Api requests for this subscription in the given time - window. + window. :param location: The location upon which virtual-machine-sizes is queried. :type location: str diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_operations.py index 1fdd393986d8..f1080b39b1bb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -58,11 +58,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeOperationListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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 @@ -70,15 +77,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_proximity_placement_groups_operations.py index c2d1ad585975..accc5d95ccbb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_proximity_placement_groups_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -67,10 +67,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -88,14 +91,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ProximityPlacementGroup') 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 @@ -103,7 +104,6 @@ def create_or_update( 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('ProximityPlacementGroup', pipeline_response) @@ -138,10 +138,13 @@ def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -159,14 +162,12 @@ def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'UpdateResource') 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 @@ -201,7 +202,9 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -221,7 +224,6 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,9 +256,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -273,9 +278,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -305,11 +309,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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_subscription.metadata['url'] # type: ignore @@ -321,15 +332,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -372,11 +379,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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 @@ -389,15 +403,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_usage_operations.py index 02989030c7da..5d6fe5e2c872 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_usage_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,7 +52,7 @@ def list( ): # type: (...) -> Iterable["models.ListUsagesResult"] """Gets, for the specified location, the current compute resource usage information as well as the - limits for compute resources under the subscription. + limits for compute resources under the subscription. :param location: The location for which resource usage is queried. :type location: str @@ -62,11 +62,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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 @@ -79,15 +86,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_extension_images_operations.py index 1f7b78981a28..40c2fad89868 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_extension_images_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -69,9 +69,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -90,9 +93,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -128,9 +130,12 @@ def list_types( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.list_types.metadata['url'] # type: ignore @@ -147,9 +152,8 @@ def list_types( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -197,9 +201,12 @@ def list_versions( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.list_versions.metadata['url'] # type: ignore @@ -223,9 +230,8 @@ def list_versions( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_extensions_operations.py index fe31088b90ca..1a325df7b837 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_extensions_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachineExtension" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -78,14 +81,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtension') 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 @@ -93,7 +94,6 @@ def _create_or_update_initial( 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('VirtualMachineExtension', pipeline_response) @@ -114,18 +114,18 @@ def begin_create_or_update( extension_parameters, # type: "models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineExtension"] """The operation to create or update the extension. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_name: The name of the virtual machine where the extension should be created or - updated. + updated. :type vm_name: str :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Create Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2018_10_01.models.VirtualMachineExtension :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. @@ -188,10 +188,13 @@ def _update_initial( ): # type: (...) -> "models.VirtualMachineExtension" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -210,14 +213,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtensionUpdate') 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 @@ -241,7 +242,7 @@ def begin_update( extension_parameters, # type: "models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineExtension"] """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -251,7 +252,7 @@ def begin_update( :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Update Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2018_10_01.models.VirtualMachineExtensionUpdate :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. @@ -313,7 +314,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -334,7 +337,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -355,7 +357,7 @@ def begin_delete( vm_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -436,9 +438,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -458,9 +463,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -499,9 +503,12 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -520,9 +527,8 @@ def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_images_operations.py index a32049830f06..df22bb019679 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_images_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -72,9 +72,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -94,9 +97,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -148,9 +150,12 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -175,9 +180,8 @@ def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -213,9 +217,12 @@ def list_offers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.list_offers.metadata['url'] # type: ignore @@ -232,9 +239,8 @@ def list_offers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -267,9 +273,12 @@ def list_publishers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.list_publishers.metadata['url'] # type: ignore @@ -285,9 +294,8 @@ def list_publishers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -326,9 +334,12 @@ def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.list_skus.metadata['url'] # type: ignore @@ -346,9 +357,8 @@ def list_skus( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_run_commands_operations.py index e9e2e403e716..ff4366ce73de 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_run_commands_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -61,11 +61,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json, text/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 @@ -78,15 +85,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -132,9 +135,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandDocument"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json, text/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -151,9 +157,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_extensions_operations.py index fd1f8a08c0c4..7b23ba32142d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -57,10 +57,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachineScaleSetExtension" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -79,14 +82,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineScaleSetExtension') 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 @@ -94,7 +95,6 @@ def _create_or_update_initial( 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('VirtualMachineScaleSetExtension', pipeline_response) @@ -115,18 +115,18 @@ def begin_create_or_update( extension_parameters, # type: "models.VirtualMachineScaleSetExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineScaleSetExtension"] """The operation to create or update an extension. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_scale_set_name: The name of the VM scale set where the extension should be create or - updated. + updated. :type vm_scale_set_name: str :param vmss_extension_name: The name of the VM scale set extension. :type vmss_extension_name: str :param extension_parameters: Parameters supplied to the Create VM scale set Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2018_10_01.models.VirtualMachineScaleSetExtension :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. @@ -188,7 +188,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -209,7 +211,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -230,7 +231,7 @@ def begin_delete( vmss_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -311,9 +312,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -333,9 +337,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -371,11 +374,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtensionListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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 @@ -389,15 +399,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 4cf560d7dc13..24f9747c374b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod @@ -54,7 +54,9 @@ def _cancel_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -74,7 +76,6 @@ def _cancel_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -94,7 +95,7 @@ def begin_cancel( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Cancels the current virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -155,7 +156,9 @@ def _start_os_upgrade_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -175,7 +178,6 @@ def _start_os_upgrade_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -195,10 +197,10 @@ def begin_start_os_upgrade( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts a rolling upgrade to move all virtual machine scale set instances to the latest - available Platform Image OS version. Instances which are already running the latest available - OS version are not affected. + available Platform Image OS version. Instances which are already running the latest available + OS version are not affected. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -258,7 +260,9 @@ def _start_extension_upgrade_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -278,7 +282,6 @@ def _start_extension_upgrade_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -298,10 +301,10 @@ def begin_start_extension_upgrade( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to - the latest available extension version. Instances which are already running the latest - extension versions are not affected. + the latest available extension version. Instances which are already running the latest + extension versions are not affected. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -372,9 +375,12 @@ def get_latest( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RollingUpgradeStatusInfo"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.get_latest.metadata['url'] # type: ignore @@ -391,9 +397,8 @@ def get_latest( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_vms_operations.py index bab9a328a2d6..59c9cb68b092 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -57,7 +57,9 @@ def _reimage_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") @@ -80,7 +82,6 @@ def _reimage_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_scale_set_vm_reimage_input is not None: body_content = self._serialize.body(vm_scale_set_vm_reimage_input, 'VirtualMachineReimageParameters') @@ -88,7 +89,6 @@ def _reimage_initial( body_content = None 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 @@ -109,7 +109,7 @@ def begin_reimage( vm_scale_set_vm_reimage_input=None, # type: Optional["models.VirtualMachineReimageParameters"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -177,7 +177,9 @@ def _reimage_all_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -198,7 +200,6 @@ def _reimage_all_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -219,9 +220,9 @@ def begin_reimage_all( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. - This operation is only supported for managed disks. + This operation is only supported for managed disks. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -285,7 +286,9 @@ def _deallocate_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -306,7 +309,6 @@ def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -327,10 +329,10 @@ def begin_deallocate( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and - releases the compute resources it uses. You are not billed for the compute resources of this - virtual machine once it is deallocated. + releases the compute resources it uses. You are not billed for the compute resources of this + virtual machine once it is deallocated. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -395,10 +397,13 @@ def _update_initial( ): # type: (...) -> "models.VirtualMachineScaleSetVM" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -417,14 +422,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSetVM') 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 @@ -432,7 +435,6 @@ def _update_initial( 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('VirtualMachineScaleSetVM', pipeline_response) @@ -453,13 +455,13 @@ def begin_update( parameters, # type: "models.VirtualMachineScaleSetVM" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineScaleSetVM"] """Updates a virtual machine of a VM scale set. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_scale_set_name: The name of the VM scale set where the extension should be create or - updated. + updated. :type vm_scale_set_name: str :param instance_id: The instance ID of the virtual machine. :type instance_id: str @@ -525,7 +527,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -546,7 +550,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -567,7 +570,7 @@ def begin_delete( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -645,9 +648,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -665,9 +671,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -706,9 +711,12 @@ def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -726,9 +734,8 @@ def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -761,11 +768,14 @@ def list( :type resource_group_name: str :param virtual_machine_scale_set_name: The name of the VM scale set. :type virtual_machine_scale_set_name: str - :param filter: The filter to apply to the operation. + :param filter: The filter to apply to the operation. Allowed values are + 'startswith(instanceView/statuses/code, 'PowerState') eq true', 'properties/latestModelApplied + eq true', 'properties/latestModelApplied eq false'. :type filter: str - :param select: The list parameters. + :param select: The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. :type select: str - :param expand: The expand expression to apply to the operation. + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetVMListResult or the result of cls(response) @@ -773,11 +783,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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 @@ -797,15 +814,11 @@ def prepare_request(next_link=None): query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -841,7 +854,9 @@ def _power_off_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -862,7 +877,6 @@ def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -883,10 +897,10 @@ def begin_power_off( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached - and you are getting charged for the resources. Instead, use deallocate to release resources and - avoid charges. + and you are getting charged for the resources. Instead, use deallocate to release resources and + avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -950,7 +964,9 @@ def _restart_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -971,7 +987,6 @@ def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -992,7 +1007,7 @@ def begin_restart( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Restarts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1057,7 +1072,9 @@ def _start_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -1078,7 +1095,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1099,7 +1115,7 @@ def begin_start( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1164,7 +1180,9 @@ def _redeploy_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -1185,7 +1203,6 @@ def _redeploy_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1206,9 +1223,9 @@ def begin_redeploy( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and - powers it back on. + powers it back on. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1272,7 +1289,9 @@ def _perform_maintenance_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -1293,7 +1312,6 @@ def _perform_maintenance_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1314,7 +1332,7 @@ def begin_perform_maintenance( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Performs maintenance on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1378,12 +1396,15 @@ def _run_command_initial( parameters, # type: "models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> "models.RunCommandResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" # Construct URL url = self._run_command_initial.metadata['url'] # type: ignore @@ -1402,14 +1423,12 @@ def _run_command_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RunCommandInput') 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 @@ -1435,7 +1454,7 @@ def begin_run_command( parameters, # type: "models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RunCommandResult"] """Run command on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_sets_operations.py index d75588029721..7f6333ce1013 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_sets_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachineScaleSet" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSet') 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('VirtualMachineScaleSet', pipeline_response) @@ -112,7 +112,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualMachineScaleSet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -180,10 +180,13 @@ def _update_initial( ): # type: (...) -> "models.VirtualMachineScaleSet" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -201,14 +204,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSetUpdate') 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 @@ -231,7 +232,7 @@ def begin_update( parameters, # type: "models.VirtualMachineScaleSetUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] """Update a VM scale set. :param resource_group_name: The name of the resource group. @@ -298,7 +299,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -318,7 +321,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -338,7 +340,7 @@ def begin_delete( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VM scale set. :param resource_group_name: The name of the resource group. @@ -410,9 +412,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -429,9 +434,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -457,7 +461,9 @@ def _deallocate_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") @@ -479,7 +485,6 @@ def _deallocate_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -487,7 +492,6 @@ def _deallocate_initial( body_content = None 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 @@ -507,10 +511,10 @@ def begin_deallocate( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and - releases the compute resources. You are not billed for the compute resources that this virtual - machine scale set deallocates. + releases the compute resources. You are not billed for the compute resources that this virtual + machine scale set deallocates. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -574,7 +578,9 @@ def _delete_instances_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") @@ -596,12 +602,10 @@ def _delete_instances_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -621,7 +625,7 @@ def begin_delete_instances( vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -696,9 +700,12 @@ def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -715,9 +722,8 @@ def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -750,11 +756,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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 @@ -767,15 +780,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -808,8 +817,8 @@ def list_all( ): # type: (...) -> Iterable["models.VirtualMachineScaleSetListWithLinkResult"] """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource - group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this - till nextLink is null to fetch all the VM Scale Sets. + group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this + till nextLink is null to fetch all the VM Scale Sets. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetListWithLinkResult or the result of cls(response) @@ -817,11 +826,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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_all.metadata['url'] # type: ignore @@ -833,15 +849,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -876,7 +888,7 @@ def list_skus( ): # type: (...) -> Iterable["models.VirtualMachineScaleSetListSkusResult"] """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM - instances allowed for each SKU. + instances allowed for each SKU. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -888,11 +900,18 @@ def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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_skus.metadata['url'] # type: ignore @@ -906,15 +925,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -960,11 +975,18 @@ def get_os_upgrade_history( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListOSUpgradeHistory"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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.get_os_upgrade_history.metadata['url'] # type: ignore @@ -978,15 +1000,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1022,7 +1040,9 @@ def _power_off_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") @@ -1044,7 +1064,6 @@ def _power_off_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1052,7 +1071,6 @@ def _power_off_initial( body_content = None 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 @@ -1072,10 +1090,10 @@ def begin_power_off( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still - attached and you are getting charged for the resources. Instead, use deallocate to release - resources and avoid charges. + attached and you are getting charged for the resources. Instead, use deallocate to release + resources and avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1139,7 +1157,9 @@ def _restart_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") @@ -1161,7 +1181,6 @@ def _restart_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1169,7 +1188,6 @@ def _restart_initial( body_content = None 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 @@ -1189,7 +1207,7 @@ def begin_restart( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Restarts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1254,7 +1272,9 @@ def _start_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") @@ -1276,7 +1296,6 @@ def _start_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1284,7 +1303,6 @@ def _start_initial( body_content = None 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 @@ -1304,7 +1322,7 @@ def begin_start( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1369,7 +1387,9 @@ def _redeploy_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") @@ -1391,7 +1411,6 @@ def _redeploy_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1399,7 +1418,6 @@ def _redeploy_initial( body_content = None 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 @@ -1419,9 +1437,9 @@ def begin_redeploy( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, - and powers them back on. + and powers them back on. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1485,7 +1503,9 @@ def _perform_maintenance_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") @@ -1507,7 +1527,6 @@ def _perform_maintenance_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1515,7 +1534,6 @@ def _perform_maintenance_initial( body_content = None 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 @@ -1535,11 +1553,11 @@ def begin_perform_maintenance( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances - which are not eligible for perform maintenance will be failed. Please refer to best practices - for more details: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual- - machine-scale-sets-maintenance-notifications. + which are not eligible for perform maintenance will be failed. Please refer to best practices + for more details: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual- + machine-scale-sets-maintenance-notifications. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1603,7 +1621,9 @@ def _update_instances_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") @@ -1625,12 +1645,10 @@ def _update_instances_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -1650,7 +1668,7 @@ def begin_update_instances( vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. :param resource_group_name: The name of the resource group. @@ -1715,7 +1733,9 @@ def _reimage_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") @@ -1737,7 +1757,6 @@ def _reimage_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_scale_set_reimage_input is not None: body_content = self._serialize.body(vm_scale_set_reimage_input, 'VirtualMachineScaleSetReimageParameters') @@ -1745,7 +1764,6 @@ def _reimage_initial( body_content = None 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 @@ -1765,10 +1783,10 @@ def begin_reimage( vm_scale_set_reimage_input=None, # type: Optional["models.VirtualMachineScaleSetReimageParameters"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which - don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual - machine is reset to initial state. + don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual + machine is reset to initial state. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1832,7 +1850,9 @@ def _reimage_all_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") @@ -1854,7 +1874,6 @@ def _reimage_all_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1862,7 +1881,6 @@ def _reimage_all_initial( body_content = None 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 @@ -1882,9 +1900,9 @@ def begin_reimage_all( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This - operation is only supported for managed disks. + operation is only supported for managed disks. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1963,9 +1981,12 @@ def force_recovery_service_fabric_platform_update_domain_walk( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RecoveryWalkResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.force_recovery_service_fabric_platform_update_domain_walk.metadata['url'] # type: ignore @@ -1983,9 +2004,8 @@ def force_recovery_service_fabric_platform_update_domain_walk( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_sizes_operations.py index 1d5123170f2c..e1240d66bcff 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_sizes_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,7 +52,7 @@ def list( ): # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] """This API is deprecated. Use `Resources Skus `_. + us/rest/api/compute/resourceskus/list>`_. :param location: The location upon which virtual-machine-sizes is queried. :type location: str @@ -62,11 +62,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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 @@ -79,15 +86,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machines_operations.py index 9fd7ce048886..c658772bb82c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machines_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -63,11 +63,18 @@ def list_by_location( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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_location.metadata['url'] # type: ignore @@ -80,15 +87,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -122,12 +125,15 @@ def _capture_initial( parameters, # type: "models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._capture_initial.metadata['url'] # type: ignore @@ -145,14 +151,12 @@ def _capture_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineCaptureParameters') 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 @@ -177,9 +181,9 @@ def begin_capture( parameters, # type: "models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineCaptureResult"] """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used - to create similar VMs. + to create similar VMs. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -246,10 +250,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachine" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -267,14 +274,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachine') 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 @@ -282,7 +287,6 @@ def _create_or_update_initial( 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('VirtualMachine', pipeline_response) @@ -302,7 +306,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualMachine" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachine"] """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -370,10 +374,13 @@ def _update_initial( ): # type: (...) -> "models.VirtualMachine" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -391,14 +398,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineUpdate') 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 @@ -406,7 +411,6 @@ def _update_initial( 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('VirtualMachine', pipeline_response) @@ -426,7 +430,7 @@ def begin_update( parameters, # type: "models.VirtualMachineUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachine"] """The operation to update a virtual machine. :param resource_group_name: The name of the resource group. @@ -493,7 +497,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -513,7 +519,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -533,7 +538,7 @@ def begin_delete( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to delete a virtual machine. :param resource_group_name: The name of the resource group. @@ -608,9 +613,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -629,9 +637,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -667,9 +674,12 @@ def instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + accept = "application/json" # Construct URL url = self.instance_view.metadata['url'] # type: ignore @@ -686,9 +696,8 @@ def instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -713,7 +722,9 @@ def _convert_to_managed_disks_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -733,7 +744,6 @@ def _convert_to_managed_disks_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -753,9 +763,9 @@ def begin_convert_to_managed_disks( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop- - deallocated before invoking this operation. + deallocated before invoking this operation. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -815,7 +825,9 @@ def _deallocate_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -835,7 +847,6 @@ def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -855,9 +866,9 @@ def begin_deallocate( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Shuts down the virtual machine and releases the compute resources. You are not billed for the - compute resources that this virtual machine uses. + compute resources that this virtual machine uses. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -928,7 +939,9 @@ def generalize( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -948,7 +961,6 @@ def generalize( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -969,7 +981,7 @@ def list( ): # type: (...) -> Iterable["models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified resource group. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -979,11 +991,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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 @@ -996,15 +1015,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1037,7 +1052,7 @@ def list_all( ): # type: (...) -> Iterable["models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified subscription. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineListResult or the result of cls(response) @@ -1045,11 +1060,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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_all.metadata['url'] # type: ignore @@ -1061,15 +1083,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1104,7 +1122,7 @@ def list_available_sizes( ): # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes to which the specified virtual machine can be - resized. + resized. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1116,11 +1134,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" + 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_available_sizes.metadata['url'] # type: ignore @@ -1134,15 +1159,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1177,7 +1198,9 @@ def _power_off_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -1197,7 +1220,6 @@ def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1217,9 +1239,9 @@ def begin_power_off( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with - the same provisioned resources. You are still charged for this virtual machine. + the same provisioned resources. You are still charged for this virtual machine. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1279,7 +1301,9 @@ def _restart_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -1299,7 +1323,6 @@ def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1319,7 +1342,7 @@ def begin_restart( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to restart a virtual machine. :param resource_group_name: The name of the resource group. @@ -1380,7 +1403,9 @@ def _start_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -1400,7 +1425,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1420,7 +1444,7 @@ def begin_start( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to start a virtual machine. :param resource_group_name: The name of the resource group. @@ -1481,7 +1505,9 @@ def _redeploy_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -1501,7 +1527,6 @@ def _redeploy_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1521,7 +1546,7 @@ def begin_redeploy( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Shuts down the virtual machine, moves it to a new node, and powers it back on. :param resource_group_name: The name of the resource group. @@ -1583,7 +1608,9 @@ def _reimage_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") @@ -1605,7 +1632,6 @@ def _reimage_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: body_content = self._serialize.body(parameters, 'VirtualMachineReimageParameters') @@ -1613,7 +1639,6 @@ def _reimage_initial( body_content = None 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 @@ -1633,7 +1658,7 @@ def begin_reimage( parameters=None, # type: Optional["models.VirtualMachineReimageParameters"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Reimages the virtual machine which has an ephemeral OS disk back to its initial state. :param resource_group_name: The name of the resource group. @@ -1697,7 +1722,9 @@ def _perform_maintenance_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -1717,7 +1744,6 @@ def _perform_maintenance_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1737,7 +1763,7 @@ def begin_perform_maintenance( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to perform maintenance on a virtual machine. :param resource_group_name: The name of the resource group. @@ -1797,12 +1823,15 @@ def _run_command_initial( parameters, # type: "models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> "models.RunCommandResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" # Construct URL url = self._run_command_initial.metadata['url'] # type: ignore @@ -1820,14 +1849,12 @@ def _run_command_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RunCommandInput') 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 @@ -1852,7 +1879,7 @@ def begin_run_command( parameters, # type: "models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RunCommandResult"] """Run command on the VM. :param resource_group_name: The name of the resource group. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/__init__.py index 20a4019e9c23..cdc7f7a1709a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/__init__.py @@ -10,7 +10,7 @@ __all__ = ['ComputeManagementClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass 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 e2953855e407..8bedc447edfc 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,6 +122,7 @@ 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/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_configuration.py index 994dcb1c316c..73a64eacd5b9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -47,8 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2019-03-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-compute/{}'.format(VERSION)) self._configure(**kwargs) @@ -61,6 +61,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) 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 421b0428d195..200f58a6fcb6 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 @@ -4,7 +4,11 @@ "client": { "name": "ComputeManagementClient", "filename": "_compute_management_client", - "description": "Compute Client." + "description": "Compute Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true }, "global_parameters": { "sync_method": { @@ -41,7 +45,10 @@ }, "config": { "credential": true, - "credential_scopes": ["https://management.azure.com/.default"] + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null }, "operation_groups": { "operations": "Operations", diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/__init__.py index c8a8b4817269..9e9459635989 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._compute_management_client_async import ComputeManagementClient +from ._compute_management_client import ComputeManagementClient __all__ = ['ComputeManagementClient'] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/_compute_management_client_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/_compute_management_client.py similarity index 76% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/_compute_management_client_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/_compute_management_client.py index 035698805a49..f08ee4eeb543 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/_compute_management_client_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/_compute_management_client.py @@ -15,32 +15,32 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration_async import ComputeManagementClientConfiguration -from .operations_async import Operations -from .operations_async import AvailabilitySetsOperations -from .operations_async import ProximityPlacementGroupsOperations -from .operations_async import DedicatedHostGroupsOperations -from .operations_async import DedicatedHostsOperations -from .operations_async import VirtualMachineExtensionImagesOperations -from .operations_async import VirtualMachineExtensionsOperations -from .operations_async import VirtualMachineImagesOperations -from .operations_async import UsageOperations -from .operations_async import VirtualMachinesOperations -from .operations_async import VirtualMachineSizesOperations -from .operations_async import ImagesOperations -from .operations_async import VirtualMachineScaleSetsOperations -from .operations_async import VirtualMachineScaleSetExtensionsOperations -from .operations_async import VirtualMachineScaleSetRollingUpgradesOperations -from .operations_async import VirtualMachineScaleSetVMsOperations -from .operations_async import LogAnalyticsOperations -from .operations_async import VirtualMachineRunCommandsOperations -from .operations_async import GalleriesOperations -from .operations_async import GalleryImagesOperations -from .operations_async import GalleryImageVersionsOperations -from .operations_async import GalleryApplicationsOperations -from .operations_async import GalleryApplicationVersionsOperations -from .operations_async import DisksOperations -from .operations_async import SnapshotsOperations +from ._configuration import ComputeManagementClientConfiguration +from .operations import Operations +from .operations import AvailabilitySetsOperations +from .operations import ProximityPlacementGroupsOperations +from .operations import DedicatedHostGroupsOperations +from .operations import DedicatedHostsOperations +from .operations import VirtualMachineExtensionImagesOperations +from .operations import VirtualMachineExtensionsOperations +from .operations import VirtualMachineImagesOperations +from .operations import UsageOperations +from .operations import VirtualMachinesOperations +from .operations import VirtualMachineSizesOperations +from .operations import ImagesOperations +from .operations import VirtualMachineScaleSetsOperations +from .operations import VirtualMachineScaleSetExtensionsOperations +from .operations import VirtualMachineScaleSetRollingUpgradesOperations +from .operations import VirtualMachineScaleSetVMsOperations +from .operations import LogAnalyticsOperations +from .operations import VirtualMachineRunCommandsOperations +from .operations import GalleriesOperations +from .operations import GalleryImagesOperations +from .operations import GalleryImageVersionsOperations +from .operations import GalleryApplicationsOperations +from .operations import GalleryApplicationVersionsOperations +from .operations import DisksOperations +from .operations import SnapshotsOperations from .. import models @@ -48,55 +48,55 @@ class ComputeManagementClient(object): """Compute Client. :ivar operations: Operations operations - :vartype operations: azure.mgmt.compute.v2019_03_01.aio.operations_async.Operations + :vartype operations: azure.mgmt.compute.v2019_03_01.aio.operations.Operations :ivar availability_sets: AvailabilitySetsOperations operations - :vartype availability_sets: azure.mgmt.compute.v2019_03_01.aio.operations_async.AvailabilitySetsOperations + :vartype availability_sets: azure.mgmt.compute.v2019_03_01.aio.operations.AvailabilitySetsOperations :ivar proximity_placement_groups: ProximityPlacementGroupsOperations operations - :vartype proximity_placement_groups: azure.mgmt.compute.v2019_03_01.aio.operations_async.ProximityPlacementGroupsOperations + :vartype proximity_placement_groups: azure.mgmt.compute.v2019_03_01.aio.operations.ProximityPlacementGroupsOperations :ivar dedicated_host_groups: DedicatedHostGroupsOperations operations - :vartype dedicated_host_groups: azure.mgmt.compute.v2019_03_01.aio.operations_async.DedicatedHostGroupsOperations + :vartype dedicated_host_groups: azure.mgmt.compute.v2019_03_01.aio.operations.DedicatedHostGroupsOperations :ivar dedicated_hosts: DedicatedHostsOperations operations - :vartype dedicated_hosts: azure.mgmt.compute.v2019_03_01.aio.operations_async.DedicatedHostsOperations + :vartype dedicated_hosts: azure.mgmt.compute.v2019_03_01.aio.operations.DedicatedHostsOperations :ivar virtual_machine_extension_images: VirtualMachineExtensionImagesOperations operations - :vartype virtual_machine_extension_images: azure.mgmt.compute.v2019_03_01.aio.operations_async.VirtualMachineExtensionImagesOperations + :vartype virtual_machine_extension_images: azure.mgmt.compute.v2019_03_01.aio.operations.VirtualMachineExtensionImagesOperations :ivar virtual_machine_extensions: VirtualMachineExtensionsOperations operations - :vartype virtual_machine_extensions: azure.mgmt.compute.v2019_03_01.aio.operations_async.VirtualMachineExtensionsOperations + :vartype virtual_machine_extensions: azure.mgmt.compute.v2019_03_01.aio.operations.VirtualMachineExtensionsOperations :ivar virtual_machine_images: VirtualMachineImagesOperations operations - :vartype virtual_machine_images: azure.mgmt.compute.v2019_03_01.aio.operations_async.VirtualMachineImagesOperations + :vartype virtual_machine_images: azure.mgmt.compute.v2019_03_01.aio.operations.VirtualMachineImagesOperations :ivar usage: UsageOperations operations - :vartype usage: azure.mgmt.compute.v2019_03_01.aio.operations_async.UsageOperations + :vartype usage: azure.mgmt.compute.v2019_03_01.aio.operations.UsageOperations :ivar virtual_machines: VirtualMachinesOperations operations - :vartype virtual_machines: azure.mgmt.compute.v2019_03_01.aio.operations_async.VirtualMachinesOperations + :vartype virtual_machines: azure.mgmt.compute.v2019_03_01.aio.operations.VirtualMachinesOperations :ivar virtual_machine_sizes: VirtualMachineSizesOperations operations - :vartype virtual_machine_sizes: azure.mgmt.compute.v2019_03_01.aio.operations_async.VirtualMachineSizesOperations + :vartype virtual_machine_sizes: azure.mgmt.compute.v2019_03_01.aio.operations.VirtualMachineSizesOperations :ivar images: ImagesOperations operations - :vartype images: azure.mgmt.compute.v2019_03_01.aio.operations_async.ImagesOperations + :vartype images: azure.mgmt.compute.v2019_03_01.aio.operations.ImagesOperations :ivar virtual_machine_scale_sets: VirtualMachineScaleSetsOperations operations - :vartype virtual_machine_scale_sets: azure.mgmt.compute.v2019_03_01.aio.operations_async.VirtualMachineScaleSetsOperations + :vartype virtual_machine_scale_sets: azure.mgmt.compute.v2019_03_01.aio.operations.VirtualMachineScaleSetsOperations :ivar virtual_machine_scale_set_extensions: VirtualMachineScaleSetExtensionsOperations operations - :vartype virtual_machine_scale_set_extensions: azure.mgmt.compute.v2019_03_01.aio.operations_async.VirtualMachineScaleSetExtensionsOperations + :vartype virtual_machine_scale_set_extensions: azure.mgmt.compute.v2019_03_01.aio.operations.VirtualMachineScaleSetExtensionsOperations :ivar virtual_machine_scale_set_rolling_upgrades: VirtualMachineScaleSetRollingUpgradesOperations operations - :vartype virtual_machine_scale_set_rolling_upgrades: azure.mgmt.compute.v2019_03_01.aio.operations_async.VirtualMachineScaleSetRollingUpgradesOperations + :vartype virtual_machine_scale_set_rolling_upgrades: azure.mgmt.compute.v2019_03_01.aio.operations.VirtualMachineScaleSetRollingUpgradesOperations :ivar virtual_machine_scale_set_vms: VirtualMachineScaleSetVMsOperations operations - :vartype virtual_machine_scale_set_vms: azure.mgmt.compute.v2019_03_01.aio.operations_async.VirtualMachineScaleSetVMsOperations + :vartype virtual_machine_scale_set_vms: azure.mgmt.compute.v2019_03_01.aio.operations.VirtualMachineScaleSetVMsOperations :ivar log_analytics: LogAnalyticsOperations operations - :vartype log_analytics: azure.mgmt.compute.v2019_03_01.aio.operations_async.LogAnalyticsOperations + :vartype log_analytics: azure.mgmt.compute.v2019_03_01.aio.operations.LogAnalyticsOperations :ivar virtual_machine_run_commands: VirtualMachineRunCommandsOperations operations - :vartype virtual_machine_run_commands: azure.mgmt.compute.v2019_03_01.aio.operations_async.VirtualMachineRunCommandsOperations + :vartype virtual_machine_run_commands: azure.mgmt.compute.v2019_03_01.aio.operations.VirtualMachineRunCommandsOperations :ivar galleries: GalleriesOperations operations - :vartype galleries: azure.mgmt.compute.v2019_03_01.aio.operations_async.GalleriesOperations + :vartype galleries: azure.mgmt.compute.v2019_03_01.aio.operations.GalleriesOperations :ivar gallery_images: GalleryImagesOperations operations - :vartype gallery_images: azure.mgmt.compute.v2019_03_01.aio.operations_async.GalleryImagesOperations + :vartype gallery_images: azure.mgmt.compute.v2019_03_01.aio.operations.GalleryImagesOperations :ivar gallery_image_versions: GalleryImageVersionsOperations operations - :vartype gallery_image_versions: azure.mgmt.compute.v2019_03_01.aio.operations_async.GalleryImageVersionsOperations + :vartype gallery_image_versions: azure.mgmt.compute.v2019_03_01.aio.operations.GalleryImageVersionsOperations :ivar gallery_applications: GalleryApplicationsOperations operations - :vartype gallery_applications: azure.mgmt.compute.v2019_03_01.aio.operations_async.GalleryApplicationsOperations + :vartype gallery_applications: azure.mgmt.compute.v2019_03_01.aio.operations.GalleryApplicationsOperations :ivar gallery_application_versions: GalleryApplicationVersionsOperations operations - :vartype gallery_application_versions: azure.mgmt.compute.v2019_03_01.aio.operations_async.GalleryApplicationVersionsOperations + :vartype gallery_application_versions: azure.mgmt.compute.v2019_03_01.aio.operations.GalleryApplicationVersionsOperations :ivar disks: DisksOperations operations - :vartype disks: azure.mgmt.compute.v2019_03_01.aio.operations_async.DisksOperations + :vartype disks: azure.mgmt.compute.v2019_03_01.aio.operations.DisksOperations :ivar snapshots: SnapshotsOperations operations - :vartype snapshots: azure.mgmt.compute.v2019_03_01.aio.operations_async.SnapshotsOperations + :vartype snapshots: azure.mgmt.compute.v2019_03_01.aio.operations.SnapshotsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. @@ -119,6 +119,7 @@ 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/aio/_configuration_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/_configuration.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/_configuration_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/_configuration.py index 062dc387245e..001d17e68aa0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/_configuration_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -44,8 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2019-03-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-compute/{}'.format(VERSION)) self._configure(**kwargs) @@ -57,6 +57,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/__init__.py new file mode 100644 index 000000000000..5d6e85ad6071 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/__init__.py @@ -0,0 +1,61 @@ +# 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 ._operations import Operations +from ._availability_sets_operations import AvailabilitySetsOperations +from ._proximity_placement_groups_operations import ProximityPlacementGroupsOperations +from ._dedicated_host_groups_operations import DedicatedHostGroupsOperations +from ._dedicated_hosts_operations import DedicatedHostsOperations +from ._virtual_machine_extension_images_operations import VirtualMachineExtensionImagesOperations +from ._virtual_machine_extensions_operations import VirtualMachineExtensionsOperations +from ._virtual_machine_images_operations import VirtualMachineImagesOperations +from ._usage_operations import UsageOperations +from ._virtual_machines_operations import VirtualMachinesOperations +from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations +from ._images_operations import ImagesOperations +from ._virtual_machine_scale_sets_operations import VirtualMachineScaleSetsOperations +from ._virtual_machine_scale_set_extensions_operations import VirtualMachineScaleSetExtensionsOperations +from ._virtual_machine_scale_set_rolling_upgrades_operations import VirtualMachineScaleSetRollingUpgradesOperations +from ._virtual_machine_scale_set_vms_operations import VirtualMachineScaleSetVMsOperations +from ._log_analytics_operations import LogAnalyticsOperations +from ._virtual_machine_run_commands_operations import VirtualMachineRunCommandsOperations +from ._galleries_operations import GalleriesOperations +from ._gallery_images_operations import GalleryImagesOperations +from ._gallery_image_versions_operations import GalleryImageVersionsOperations +from ._gallery_applications_operations import GalleryApplicationsOperations +from ._gallery_application_versions_operations import GalleryApplicationVersionsOperations +from ._disks_operations import DisksOperations +from ._snapshots_operations import SnapshotsOperations + +__all__ = [ + 'Operations', + 'AvailabilitySetsOperations', + 'ProximityPlacementGroupsOperations', + 'DedicatedHostGroupsOperations', + 'DedicatedHostsOperations', + 'VirtualMachineExtensionImagesOperations', + 'VirtualMachineExtensionsOperations', + 'VirtualMachineImagesOperations', + 'UsageOperations', + 'VirtualMachinesOperations', + 'VirtualMachineSizesOperations', + 'ImagesOperations', + 'VirtualMachineScaleSetsOperations', + 'VirtualMachineScaleSetExtensionsOperations', + 'VirtualMachineScaleSetRollingUpgradesOperations', + 'VirtualMachineScaleSetVMsOperations', + 'LogAnalyticsOperations', + 'VirtualMachineRunCommandsOperations', + 'GalleriesOperations', + 'GalleryImagesOperations', + 'GalleryImageVersionsOperations', + 'GalleryApplicationsOperations', + 'GalleryApplicationVersionsOperations', + 'DisksOperations', + 'SnapshotsOperations', +] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_availability_sets_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_availability_sets_operations.py similarity index 90% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_availability_sets_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_availability_sets_operations.py index f13bea5d48b6..4e3cc51488c4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_availability_sets_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_availability_sets_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -62,10 +62,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -83,14 +86,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailabilitySet') 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 @@ -127,10 +128,13 @@ async def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -148,14 +152,12 @@ async def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailabilitySetUpdate') 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 @@ -189,7 +191,9 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -209,7 +213,6 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -241,9 +244,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -260,9 +266,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -286,7 +291,8 @@ def list_by_subscription( ) -> AsyncIterable["models.AvailabilitySetListResult"]: """Lists all availability sets in a subscription. - :param expand: The expand expression to apply to the operation. + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AvailabilitySetListResult or the result of cls(response) @@ -294,11 +300,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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_subscription.metadata['url'] # type: ignore @@ -312,15 +325,11 @@ def prepare_request(next_link=None): if expand is not None: query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -362,11 +371,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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 @@ -379,15 +395,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -421,7 +433,7 @@ def list_available_sizes( **kwargs ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes that can be used to create a new virtual machine in - an existing availability set. + an existing availability set. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -433,11 +445,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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_available_sizes.metadata['url'] # type: ignore @@ -451,15 +470,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_dedicated_host_groups_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_dedicated_host_groups_operations.py similarity index 90% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_dedicated_host_groups_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_dedicated_host_groups_operations.py index 70a5122d0605..bd4fa5965bb5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_dedicated_host_groups_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_dedicated_host_groups_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -64,10 +64,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -85,14 +88,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DedicatedHostGroup') 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 @@ -100,7 +101,6 @@ async def create_or_update( 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('DedicatedHostGroup', pipeline_response) @@ -134,10 +134,13 @@ async def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -155,14 +158,12 @@ async def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DedicatedHostGroupUpdate') 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 @@ -196,7 +197,9 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -216,7 +219,6 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -248,9 +250,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -267,9 +272,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -292,7 +296,7 @@ def list_by_resource_group( **kwargs ) -> AsyncIterable["models.DedicatedHostGroupListResult"]: """Lists all of the dedicated host groups in the specified resource group. Use the nextLink - property in the response to get the next page of dedicated host groups. + property in the response to get the next page of dedicated host groups. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -302,11 +306,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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 @@ -319,15 +330,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -359,7 +366,7 @@ def list_by_subscription( **kwargs ) -> AsyncIterable["models.DedicatedHostGroupListResult"]: """Lists all of the dedicated host groups in the subscription. Use the nextLink property in the - response to get the next page of dedicated host groups. + response to get the next page of dedicated host groups. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DedicatedHostGroupListResult or the result of cls(response) @@ -367,11 +374,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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_subscription.metadata['url'] # type: ignore @@ -383,15 +397,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_dedicated_hosts_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_dedicated_hosts_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_dedicated_hosts_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_dedicated_hosts_operations.py index ffc6cec1e7d4..b71cbdf0986f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_dedicated_hosts_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_dedicated_hosts_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,10 +52,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.DedicatedHost": cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -74,14 +77,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DedicatedHost') 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 @@ -89,7 +90,6 @@ async def _create_or_update_initial( 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('DedicatedHost', pipeline_response) @@ -109,7 +109,7 @@ async def begin_create_or_update( host_name: str, parameters: "models.DedicatedHost", **kwargs - ) -> "models.DedicatedHost": + ) -> AsyncLROPoller["models.DedicatedHost"]: """Create or update a dedicated host . :param resource_group_name: The name of the resource group. @@ -126,8 +126,8 @@ async def begin_create_or_update( 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: DedicatedHost, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_03_01.models.DedicatedHost + :return: An instance of AsyncLROPoller that returns either DedicatedHost or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_03_01.models.DedicatedHost] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -180,10 +180,13 @@ async def _update_initial( **kwargs ) -> "models.DedicatedHost": cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -202,14 +205,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DedicatedHostUpdate') 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 @@ -232,7 +233,7 @@ async def begin_update( host_name: str, parameters: "models.DedicatedHostUpdate", **kwargs - ) -> "models.DedicatedHost": + ) -> AsyncLROPoller["models.DedicatedHost"]: """Update an dedicated host . :param resource_group_name: The name of the resource group. @@ -249,8 +250,8 @@ async def begin_update( 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: DedicatedHost, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_03_01.models.DedicatedHost + :return: An instance of AsyncLROPoller that returns either DedicatedHost or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_03_01.models.DedicatedHost] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -302,7 +303,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -323,7 +326,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -343,7 +345,7 @@ async def begin_delete( host_group_name: str, host_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Delete a dedicated host. :param resource_group_name: The name of the resource group. @@ -358,8 +360,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -423,9 +425,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -445,9 +450,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -471,7 +475,7 @@ def list_by_host_group( **kwargs ) -> AsyncIterable["models.DedicatedHostListResult"]: """Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink - property in the response to get the next page of dedicated hosts. + property in the response to get the next page of dedicated hosts. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -483,11 +487,18 @@ def list_by_host_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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_host_group.metadata['url'] # type: ignore @@ -501,15 +512,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_disks_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_disks_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_disks_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_disks_operations.py index b4e8798c1323..60fcbdf65dc4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_disks_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_disks_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.Disk": cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('Disk', pipeline_response) @@ -106,14 +106,14 @@ async def begin_create_or_update( disk_name: str, disk: "models.Disk", **kwargs - ) -> "models.Disk": + ) -> 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. + 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.v2019_03_01.models.Disk @@ -123,8 +123,8 @@ async def begin_create_or_update( 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: Disk, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_03_01.models.Disk + :return: An instance of AsyncLROPoller that returns either Disk or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_03_01.models.Disk] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -175,10 +175,13 @@ async def _update_initial( **kwargs ) -> "models.Disk": cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -196,14 +199,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -211,7 +212,6 @@ async def _update_initial( 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('Disk', pipeline_response) @@ -230,14 +230,14 @@ async def begin_update( disk_name: str, disk: "models.DiskUpdate", **kwargs - ) -> "models.Disk": + ) -> 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. + 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.v2019_03_01.models.DiskUpdate @@ -247,8 +247,8 @@ async def begin_update( 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: Disk, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_03_01.models.Disk + :return: An instance of AsyncLROPoller that returns either Disk or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_03_01.models.Disk] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -311,9 +311,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -330,9 +333,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -356,7 +358,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -376,7 +380,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -395,14 +398,14 @@ async def begin_delete( resource_group_name: str, disk_name: str, **kwargs - ) -> None: + ) -> 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. + 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. @@ -410,8 +413,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -465,11 +468,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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 @@ -482,15 +492,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -529,11 +535,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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 @@ -545,15 +558,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -586,12 +595,15 @@ async def _grant_access_initial( disk_name: str, grant_access_data: "models.GrantAccessData", **kwargs - ) -> "models.AccessUri": - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> 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 = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._grant_access_initial.metadata['url'] # type: ignore @@ -609,14 +621,12 @@ async def _grant_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -640,17 +650,17 @@ async def begin_grant_access( disk_name: str, grant_access_data: "models.GrantAccessData", **kwargs - ) -> "models.AccessUri": + ) -> 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. + 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. + operation. :type grant_access_data: ~azure.mgmt.compute.v2019_03_01.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. @@ -658,8 +668,8 @@ async def begin_grant_access( 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: AccessUri, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_03_01.models.AccessUri + :return: An instance of AsyncLROPoller that returns either AccessUri or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_03_01.models.AccessUri] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -709,7 +719,9 @@ async def _revoke_access_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -729,7 +741,6 @@ async def _revoke_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -748,14 +759,14 @@ async def begin_revoke_access( resource_group_name: str, disk_name: str, **kwargs - ) -> None: + ) -> 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. + 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. @@ -763,8 +774,8 @@ async def begin_revoke_access( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_galleries_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_galleries_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_galleries_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_galleries_operations.py index 314556e01719..5f874ce6bd3b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_galleries_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_galleries_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.Gallery": cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery, 'Gallery') 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('Gallery', pipeline_response) @@ -109,13 +109,13 @@ async def begin_create_or_update( gallery_name: str, gallery: "models.Gallery", **kwargs - ) -> "models.Gallery": + ) -> AsyncLROPoller["models.Gallery"]: """Create or update a Shared Image Gallery. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery. The allowed characters are alphabets - and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. + and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. :type gallery_name: str :param gallery: Parameters supplied to the create or update Shared Image Gallery operation. :type gallery: ~azure.mgmt.compute.v2019_03_01.models.Gallery @@ -125,8 +125,8 @@ async def begin_create_or_update( 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: Gallery, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_03_01.models.Gallery + :return: An instance of AsyncLROPoller that returns either Gallery or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_03_01.models.Gallery] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -187,9 +187,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -206,9 +209,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -232,9 +234,12 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -251,8 +256,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -271,7 +276,7 @@ async def begin_delete( resource_group_name: str, gallery_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Delete a Shared Image Gallery. :param resource_group_name: The name of the resource group. @@ -284,8 +289,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -339,11 +344,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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 @@ -356,15 +368,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -403,11 +411,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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 @@ -419,15 +434,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_gallery_application_versions_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_application_versions_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_gallery_application_versions_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_application_versions_operations.py index 91274781222b..92ac5c3933a8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_gallery_application_versions_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_application_versions_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -53,10 +53,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.GalleryApplicationVersion": cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -76,14 +79,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_application_version, 'GalleryApplicationVersion') 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 @@ -91,7 +92,6 @@ async def _create_or_update_initial( 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('GalleryApplicationVersion', pipeline_response) @@ -115,24 +115,24 @@ async def begin_create_or_update( gallery_application_version_name: str, gallery_application_version: "models.GalleryApplicationVersion", **kwargs - ) -> "models.GalleryApplicationVersion": + ) -> AsyncLROPoller["models.GalleryApplicationVersion"]: """Create or update a gallery Application Version. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. + Definition resides. :type gallery_name: str :param gallery_application_name: The name of the gallery Application Definition in which the - Application Version is to be created. + Application Version is to be created. :type gallery_application_name: str :param gallery_application_version_name: The name of the gallery Application Version to be - created. Needs to follow semantic version name pattern: The allowed characters are digit and - period. Digits must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. + created. Needs to follow semantic version name pattern: The allowed characters are digit and + period. Digits must be within the range of a 32-bit integer. Format: + :code:``.:code:``.:code:``. :type gallery_application_version_name: str :param gallery_application_version: Parameters supplied to the create or update gallery - Application Version operation. + Application Version operation. :type gallery_application_version: ~azure.mgmt.compute.v2019_03_01.models.GalleryApplicationVersion :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. @@ -140,8 +140,8 @@ async def begin_create_or_update( 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: GalleryApplicationVersion, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_03_01.models.GalleryApplicationVersion + :return: An instance of AsyncLROPoller that returns either GalleryApplicationVersion or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_03_01.models.GalleryApplicationVersion] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -192,7 +192,7 @@ async def get( gallery_name: str, gallery_application_name: str, gallery_application_version_name: str, - expand: Optional[str] = "ReplicationStatus", + expand: Optional[Union[str, "models.ReplicationStatusTypes"]] = None, **kwargs ) -> "models.GalleryApplicationVersion": """Retrieves information about a gallery Application Version. @@ -209,16 +209,19 @@ async def get( retrieved. :type gallery_application_version_name: str :param expand: The expand expression to apply on the operation. - :type expand: str + :type expand: str or ~azure.mgmt.compute.v2019_03_01.models.ReplicationStatusTypes :keyword callable cls: A custom type or function that will be passed the direct response :return: GalleryApplicationVersion, or the result of cls(response) :rtype: ~azure.mgmt.compute.v2019_03_01.models.GalleryApplicationVersion :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -239,9 +242,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -267,9 +269,12 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -288,8 +293,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -310,19 +315,19 @@ async def begin_delete( gallery_application_name: str, gallery_application_version_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Delete a gallery Application Version. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. + Definition resides. :type gallery_name: str :param gallery_application_name: The name of the gallery Application Definition in which the - Application Version resides. + Application Version resides. :type gallery_application_name: str :param gallery_application_version_name: The name of the gallery Application Version to be - deleted. + deleted. :type gallery_application_version_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. @@ -330,8 +335,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -384,10 +389,10 @@ def list_by_gallery_application( :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. + Definition resides. :type gallery_name: str :param gallery_application_name: The name of the Shared Application Gallery Application - Definition from which the Application Versions are to be listed. + Definition from which the Application Versions are to be listed. :type gallery_application_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GalleryApplicationVersionList or the result of cls(response) @@ -395,11 +400,18 @@ def list_by_gallery_application( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersionList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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_gallery_application.metadata['url'] # type: ignore @@ -414,15 +426,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_gallery_applications_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_applications_operations.py similarity index 90% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_gallery_applications_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_applications_operations.py index 3ba5600732f3..78e5136800ca 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_gallery_applications_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_applications_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,10 +52,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.GalleryApplication": cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -74,14 +77,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_application, 'GalleryApplication') 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 @@ -89,7 +90,6 @@ async def _create_or_update_initial( 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('GalleryApplication', pipeline_response) @@ -112,20 +112,20 @@ async def begin_create_or_update( gallery_application_name: str, gallery_application: "models.GalleryApplication", **kwargs - ) -> "models.GalleryApplication": + ) -> AsyncLROPoller["models.GalleryApplication"]: """Create or update a gallery Application Definition. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition is to be created. + Definition is to be created. :type gallery_name: str :param gallery_application_name: The name of the gallery Application Definition to be created - or updated. The allowed characters are alphabets and numbers with dots, dashes, and periods - allowed in the middle. The maximum length is 80 characters. + or updated. The allowed characters are alphabets and numbers with dots, dashes, and periods + allowed in the middle. The maximum length is 80 characters. :type gallery_application_name: str :param gallery_application: Parameters supplied to the create or update gallery Application - operation. + operation. :type gallery_application: ~azure.mgmt.compute.v2019_03_01.models.GalleryApplication :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. @@ -133,8 +133,8 @@ async def begin_create_or_update( 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: GalleryApplication, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_03_01.models.GalleryApplication + :return: An instance of AsyncLROPoller that returns either GalleryApplication or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_03_01.models.GalleryApplication] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -201,9 +201,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -221,9 +224,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -248,9 +250,12 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -268,8 +273,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -289,13 +294,13 @@ async def begin_delete( gallery_name: str, gallery_application_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Delete a gallery Application. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition is to be deleted. + Definition is to be deleted. :type gallery_name: str :param gallery_application_name: The name of the gallery Application Definition to be deleted. :type gallery_application_name: str @@ -305,8 +310,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -357,7 +362,7 @@ def list_by_gallery( :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery from which Application - Definitions are to be listed. + Definitions are to be listed. :type gallery_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GalleryApplicationList or the result of cls(response) @@ -365,11 +370,18 @@ def list_by_gallery( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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_gallery.metadata['url'] # type: ignore @@ -383,15 +395,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_gallery_image_versions_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_image_versions_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_gallery_image_versions_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_image_versions_operations.py index 0942113b2c99..d7a4df3d570d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_gallery_image_versions_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_image_versions_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -53,10 +53,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.GalleryImageVersion": cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -76,14 +79,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_image_version, 'GalleryImageVersion') 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 @@ -91,7 +92,6 @@ async def _create_or_update_initial( 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('GalleryImageVersion', pipeline_response) @@ -115,24 +115,24 @@ async def begin_create_or_update( gallery_image_version_name: str, gallery_image_version: "models.GalleryImageVersion", **kwargs - ) -> "models.GalleryImageVersion": + ) -> AsyncLROPoller["models.GalleryImageVersion"]: """Create or update a gallery Image Version. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. + resides. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition in which the Image Version - is to be created. + is to be created. :type gallery_image_name: str :param gallery_image_version_name: The name of the gallery Image Version to be created. Needs - to follow semantic version name pattern: The allowed characters are digit and period. Digits - must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. + to follow semantic version name pattern: The allowed characters are digit and period. Digits + must be within the range of a 32-bit integer. Format: + :code:``.:code:``.:code:``. :type gallery_image_version_name: str :param gallery_image_version: Parameters supplied to the create or update gallery Image Version - operation. + operation. :type gallery_image_version: ~azure.mgmt.compute.v2019_03_01.models.GalleryImageVersion :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. @@ -140,8 +140,8 @@ async def begin_create_or_update( 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: GalleryImageVersion, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_03_01.models.GalleryImageVersion + :return: An instance of AsyncLROPoller that returns either GalleryImageVersion or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_03_01.models.GalleryImageVersion] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -192,7 +192,7 @@ async def get( gallery_name: str, gallery_image_name: str, gallery_image_version_name: str, - expand: Optional[str] = "ReplicationStatus", + expand: Optional[Union[str, "models.ReplicationStatusTypes"]] = None, **kwargs ) -> "models.GalleryImageVersion": """Retrieves information about a gallery Image Version. @@ -208,16 +208,19 @@ async def get( :param gallery_image_version_name: The name of the gallery Image Version to be retrieved. :type gallery_image_version_name: str :param expand: The expand expression to apply on the operation. - :type expand: str + :type expand: str or ~azure.mgmt.compute.v2019_03_01.models.ReplicationStatusTypes :keyword callable cls: A custom type or function that will be passed the direct response :return: GalleryImageVersion, or the result of cls(response) :rtype: ~azure.mgmt.compute.v2019_03_01.models.GalleryImageVersion :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -238,9 +241,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -266,9 +268,12 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -287,8 +292,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -309,16 +314,16 @@ async def begin_delete( gallery_image_name: str, gallery_image_version_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Delete a gallery Image Version. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. + resides. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition in which the Image Version - resides. + resides. :type gallery_image_name: str :param gallery_image_version_name: The name of the gallery Image Version to be deleted. :type gallery_image_version_name: str @@ -328,8 +333,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -382,10 +387,10 @@ def list_by_gallery_image( :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. + resides. :type gallery_name: str :param gallery_image_name: The name of the Shared Image Gallery Image Definition from which the - Image Versions are to be listed. + Image Versions are to be listed. :type gallery_image_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GalleryImageVersionList or the result of cls(response) @@ -393,11 +398,18 @@ def list_by_gallery_image( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersionList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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_gallery_image.metadata['url'] # type: ignore @@ -412,15 +424,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_gallery_images_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_images_operations.py similarity index 90% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_gallery_images_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_images_operations.py index 802847214ab5..c0c124b27729 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_gallery_images_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_images_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,10 +52,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.GalleryImage": cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -74,14 +77,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_image, 'GalleryImage') 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 @@ -89,7 +90,6 @@ async def _create_or_update_initial( 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('GalleryImage', pipeline_response) @@ -112,17 +112,17 @@ async def begin_create_or_update( gallery_image_name: str, gallery_image: "models.GalleryImage", **kwargs - ) -> "models.GalleryImage": + ) -> AsyncLROPoller["models.GalleryImage"]: """Create or update a gallery Image Definition. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to - be created. + be created. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition to be created or updated. - The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the - middle. The maximum length is 80 characters. + The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the + middle. The maximum length is 80 characters. :type gallery_image_name: str :param gallery_image: Parameters supplied to the create or update gallery image operation. :type gallery_image: ~azure.mgmt.compute.v2019_03_01.models.GalleryImage @@ -132,8 +132,8 @@ async def begin_create_or_update( 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: GalleryImage, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_03_01.models.GalleryImage + :return: An instance of AsyncLROPoller that returns either GalleryImage or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_03_01.models.GalleryImage] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -199,9 +199,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -219,9 +222,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -246,9 +248,12 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -266,8 +271,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -287,13 +292,13 @@ async def begin_delete( gallery_name: str, gallery_image_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Delete a gallery image. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to - be deleted. + be deleted. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition to be deleted. :type gallery_image_name: str @@ -303,8 +308,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -355,7 +360,7 @@ def list_by_gallery( :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery from which Image Definitions are to - be listed. + be listed. :type gallery_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GalleryImageList or the result of cls(response) @@ -363,11 +368,18 @@ def list_by_gallery( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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_gallery.metadata['url'] # type: ignore @@ -381,15 +393,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_images_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_images_operations.py similarity index 90% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_images_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_images_operations.py index 7b433dbaa564..fb1f1a855449 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_images_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_images_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.Image": cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'Image') 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('Image', pipeline_response) @@ -106,7 +106,7 @@ async def begin_create_or_update( image_name: str, parameters: "models.Image", **kwargs - ) -> "models.Image": + ) -> AsyncLROPoller["models.Image"]: """Create or update an image. :param resource_group_name: The name of the resource group. @@ -121,8 +121,8 @@ async def begin_create_or_update( 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: Image, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_03_01.models.Image + :return: An instance of AsyncLROPoller that returns either Image or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_03_01.models.Image] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -173,10 +173,13 @@ async def _update_initial( **kwargs ) -> "models.Image": cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -194,14 +197,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ImageUpdate') 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 @@ -209,7 +210,6 @@ async def _update_initial( 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('Image', pipeline_response) @@ -228,7 +228,7 @@ async def begin_update( image_name: str, parameters: "models.ImageUpdate", **kwargs - ) -> "models.Image": + ) -> AsyncLROPoller["models.Image"]: """Update an image. :param resource_group_name: The name of the resource group. @@ -243,8 +243,8 @@ async def begin_update( 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: Image, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_03_01.models.Image + :return: An instance of AsyncLROPoller that returns either Image or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_03_01.models.Image] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -294,7 +294,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -314,7 +316,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -333,7 +334,7 @@ async def begin_delete( resource_group_name: str, image_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes an Image. :param resource_group_name: The name of the resource group. @@ -346,8 +347,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -407,9 +408,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -428,9 +432,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -462,11 +465,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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 @@ -479,15 +489,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -519,7 +525,7 @@ def list( **kwargs ) -> AsyncIterable["models.ImageListResult"]: """Gets the list of Images in the subscription. Use nextLink property in the response to get the - next page of Images. Do this till nextLink is null to fetch all the Images. + next page of Images. Do this till nextLink is null to fetch all the Images. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ImageListResult or the result of cls(response) @@ -527,11 +533,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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 @@ -543,15 +556,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_log_analytics_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_log_analytics_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_log_analytics_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_log_analytics_operations.py index 0e51eec280e6..579ea451f06a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_log_analytics_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_log_analytics_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -47,12 +47,15 @@ async def _export_request_rate_by_interval_initial( location: str, parameters: "models.RequestRateByIntervalInput", **kwargs - ) -> "models.LogAnalyticsOperationResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.LogAnalyticsOperationResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._export_request_rate_by_interval_initial.metadata['url'] # type: ignore @@ -69,14 +72,12 @@ async def _export_request_rate_by_interval_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RequestRateByIntervalInput') 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 @@ -99,9 +100,9 @@ async def begin_export_request_rate_by_interval( location: str, parameters: "models.RequestRateByIntervalInput", **kwargs - ) -> "models.LogAnalyticsOperationResult": + ) -> AsyncLROPoller["models.LogAnalyticsOperationResult"]: """Export logs that show Api requests made by this subscription in the given time window to show - throttling activities. + throttling activities. :param location: The location upon which virtual-machine-sizes is queried. :type location: str @@ -113,8 +114,8 @@ async def begin_export_request_rate_by_interval( 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: LogAnalyticsOperationResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_03_01.models.LogAnalyticsOperationResult + :return: An instance of AsyncLROPoller that returns either LogAnalyticsOperationResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_03_01.models.LogAnalyticsOperationResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -161,12 +162,15 @@ async def _export_throttled_requests_initial( location: str, parameters: "models.LogAnalyticsInputBase", **kwargs - ) -> "models.LogAnalyticsOperationResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.LogAnalyticsOperationResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._export_throttled_requests_initial.metadata['url'] # type: ignore @@ -183,14 +187,12 @@ async def _export_throttled_requests_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LogAnalyticsInputBase') 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 @@ -213,9 +215,9 @@ async def begin_export_throttled_requests( location: str, parameters: "models.LogAnalyticsInputBase", **kwargs - ) -> "models.LogAnalyticsOperationResult": + ) -> AsyncLROPoller["models.LogAnalyticsOperationResult"]: """Export logs that show total throttled Api requests for this subscription in the given time - window. + window. :param location: The location upon which virtual-machine-sizes is queried. :type location: str @@ -227,8 +229,8 @@ async def begin_export_throttled_requests( 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: LogAnalyticsOperationResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_03_01.models.LogAnalyticsOperationResult + :return: An instance of AsyncLROPoller that returns either LogAnalyticsOperationResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_03_01.models.LogAnalyticsOperationResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_operations.py similarity index 87% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_operations.py index bcb89d0d9e00..46c9997c0a95 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -53,11 +53,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeOperationListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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 @@ -65,15 +72,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_proximity_placement_groups_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_proximity_placement_groups_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_proximity_placement_groups_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_proximity_placement_groups_operations.py index 731a424d3cf1..4bf92c35f3cd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_proximity_placement_groups_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_proximity_placement_groups_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -62,10 +62,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -83,14 +86,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ProximityPlacementGroup') 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 @@ -98,7 +99,6 @@ async def create_or_update( 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('ProximityPlacementGroup', pipeline_response) @@ -132,10 +132,13 @@ async def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -153,14 +156,12 @@ async def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'UpdateResource') 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 @@ -194,7 +195,9 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -214,7 +217,6 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -246,9 +248,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -265,9 +270,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -296,11 +300,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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_subscription.metadata['url'] # type: ignore @@ -312,15 +323,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -362,11 +369,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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 @@ -379,15 +393,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_snapshots_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_snapshots_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_snapshots_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_snapshots_operations.py index 4f66ae5a2f93..414729a2b958 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_snapshots_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_snapshots_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.Snapshot": cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('Snapshot', pipeline_response) @@ -106,14 +106,14 @@ async def begin_create_or_update( snapshot_name: str, snapshot: "models.Snapshot", **kwargs - ) -> "models.Snapshot": + ) -> 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. + 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.v2019_03_01.models.Snapshot @@ -123,8 +123,8 @@ async def begin_create_or_update( 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: Snapshot, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_03_01.models.Snapshot + :return: An instance of AsyncLROPoller that returns either Snapshot or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_03_01.models.Snapshot] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -175,10 +175,13 @@ async def _update_initial( **kwargs ) -> "models.Snapshot": cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -196,14 +199,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -211,7 +212,6 @@ async def _update_initial( 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('Snapshot', pipeline_response) @@ -230,14 +230,14 @@ async def begin_update( snapshot_name: str, snapshot: "models.SnapshotUpdate", **kwargs - ) -> "models.Snapshot": + ) -> 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. + 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.v2019_03_01.models.SnapshotUpdate @@ -247,8 +247,8 @@ async def begin_update( 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: Snapshot, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_03_01.models.Snapshot + :return: An instance of AsyncLROPoller that returns either Snapshot or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_03_01.models.Snapshot] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -311,9 +311,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -330,9 +333,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -356,7 +358,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -376,7 +380,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -395,14 +398,14 @@ async def begin_delete( resource_group_name: str, snapshot_name: str, **kwargs - ) -> None: + ) -> 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. + 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. @@ -410,8 +413,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -465,11 +468,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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 @@ -482,15 +492,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -529,11 +535,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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 @@ -545,15 +558,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -586,12 +595,15 @@ async def _grant_access_initial( snapshot_name: str, grant_access_data: "models.GrantAccessData", **kwargs - ) -> "models.AccessUri": - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> 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 = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._grant_access_initial.metadata['url'] # type: ignore @@ -609,14 +621,12 @@ async def _grant_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -640,17 +650,17 @@ async def begin_grant_access( snapshot_name: str, grant_access_data: "models.GrantAccessData", **kwargs - ) -> "models.AccessUri": + ) -> 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. + 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. + operation. :type grant_access_data: ~azure.mgmt.compute.v2019_03_01.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. @@ -658,8 +668,8 @@ async def begin_grant_access( 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: AccessUri, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_03_01.models.AccessUri + :return: An instance of AsyncLROPoller that returns either AccessUri or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_03_01.models.AccessUri] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -709,7 +719,9 @@ async def _revoke_access_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -729,7 +741,6 @@ async def _revoke_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -748,14 +759,14 @@ async def begin_revoke_access( resource_group_name: str, snapshot_name: str, **kwargs - ) -> None: + ) -> 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. + 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. @@ -763,8 +774,8 @@ async def begin_revoke_access( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_usage_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_usage_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_usage_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_usage_operations.py index 4498ce51c459..98fc3768a969 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_usage_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_usage_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -47,7 +47,7 @@ def list( **kwargs ) -> AsyncIterable["models.ListUsagesResult"]: """Gets, for the specified location, the current compute resource usage information as well as the - limits for compute resources under the subscription. + limits for compute resources under the subscription. :param location: The location for which resource usage is queried. :type location: str @@ -57,11 +57,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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 @@ -74,15 +81,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_virtual_machine_extension_images_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_extension_images_operations.py similarity index 92% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_virtual_machine_extension_images_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_extension_images_operations.py index 63376d01fb23..7b7f747ee111 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_virtual_machine_extension_images_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -64,9 +64,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -85,9 +88,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -122,9 +124,12 @@ async def list_types( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.list_types.metadata['url'] # type: ignore @@ -141,9 +146,8 @@ async def list_types( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -190,9 +194,12 @@ async def list_versions( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.list_versions.metadata['url'] # type: ignore @@ -216,9 +223,8 @@ async def list_versions( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_virtual_machine_extensions_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_extensions_operations.py similarity index 92% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_virtual_machine_extensions_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_extensions_operations.py index 55d40cd7441f..06362359247b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_virtual_machine_extensions_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_extensions_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachineExtension": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -73,14 +76,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtension') 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 @@ -88,7 +89,6 @@ async def _create_or_update_initial( 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('VirtualMachineExtension', pipeline_response) @@ -108,18 +108,18 @@ async def begin_create_or_update( vm_extension_name: str, extension_parameters: "models.VirtualMachineExtension", **kwargs - ) -> "models.VirtualMachineExtension": + ) -> AsyncLROPoller["models.VirtualMachineExtension"]: """The operation to create or update the extension. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_name: The name of the virtual machine where the extension should be created or - updated. + updated. :type vm_name: str :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Create Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineExtension :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. @@ -127,8 +127,8 @@ async def begin_create_or_update( 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: VirtualMachineExtension, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineExtension + :return: An instance of AsyncLROPoller that returns either VirtualMachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -181,10 +181,13 @@ async def _update_initial( **kwargs ) -> "models.VirtualMachineExtension": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -203,14 +206,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtensionUpdate') 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 @@ -233,7 +234,7 @@ async def begin_update( vm_extension_name: str, extension_parameters: "models.VirtualMachineExtensionUpdate", **kwargs - ) -> "models.VirtualMachineExtension": + ) -> AsyncLROPoller["models.VirtualMachineExtension"]: """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -243,7 +244,7 @@ async def begin_update( :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Update Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineExtensionUpdate :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. @@ -251,8 +252,8 @@ async def begin_update( 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: VirtualMachineExtension, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineExtension + :return: An instance of AsyncLROPoller that returns either VirtualMachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -304,7 +305,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -325,7 +328,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -345,7 +347,7 @@ async def begin_delete( vm_name: str, vm_extension_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -360,8 +362,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -425,9 +427,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -447,9 +452,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -487,9 +491,12 @@ async def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -508,9 +515,8 @@ async def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_virtual_machine_images_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_images_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_virtual_machine_images_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_images_operations.py index 3e5933c1187b..9304f8880991 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_virtual_machine_images_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_images_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -67,9 +67,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -89,9 +92,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -142,9 +144,12 @@ async def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -169,9 +174,8 @@ async def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -206,9 +210,12 @@ async def list_offers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.list_offers.metadata['url'] # type: ignore @@ -225,9 +232,8 @@ async def list_offers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -259,9 +265,12 @@ async def list_publishers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.list_publishers.metadata['url'] # type: ignore @@ -277,9 +286,8 @@ async def list_publishers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -317,9 +325,12 @@ async def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.list_skus.metadata['url'] # type: ignore @@ -337,9 +348,8 @@ async def list_skus( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_virtual_machine_run_commands_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_run_commands_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_virtual_machine_run_commands_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_run_commands_operations.py index 52e4884687f3..396e88e877dc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_virtual_machine_run_commands_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,11 +56,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json, text/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 @@ -73,15 +80,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -126,9 +129,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandDocument"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json, text/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -145,9 +151,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_virtual_machine_scale_set_extensions_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_virtual_machine_scale_set_extensions_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index ea43ea49af9d..e5a0faf8dac7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_virtual_machine_scale_set_extensions_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,10 +52,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachineScaleSetExtension": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -74,14 +77,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineScaleSetExtension') 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 @@ -89,7 +90,6 @@ async def _create_or_update_initial( 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('VirtualMachineScaleSetExtension', pipeline_response) @@ -109,18 +109,18 @@ async def begin_create_or_update( vmss_extension_name: str, extension_parameters: "models.VirtualMachineScaleSetExtension", **kwargs - ) -> "models.VirtualMachineScaleSetExtension": + ) -> AsyncLROPoller["models.VirtualMachineScaleSetExtension"]: """The operation to create or update an extension. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_scale_set_name: The name of the VM scale set where the extension should be create or - updated. + updated. :type vm_scale_set_name: str :param vmss_extension_name: The name of the VM scale set extension. :type vmss_extension_name: str :param extension_parameters: Parameters supplied to the Create VM scale set Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSetExtension :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. @@ -128,8 +128,8 @@ async def begin_create_or_update( 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: VirtualMachineScaleSetExtension, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSetExtension + :return: An instance of AsyncLROPoller that returns either VirtualMachineScaleSetExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSetExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -181,7 +181,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -202,7 +204,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -222,7 +223,7 @@ async def begin_delete( vm_scale_set_name: str, vmss_extension_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -237,8 +238,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -302,9 +303,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -324,9 +328,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -361,11 +364,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtensionListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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 @@ -379,15 +389,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_virtual_machine_scale_set_rolling_upgrades_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_virtual_machine_scale_set_rolling_upgrades_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 2ca49e876500..662efe15bc4d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_virtual_machine_scale_set_rolling_upgrades_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -49,7 +49,9 @@ async def _cancel_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -69,7 +71,6 @@ async def _cancel_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -88,7 +89,7 @@ async def begin_cancel( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Cancels the current virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -101,8 +102,8 @@ async def begin_cancel( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -148,7 +149,9 @@ async def _start_os_upgrade_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -168,7 +171,6 @@ async def _start_os_upgrade_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -187,10 +189,10 @@ async def begin_start_os_upgrade( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts a rolling upgrade to move all virtual machine scale set instances to the latest - available Platform Image OS version. Instances which are already running the latest available - OS version are not affected. + available Platform Image OS version. Instances which are already running the latest available + OS version are not affected. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -202,8 +204,8 @@ async def begin_start_os_upgrade( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -249,7 +251,9 @@ async def _start_extension_upgrade_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -269,7 +273,6 @@ async def _start_extension_upgrade_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -288,10 +291,10 @@ async def begin_start_extension_upgrade( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to - the latest available extension version. Instances which are already running the latest - extension versions are not affected. + the latest available extension version. Instances which are already running the latest + extension versions are not affected. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -303,8 +306,8 @@ async def begin_start_extension_upgrade( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -361,9 +364,12 @@ async def get_latest( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RollingUpgradeStatusInfo"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get_latest.metadata['url'] # type: ignore @@ -380,9 +386,8 @@ async def get_latest( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_virtual_machine_scale_set_vms_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_vms_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_virtual_machine_scale_set_vms_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index 374b2a33ffe2..cd9092408cdb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_virtual_machine_scale_set_vms_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,7 +52,9 @@ async def _reimage_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") @@ -75,7 +77,6 @@ async def _reimage_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_scale_set_vm_reimage_input is not None: body_content = self._serialize.body(vm_scale_set_vm_reimage_input, 'VirtualMachineReimageParameters') @@ -83,7 +84,6 @@ async def _reimage_initial( body_content = None 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 @@ -103,7 +103,7 @@ async def begin_reimage( instance_id: str, vm_scale_set_vm_reimage_input: Optional["models.VirtualMachineReimageParameters"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -120,8 +120,8 @@ async def begin_reimage( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -170,7 +170,9 @@ async def _reimage_all_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -191,7 +193,6 @@ async def _reimage_all_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -211,9 +212,9 @@ async def begin_reimage_all( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. - This operation is only supported for managed disks. + This operation is only supported for managed disks. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -227,8 +228,8 @@ async def begin_reimage_all( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -276,7 +277,9 @@ async def _deallocate_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -297,7 +300,6 @@ async def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -317,10 +319,10 @@ async def begin_deallocate( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and - releases the compute resources it uses. You are not billed for the compute resources of this - virtual machine once it is deallocated. + releases the compute resources it uses. You are not billed for the compute resources of this + virtual machine once it is deallocated. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -334,8 +336,8 @@ async def begin_deallocate( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -384,10 +386,13 @@ async def _update_initial( **kwargs ) -> "models.VirtualMachineScaleSetVM": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -406,14 +411,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSetVM') 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 @@ -421,7 +424,6 @@ async def _update_initial( 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('VirtualMachineScaleSetVM', pipeline_response) @@ -441,13 +443,13 @@ async def begin_update( instance_id: str, parameters: "models.VirtualMachineScaleSetVM", **kwargs - ) -> "models.VirtualMachineScaleSetVM": + ) -> AsyncLROPoller["models.VirtualMachineScaleSetVM"]: """Updates a virtual machine of a VM scale set. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_scale_set_name: The name of the VM scale set where the extension should be create or - updated. + updated. :type vm_scale_set_name: str :param instance_id: The instance ID of the virtual machine. :type instance_id: str @@ -459,8 +461,8 @@ async def begin_update( 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: VirtualMachineScaleSetVM, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSetVM + :return: An instance of AsyncLROPoller that returns either VirtualMachineScaleSetVM or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSetVM] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -512,7 +514,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -533,7 +537,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -553,7 +556,7 @@ async def begin_delete( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -568,8 +571,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -633,9 +636,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -655,9 +661,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -695,9 +700,12 @@ async def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -715,9 +723,8 @@ async def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -749,11 +756,14 @@ def list( :type resource_group_name: str :param virtual_machine_scale_set_name: The name of the VM scale set. :type virtual_machine_scale_set_name: str - :param filter: The filter to apply to the operation. + :param filter: The filter to apply to the operation. Allowed values are + 'startswith(instanceView/statuses/code, 'PowerState') eq true', 'properties/latestModelApplied + eq true', 'properties/latestModelApplied eq false'. :type filter: str - :param select: The list parameters. + :param select: The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. :type select: str - :param expand: The expand expression to apply to the operation. + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetVMListResult or the result of cls(response) @@ -761,11 +771,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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 @@ -785,15 +802,11 @@ def prepare_request(next_link=None): query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -829,7 +842,9 @@ async def _power_off_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -852,7 +867,6 @@ async def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -873,10 +887,10 @@ async def begin_power_off( instance_id: str, skip_shutdown: Optional[bool] = False, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached - and you are getting charged for the resources. Instead, use deallocate to release resources and - avoid charges. + and you are getting charged for the resources. Instead, use deallocate to release resources and + avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -885,8 +899,8 @@ async def begin_power_off( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param skip_shutdown: The parameter to request non-graceful VM shutdown. True value for this - flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this - flag is false if not specified. + flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this + flag is false if not specified. :type skip_shutdown: 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. @@ -894,8 +908,8 @@ async def begin_power_off( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -944,7 +958,9 @@ async def _restart_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -965,7 +981,6 @@ async def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -985,7 +1000,7 @@ async def begin_restart( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Restarts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1000,8 +1015,8 @@ async def begin_restart( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1049,7 +1064,9 @@ async def _start_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -1070,7 +1087,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1090,7 +1106,7 @@ async def begin_start( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1105,8 +1121,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1154,7 +1170,9 @@ async def _redeploy_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -1175,7 +1193,6 @@ async def _redeploy_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1195,9 +1212,9 @@ async def begin_redeploy( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and - powers it back on. + powers it back on. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1211,8 +1228,8 @@ async def begin_redeploy( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1260,7 +1277,9 @@ async def _perform_maintenance_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -1281,7 +1300,6 @@ async def _perform_maintenance_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1301,7 +1319,7 @@ async def begin_perform_maintenance( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Performs maintenance on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1316,8 +1334,8 @@ async def begin_perform_maintenance( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1364,12 +1382,15 @@ async def _run_command_initial( instance_id: str, parameters: "models.RunCommandInput", **kwargs - ) -> "models.RunCommandResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.RunCommandResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" # Construct URL url = self._run_command_initial.metadata['url'] # type: ignore @@ -1388,14 +1409,12 @@ async def _run_command_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RunCommandInput') 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 @@ -1420,7 +1439,7 @@ async def begin_run_command( instance_id: str, parameters: "models.RunCommandInput", **kwargs - ) -> "models.RunCommandResult": + ) -> AsyncLROPoller["models.RunCommandResult"]: """Run command on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1437,8 +1456,8 @@ async def begin_run_command( 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: RunCommandResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_03_01.models.RunCommandResult + :return: An instance of AsyncLROPoller that returns either RunCommandResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_03_01.models.RunCommandResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_virtual_machine_scale_sets_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_sets_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_virtual_machine_scale_sets_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_sets_operations.py index 96ea7d033dbc..830fc30d80cf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_virtual_machine_scale_sets_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachineScaleSet": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSet') 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('VirtualMachineScaleSet', pipeline_response) @@ -106,7 +106,7 @@ async def begin_create_or_update( vm_scale_set_name: str, parameters: "models.VirtualMachineScaleSet", **kwargs - ) -> "models.VirtualMachineScaleSet": + ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -121,8 +121,8 @@ async def begin_create_or_update( 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: VirtualMachineScaleSet, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSet + :return: An instance of AsyncLROPoller that returns either VirtualMachineScaleSet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -173,10 +173,13 @@ async def _update_initial( **kwargs ) -> "models.VirtualMachineScaleSet": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -194,14 +197,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSetUpdate') 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 @@ -223,7 +224,7 @@ async def begin_update( vm_scale_set_name: str, parameters: "models.VirtualMachineScaleSetUpdate", **kwargs - ) -> "models.VirtualMachineScaleSet": + ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: """Update a VM scale set. :param resource_group_name: The name of the resource group. @@ -238,8 +239,8 @@ async def begin_update( 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: VirtualMachineScaleSet, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSet + :return: An instance of AsyncLROPoller that returns either VirtualMachineScaleSet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -289,7 +290,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -309,7 +312,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -328,7 +330,7 @@ async def begin_delete( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VM scale set. :param resource_group_name: The name of the resource group. @@ -341,8 +343,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -399,9 +401,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -418,9 +423,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -445,7 +449,9 @@ async def _deallocate_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") @@ -467,7 +473,6 @@ async def _deallocate_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -475,7 +480,6 @@ async def _deallocate_initial( body_content = None 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 @@ -494,10 +498,10 @@ async def begin_deallocate( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and - releases the compute resources. You are not billed for the compute resources that this virtual - machine scale set deallocates. + releases the compute resources. You are not billed for the compute resources that this virtual + machine scale set deallocates. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -511,8 +515,8 @@ async def begin_deallocate( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -560,7 +564,9 @@ async def _delete_instances_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") @@ -582,12 +588,10 @@ async def _delete_instances_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -606,7 +610,7 @@ async def begin_delete_instances( vm_scale_set_name: str, vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -621,8 +625,8 @@ async def begin_delete_instances( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -680,9 +684,12 @@ async def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -699,9 +706,8 @@ async def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -733,11 +739,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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 @@ -750,15 +763,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -790,8 +799,8 @@ def list_all( **kwargs ) -> AsyncIterable["models.VirtualMachineScaleSetListWithLinkResult"]: """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource - group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this - till nextLink is null to fetch all the VM Scale Sets. + group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this + till nextLink is null to fetch all the VM Scale Sets. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetListWithLinkResult or the result of cls(response) @@ -799,11 +808,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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_all.metadata['url'] # type: ignore @@ -815,15 +831,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -857,7 +869,7 @@ def list_skus( **kwargs ) -> AsyncIterable["models.VirtualMachineScaleSetListSkusResult"]: """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM - instances allowed for each SKU. + instances allowed for each SKU. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -869,11 +881,18 @@ def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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_skus.metadata['url'] # type: ignore @@ -887,15 +906,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -940,11 +955,18 @@ def get_os_upgrade_history( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListOSUpgradeHistory"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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.get_os_upgrade_history.metadata['url'] # type: ignore @@ -958,15 +980,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1002,7 +1020,9 @@ async def _power_off_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") @@ -1026,7 +1046,6 @@ async def _power_off_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1034,7 +1053,6 @@ async def _power_off_initial( body_content = None 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 @@ -1054,18 +1072,18 @@ async def begin_power_off( skip_shutdown: Optional[bool] = False, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still - attached and you are getting charged for the resources. Instead, use deallocate to release - resources and avoid charges. + attached and you are getting charged for the resources. Instead, use deallocate to release + resources and avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_scale_set_name: The name of the VM scale set. :type vm_scale_set_name: str :param skip_shutdown: The parameter to request non-graceful VM shutdown. True value for this - flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this - flag is false if not specified. + flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this + flag is false if not specified. :type skip_shutdown: bool :param vm_instance_i_ds: A list of virtual machine instance IDs from the VM scale set. :type vm_instance_i_ds: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSetVMInstanceIDs @@ -1075,8 +1093,8 @@ async def begin_power_off( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1125,7 +1143,9 @@ async def _restart_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") @@ -1147,7 +1167,6 @@ async def _restart_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1155,7 +1174,6 @@ async def _restart_initial( body_content = None 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 @@ -1174,7 +1192,7 @@ async def begin_restart( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Restarts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1189,8 +1207,8 @@ async def begin_restart( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1238,7 +1256,9 @@ async def _start_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") @@ -1260,7 +1280,6 @@ async def _start_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1268,7 +1287,6 @@ async def _start_initial( body_content = None 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 @@ -1287,7 +1305,7 @@ async def begin_start( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1302,8 +1320,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1351,7 +1369,9 @@ async def _redeploy_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") @@ -1373,7 +1393,6 @@ async def _redeploy_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1381,7 +1400,6 @@ async def _redeploy_initial( body_content = None 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 @@ -1400,9 +1418,9 @@ async def begin_redeploy( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, - and powers them back on. + and powers them back on. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1416,8 +1434,8 @@ async def begin_redeploy( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1465,7 +1483,9 @@ async def _perform_maintenance_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") @@ -1487,7 +1507,6 @@ async def _perform_maintenance_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1495,7 +1514,6 @@ async def _perform_maintenance_initial( body_content = None 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 @@ -1514,11 +1532,11 @@ async def begin_perform_maintenance( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances - which are not eligible for perform maintenance will be failed. Please refer to best practices - for more details: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual- - machine-scale-sets-maintenance-notifications. + which are not eligible for perform maintenance will be failed. Please refer to best practices + for more details: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual- + machine-scale-sets-maintenance-notifications. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1532,8 +1550,8 @@ async def begin_perform_maintenance( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1581,7 +1599,9 @@ async def _update_instances_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") @@ -1603,12 +1623,10 @@ async def _update_instances_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -1627,7 +1645,7 @@ async def begin_update_instances( vm_scale_set_name: str, vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. :param resource_group_name: The name of the resource group. @@ -1642,8 +1660,8 @@ async def begin_update_instances( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1691,7 +1709,9 @@ async def _reimage_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") @@ -1713,7 +1733,6 @@ async def _reimage_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_scale_set_reimage_input is not None: body_content = self._serialize.body(vm_scale_set_reimage_input, 'VirtualMachineScaleSetReimageParameters') @@ -1721,7 +1740,6 @@ async def _reimage_initial( body_content = None 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 @@ -1740,10 +1758,10 @@ async def begin_reimage( vm_scale_set_name: str, vm_scale_set_reimage_input: Optional["models.VirtualMachineScaleSetReimageParameters"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which - don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual - machine is reset to initial state. + don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual + machine is reset to initial state. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1757,8 +1775,8 @@ async def begin_reimage( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1806,7 +1824,9 @@ async def _reimage_all_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") @@ -1828,7 +1848,6 @@ async def _reimage_all_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1836,7 +1855,6 @@ async def _reimage_all_initial( body_content = None 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 @@ -1855,9 +1873,9 @@ async def begin_reimage_all( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This - operation is only supported for managed disks. + operation is only supported for managed disks. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1871,8 +1889,8 @@ async def begin_reimage_all( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1935,9 +1953,12 @@ async def force_recovery_service_fabric_platform_update_domain_walk( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RecoveryWalkResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.force_recovery_service_fabric_platform_update_domain_walk.metadata['url'] # type: ignore @@ -1955,9 +1976,8 @@ async def force_recovery_service_fabric_platform_update_domain_walk( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1995,8 +2015,11 @@ async def convert_to_single_placement_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL @@ -2010,17 +2033,16 @@ async def convert_to_single_placement_group( # 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') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VMScaleSetConvertToSinglePlacementGroupInput') 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_virtual_machine_sizes_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_sizes_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_virtual_machine_sizes_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_sizes_operations.py index 9a7e0839229c..e36a1f2ffbd1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_virtual_machine_sizes_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_sizes_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -47,7 +47,7 @@ def list( **kwargs ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: """This API is deprecated. Use `Resources Skus `_. + us/rest/api/compute/resourceskus/list>`_. :param location: The location upon which virtual-machine-sizes is queried. :type location: str @@ -57,11 +57,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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 @@ -74,15 +81,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_virtual_machines_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machines_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_virtual_machines_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machines_operations.py index 6082033815eb..01c1d2d976b6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/_virtual_machines_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machines_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -58,11 +58,18 @@ def list_by_location( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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_location.metadata['url'] # type: ignore @@ -75,15 +82,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -116,12 +119,15 @@ async def _capture_initial( vm_name: str, parameters: "models.VirtualMachineCaptureParameters", **kwargs - ) -> "models.VirtualMachineCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.VirtualMachineCaptureResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._capture_initial.metadata['url'] # type: ignore @@ -139,14 +145,12 @@ async def _capture_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineCaptureParameters') 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 @@ -170,9 +174,9 @@ async def begin_capture( vm_name: str, parameters: "models.VirtualMachineCaptureParameters", **kwargs - ) -> "models.VirtualMachineCaptureResult": + ) -> AsyncLROPoller["models.VirtualMachineCaptureResult"]: """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used - to create similar VMs. + to create similar VMs. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -186,8 +190,8 @@ async def begin_capture( 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: VirtualMachineCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineCaptureResult + :return: An instance of AsyncLROPoller that returns either VirtualMachineCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineCaptureResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -238,10 +242,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachine": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -259,14 +266,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachine') 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 @@ -274,7 +279,6 @@ async def _create_or_update_initial( 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('VirtualMachine', pipeline_response) @@ -293,7 +297,7 @@ async def begin_create_or_update( vm_name: str, parameters: "models.VirtualMachine", **kwargs - ) -> "models.VirtualMachine": + ) -> AsyncLROPoller["models.VirtualMachine"]: """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -308,8 +312,8 @@ async def begin_create_or_update( 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: VirtualMachine, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachine + :return: An instance of AsyncLROPoller that returns either VirtualMachine or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_03_01.models.VirtualMachine] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,10 +364,13 @@ async def _update_initial( **kwargs ) -> "models.VirtualMachine": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -381,14 +388,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineUpdate') 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 @@ -396,7 +401,6 @@ async def _update_initial( 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('VirtualMachine', pipeline_response) @@ -415,7 +419,7 @@ async def begin_update( vm_name: str, parameters: "models.VirtualMachineUpdate", **kwargs - ) -> "models.VirtualMachine": + ) -> AsyncLROPoller["models.VirtualMachine"]: """The operation to update a virtual machine. :param resource_group_name: The name of the resource group. @@ -430,8 +434,8 @@ async def begin_update( 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: VirtualMachine, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachine + :return: An instance of AsyncLROPoller that returns either VirtualMachine or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_03_01.models.VirtualMachine] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -481,7 +485,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -501,7 +507,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -520,7 +525,7 @@ async def begin_delete( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to delete a virtual machine. :param resource_group_name: The name of the resource group. @@ -533,8 +538,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -594,9 +599,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -615,9 +623,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -652,9 +659,12 @@ async def instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.instance_view.metadata['url'] # type: ignore @@ -671,9 +681,8 @@ async def instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -697,7 +706,9 @@ async def _convert_to_managed_disks_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -717,7 +728,6 @@ async def _convert_to_managed_disks_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -736,9 +746,9 @@ async def begin_convert_to_managed_disks( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop- - deallocated before invoking this operation. + deallocated before invoking this operation. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -750,8 +760,8 @@ async def begin_convert_to_managed_disks( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -797,7 +807,9 @@ async def _deallocate_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -817,7 +829,6 @@ async def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -836,9 +847,9 @@ async def begin_deallocate( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Shuts down the virtual machine and releases the compute resources. You are not billed for the - compute resources that this virtual machine uses. + compute resources that this virtual machine uses. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -850,8 +861,8 @@ async def begin_deallocate( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -908,7 +919,9 @@ async def generalize( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -928,7 +941,6 @@ async def generalize( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -948,7 +960,7 @@ def list( **kwargs ) -> AsyncIterable["models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified resource group. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -958,11 +970,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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 @@ -975,15 +994,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1015,7 +1030,7 @@ def list_all( **kwargs ) -> AsyncIterable["models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified subscription. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineListResult or the result of cls(response) @@ -1023,11 +1038,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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_all.metadata['url'] # type: ignore @@ -1039,15 +1061,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1081,7 +1099,7 @@ def list_available_sizes( **kwargs ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes to which the specified virtual machine can be - resized. + resized. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1093,11 +1111,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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_available_sizes.metadata['url'] # type: ignore @@ -1111,15 +1136,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1154,7 +1175,9 @@ async def _power_off_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -1176,7 +1199,6 @@ async def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1196,17 +1218,17 @@ async def begin_power_off( vm_name: str, skip_shutdown: Optional[bool] = False, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with - the same provisioned resources. You are still charged for this virtual machine. + the same provisioned resources. You are still charged for this virtual machine. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_name: The name of the virtual machine. :type vm_name: str :param skip_shutdown: The parameter to request non-graceful VM shutdown. True value for this - flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this - flag is false if not specified. + flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this + flag is false if not specified. :type skip_shutdown: 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. @@ -1214,8 +1236,8 @@ async def begin_power_off( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1262,7 +1284,9 @@ async def _restart_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -1282,7 +1306,6 @@ async def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1301,7 +1324,7 @@ async def begin_restart( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to restart a virtual machine. :param resource_group_name: The name of the resource group. @@ -1314,8 +1337,8 @@ async def begin_restart( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1361,7 +1384,9 @@ async def _start_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -1381,7 +1406,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1400,7 +1424,7 @@ async def begin_start( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to start a virtual machine. :param resource_group_name: The name of the resource group. @@ -1413,8 +1437,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1460,7 +1484,9 @@ async def _redeploy_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -1480,7 +1506,6 @@ async def _redeploy_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1499,7 +1524,7 @@ async def begin_redeploy( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Shuts down the virtual machine, moves it to a new node, and powers it back on. :param resource_group_name: The name of the resource group. @@ -1512,8 +1537,8 @@ async def begin_redeploy( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1560,7 +1585,9 @@ async def _reimage_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") @@ -1582,7 +1609,6 @@ async def _reimage_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: body_content = self._serialize.body(parameters, 'VirtualMachineReimageParameters') @@ -1590,7 +1616,6 @@ async def _reimage_initial( body_content = None 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 @@ -1609,7 +1634,7 @@ async def begin_reimage( vm_name: str, parameters: Optional["models.VirtualMachineReimageParameters"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Reimages the virtual machine which has an ephemeral OS disk back to its initial state. :param resource_group_name: The name of the resource group. @@ -1624,8 +1649,8 @@ async def begin_reimage( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1672,7 +1697,9 @@ async def _perform_maintenance_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -1692,7 +1719,6 @@ async def _perform_maintenance_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1711,7 +1737,7 @@ async def begin_perform_maintenance( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to perform maintenance on a virtual machine. :param resource_group_name: The name of the resource group. @@ -1724,8 +1750,8 @@ async def begin_perform_maintenance( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1770,12 +1796,15 @@ async def _run_command_initial( vm_name: str, parameters: "models.RunCommandInput", **kwargs - ) -> "models.RunCommandResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.RunCommandResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" # Construct URL url = self._run_command_initial.metadata['url'] # type: ignore @@ -1793,14 +1822,12 @@ async def _run_command_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RunCommandInput') 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 @@ -1824,7 +1851,7 @@ async def begin_run_command( vm_name: str, parameters: "models.RunCommandInput", **kwargs - ) -> "models.RunCommandResult": + ) -> AsyncLROPoller["models.RunCommandResult"]: """Run command on the VM. :param resource_group_name: The name of the resource group. @@ -1839,8 +1866,8 @@ async def begin_run_command( 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: RunCommandResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_03_01.models.RunCommandResult + :return: An instance of AsyncLROPoller that returns either RunCommandResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_03_01.models.RunCommandResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/__init__.py deleted file mode 100644 index 114d36180789..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations_async/__init__.py +++ /dev/null @@ -1,61 +0,0 @@ -# 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 ._operations_async import Operations -from ._availability_sets_operations_async import AvailabilitySetsOperations -from ._proximity_placement_groups_operations_async import ProximityPlacementGroupsOperations -from ._dedicated_host_groups_operations_async import DedicatedHostGroupsOperations -from ._dedicated_hosts_operations_async import DedicatedHostsOperations -from ._virtual_machine_extension_images_operations_async import VirtualMachineExtensionImagesOperations -from ._virtual_machine_extensions_operations_async import VirtualMachineExtensionsOperations -from ._virtual_machine_images_operations_async import VirtualMachineImagesOperations -from ._usage_operations_async import UsageOperations -from ._virtual_machines_operations_async import VirtualMachinesOperations -from ._virtual_machine_sizes_operations_async import VirtualMachineSizesOperations -from ._images_operations_async import ImagesOperations -from ._virtual_machine_scale_sets_operations_async import VirtualMachineScaleSetsOperations -from ._virtual_machine_scale_set_extensions_operations_async import VirtualMachineScaleSetExtensionsOperations -from ._virtual_machine_scale_set_rolling_upgrades_operations_async import VirtualMachineScaleSetRollingUpgradesOperations -from ._virtual_machine_scale_set_vms_operations_async import VirtualMachineScaleSetVMsOperations -from ._log_analytics_operations_async import LogAnalyticsOperations -from ._virtual_machine_run_commands_operations_async import VirtualMachineRunCommandsOperations -from ._galleries_operations_async import GalleriesOperations -from ._gallery_images_operations_async import GalleryImagesOperations -from ._gallery_image_versions_operations_async import GalleryImageVersionsOperations -from ._gallery_applications_operations_async import GalleryApplicationsOperations -from ._gallery_application_versions_operations_async import GalleryApplicationVersionsOperations -from ._disks_operations_async import DisksOperations -from ._snapshots_operations_async import SnapshotsOperations - -__all__ = [ - 'Operations', - 'AvailabilitySetsOperations', - 'ProximityPlacementGroupsOperations', - 'DedicatedHostGroupsOperations', - 'DedicatedHostsOperations', - 'VirtualMachineExtensionImagesOperations', - 'VirtualMachineExtensionsOperations', - 'VirtualMachineImagesOperations', - 'UsageOperations', - 'VirtualMachinesOperations', - 'VirtualMachineSizesOperations', - 'ImagesOperations', - 'VirtualMachineScaleSetsOperations', - 'VirtualMachineScaleSetExtensionsOperations', - 'VirtualMachineScaleSetRollingUpgradesOperations', - 'VirtualMachineScaleSetVMsOperations', - 'LogAnalyticsOperations', - 'VirtualMachineRunCommandsOperations', - 'GalleriesOperations', - 'GalleryImagesOperations', - 'GalleryImageVersionsOperations', - 'GalleryApplicationsOperations', - 'GalleryApplicationVersionsOperations', - 'DisksOperations', - 'SnapshotsOperations', -] 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 895d5cc97a22..08aac314f388 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 @@ -441,6 +441,7 @@ AvailabilitySetSkuTypes, CachingTypes, DedicatedHostLicenseTypes, + DiffDiskOptions, DiskCreateOption, DiskCreateOptionTypes, DiskState, @@ -461,6 +462,7 @@ ProtocolTypes, ProximityPlacementGroupType, ReplicationState, + ReplicationStatusTypes, ResourceIdentityType, RollingUpgradeActionType, RollingUpgradeStatusCode, @@ -698,6 +700,7 @@ 'AvailabilitySetSkuTypes', 'CachingTypes', 'DedicatedHostLicenseTypes', + 'DiffDiskOptions', 'DiskCreateOption', 'DiskCreateOptionTypes', 'DiskState', @@ -718,6 +721,7 @@ 'ProtocolTypes', 'ProximityPlacementGroupType', 'ReplicationState', + 'ReplicationStatusTypes', 'ResourceIdentityType', 'RollingUpgradeActionType', 'RollingUpgradeStatusCode', 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 157dfc3c6473..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 @@ -6,66 +6,90 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum +from enum import Enum, EnumMeta +from six import with_metaclass -class AccessLevel(str, Enum): +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) - none = "None" - read = "Read" - write = "Write" + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) -class AggregatedReplicationState(str, Enum): + +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. """ - unknown = "Unknown" - in_progress = "InProgress" - completed = "Completed" - failed = "Failed" + UNKNOWN = "Unknown" + IN_PROGRESS = "InProgress" + COMPLETED = "Completed" + FAILED = "Failed" -class AvailabilitySetSkuTypes(str, Enum): +class AvailabilitySetSkuTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the sku of an Availability Set. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual machines with unmanaged disks. Default value is 'Classic'. """ - classic = "Classic" - aligned = "Aligned" + CLASSIC = "Classic" + ALIGNED = "Aligned" -class CachingTypes(str, Enum): +class CachingTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the caching requirements. :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **None** :code:`
`:code:`
` **ReadOnly** :code:`
`:code:`
` **ReadWrite** :code:`
`:code:`
` Default: **None for Standard storage. ReadOnly for Premium storage** """ - none = "None" - read_only = "ReadOnly" - read_write = "ReadWrite" + NONE = "None" + READ_ONLY = "ReadOnly" + READ_WRITE = "ReadWrite" -class DedicatedHostLicenseTypes(str, Enum): +class DedicatedHostLicenseTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the software license type that will be applied to the VMs deployed on the dedicated host. :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **None** :code:`
`:code:`
` **Windows_Server_Hybrid** :code:`
`:code:`
` **Windows_Server_Perpetual** :code:`
`:code:`
` Default: **None** """ - none = "None" - windows_server_hybrid = "Windows_Server_Hybrid" - windows_server_perpetual = "Windows_Server_Perpetual" + NONE = "None" + WINDOWS_SERVER_HYBRID = "Windows_Server_Hybrid" + WINDOWS_SERVER_PERPETUAL = "Windows_Server_Perpetual" + +class DiffDiskOptions(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the ephemeral disk option for operating system disk. + """ + + LOCAL = "Local" -class DiskCreateOption(str, Enum): +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. - 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. + 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. + 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 DiskCreateOptionTypes(str, Enum): +class DiskCreateOptionTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies how the virtual machine should be created.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` **Attach** \u2013 This value is used when you are using a specialized disk to create the virtual machine.:code:`
`:code:`
` **FromImage** \u2013 @@ -74,232 +98,234 @@ class DiskCreateOptionTypes(str, Enum): marketplace image, you also use the plan element previously described. """ - from_image = "FromImage" - empty = "Empty" - attach = "Attach" + FROM_IMAGE = "FromImage" + EMPTY = "Empty" + ATTACH = "Attach" -class DiskState(str, Enum): +class DiskState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The 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. + 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(str, Enum): +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. + 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 GalleryApplicationVersionPropertiesProvisioningState(str, Enum): +class GalleryApplicationVersionPropertiesProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The provisioning state, which only appears in the response. """ - creating = "Creating" - updating = "Updating" - failed = "Failed" - succeeded = "Succeeded" - deleting = "Deleting" - migrating = "Migrating" + CREATING = "Creating" + UPDATING = "Updating" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + DELETING = "Deleting" + MIGRATING = "Migrating" -class GalleryImagePropertiesProvisioningState(str, Enum): +class GalleryImagePropertiesProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The provisioning state, which only appears in the response. """ - creating = "Creating" - updating = "Updating" - failed = "Failed" - succeeded = "Succeeded" - deleting = "Deleting" - migrating = "Migrating" + CREATING = "Creating" + UPDATING = "Updating" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + DELETING = "Deleting" + MIGRATING = "Migrating" -class GalleryImageVersionPropertiesProvisioningState(str, Enum): +class GalleryImageVersionPropertiesProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The provisioning state, which only appears in the response. """ - creating = "Creating" - updating = "Updating" - failed = "Failed" - succeeded = "Succeeded" - deleting = "Deleting" - migrating = "Migrating" + CREATING = "Creating" + UPDATING = "Updating" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + DELETING = "Deleting" + MIGRATING = "Migrating" -class GalleryPropertiesProvisioningState(str, Enum): +class GalleryPropertiesProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The provisioning state, which only appears in the response. """ - creating = "Creating" - updating = "Updating" - failed = "Failed" - succeeded = "Succeeded" - deleting = "Deleting" - migrating = "Migrating" + CREATING = "Creating" + UPDATING = "Updating" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + DELETING = "Deleting" + MIGRATING = "Migrating" -class HostCaching(str, Enum): +class HostCaching(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' """ - none = "None" - read_only = "ReadOnly" - read_write = "ReadWrite" + NONE = "None" + READ_ONLY = "ReadOnly" + READ_WRITE = "ReadWrite" -class HyperVGeneration(str, Enum): +class HyperVGeneration(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The hypervisor generation of the Virtual Machine. Applicable to OS disks only. """ - v1 = "V1" - v2 = "V2" + V1 = "V1" + V2 = "V2" -class HyperVGenerationType(str, Enum): +class HyperVGenerationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the HyperVGeneration Type associated with a resource """ - v1 = "V1" - v2 = "V2" + V1 = "V1" + V2 = "V2" -class HyperVGenerationTypes(str, Enum): +class HyperVGenerationTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the HyperVGeneration Type """ - v1 = "V1" - v2 = "V2" + V1 = "V1" + V2 = "V2" -class IntervalInMins(str, Enum): +class IntervalInMins(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Interval value in minutes used to create LogAnalytics call rate logs. """ - three_mins = "ThreeMins" - five_mins = "FiveMins" - thirty_mins = "ThirtyMins" - sixty_mins = "SixtyMins" + THREE_MINS = "ThreeMins" + FIVE_MINS = "FiveMins" + THIRTY_MINS = "ThirtyMins" + SIXTY_MINS = "SixtyMins" -class IPVersion(str, Enum): +class IPVersion(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. """ - i_pv4 = "IPv4" - i_pv6 = "IPv6" + I_PV4 = "IPv4" + I_PV6 = "IPv6" -class MaintenanceOperationResultCodeTypes(str, Enum): +class MaintenanceOperationResultCodeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The Last Maintenance Operation Result Code. """ - none = "None" - retry_later = "RetryLater" - maintenance_aborted = "MaintenanceAborted" - maintenance_completed = "MaintenanceCompleted" + NONE = "None" + RETRY_LATER = "RetryLater" + MAINTENANCE_ABORTED = "MaintenanceAborted" + MAINTENANCE_COMPLETED = "MaintenanceCompleted" -class OperatingSystemStateTypes(str, Enum): +class OperatingSystemStateTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The OS State. """ - generalized = "Generalized" #: Generalized image. Needs to be provisioned during deployment time. - specialized = "Specialized" #: Specialized image. Contains already provisioned OS Disk. + GENERALIZED = "Generalized" #: Generalized image. Needs to be provisioned during deployment time. + SPECIALIZED = "Specialized" #: Specialized image. Contains already provisioned OS Disk. -class OperatingSystemTypes(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** +class OperatingSystemTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The operating system of the osDiskImage. """ - windows = "Windows" - linux = "Linux" + WINDOWS = "Windows" + LINUX = "Linux" -class ProtocolTypes(str, Enum): +class ProtocolTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the protocol of listener. :code:`
`:code:`
` Possible values are: :code:`
`\ **http** :code:`
`:code:`
` **https** """ - http = "Http" - https = "Https" + HTTP = "Http" + HTTPS = "Https" -class ProximityPlacementGroupType(str, Enum): +class ProximityPlacementGroupType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the type of the proximity placement group. :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **Standard** : Co-locate resources within an Azure region or Availability Zone. :code:`
`:code:`
` **Ultra** : For future use. """ - standard = "Standard" - ultra = "Ultra" + STANDARD = "Standard" + ULTRA = "Ultra" -class ReplicationState(str, Enum): +class ReplicationState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """This is the regional replication state. """ - unknown = "Unknown" - replicating = "Replicating" - completed = "Completed" - failed = "Failed" + UNKNOWN = "Unknown" + REPLICATING = "Replicating" + COMPLETED = "Completed" + FAILED = "Failed" + +class ReplicationStatusTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + REPLICATION_STATUS = "ReplicationStatus" -class ResourceIdentityType(str, Enum): +class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The type of identity used for the virtual machine. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine. """ - system_assigned = "SystemAssigned" - user_assigned = "UserAssigned" - system_assigned_user_assigned = "SystemAssigned, UserAssigned" - none = "None" + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned, UserAssigned" + NONE = "None" -class RollingUpgradeActionType(str, Enum): +class RollingUpgradeActionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The last action performed on the rolling upgrade. """ - start = "Start" - cancel = "Cancel" + START = "Start" + CANCEL = "Cancel" -class RollingUpgradeStatusCode(str, Enum): +class RollingUpgradeStatusCode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Code indicating the current status of the upgrade. """ - rolling_forward = "RollingForward" - cancelled = "Cancelled" - completed = "Completed" - faulted = "Faulted" + ROLLING_FORWARD = "RollingForward" + CANCELLED = "Cancelled" + COMPLETED = "Completed" + FAULTED = "Faulted" -class SettingNames(str, Enum): +class SettingNames(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon. """ - auto_logon = "AutoLogon" - first_logon_commands = "FirstLogonCommands" + AUTO_LOGON = "AutoLogon" + FIRST_LOGON_COMMANDS = "FirstLogonCommands" -class SnapshotStorageAccountTypes(str, Enum): +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. + 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 StatusLevelTypes(str, Enum): +class StatusLevelTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The level code. """ - info = "Info" - warning = "Warning" - error = "Error" + INFO = "Info" + WARNING = "Warning" + ERROR = "Error" -class StorageAccountType(str, Enum): +class StorageAccountType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the storage account type to be used to store the image. This property is not updatable. """ - standard_lrs = "Standard_LRS" - standard_zrs = "Standard_ZRS" + STANDARD_LRS = "Standard_LRS" + STANDARD_ZRS = "Standard_ZRS" -class StorageAccountTypes(str, Enum): +class StorageAccountTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the storage account type for the managed disk. Managed OS disk storage account type can only be set when you create the scale set. NOTE: UltraSSD_LRS can only be used with data disks. It cannot be used with OS Disk. Standard_LRS uses Standard HDD. StandardSSD_LRS uses @@ -309,12 +335,12 @@ class StorageAccountTypes(str, Enum): https://docs.microsoft.com/en-us/azure/virtual-machines/linux/disks-types """ - standard_lrs = "Standard_LRS" - premium_lrs = "Premium_LRS" - standard_ssd_lrs = "StandardSSD_LRS" - ultra_ssd_lrs = "UltraSSD_LRS" + STANDARD_LRS = "Standard_LRS" + PREMIUM_LRS = "Premium_LRS" + STANDARD_SSD_LRS = "StandardSSD_LRS" + ULTRA_SSD_LRS = "UltraSSD_LRS" -class UpgradeMode(str, Enum): +class UpgradeMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the mode of an upgrade to virtual machines in the scale set.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` **Manual** - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade @@ -322,58 +348,58 @@ class UpgradeMode(str, Enum): automatically updated at the same time. """ - automatic = "Automatic" - manual = "Manual" - rolling = "Rolling" + AUTOMATIC = "Automatic" + MANUAL = "Manual" + ROLLING = "Rolling" -class UpgradeOperationInvoker(str, Enum): +class UpgradeOperationInvoker(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Invoker of the Upgrade Operation """ - unknown = "Unknown" - user = "User" - platform = "Platform" + UNKNOWN = "Unknown" + USER = "User" + PLATFORM = "Platform" -class UpgradeState(str, Enum): +class UpgradeState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Code indicating the current status of the upgrade. """ - rolling_forward = "RollingForward" - cancelled = "Cancelled" - completed = "Completed" - faulted = "Faulted" + ROLLING_FORWARD = "RollingForward" + CANCELLED = "Cancelled" + COMPLETED = "Completed" + FAULTED = "Faulted" -class VirtualMachineEvictionPolicyTypes(str, Enum): +class VirtualMachineEvictionPolicyTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the eviction policy for the Azure Spot VM/VMSS """ - deallocate = "Deallocate" - delete = "Delete" + DEALLOCATE = "Deallocate" + DELETE = "Delete" -class VirtualMachinePriorityTypes(str, Enum): +class VirtualMachinePriorityTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the priority for a standalone virtual machine or the virtual machines in the scale set. :code:`
`:code:`
` 'Low' enum will be deprecated in the future, please use 'Spot' as the enum to deploy Azure Spot VM/VMSS. """ - regular = "Regular" - low = "Low" - spot = "Spot" + REGULAR = "Regular" + LOW = "Low" + SPOT = "Spot" -class VirtualMachineScaleSetScaleInRules(str, Enum): +class VirtualMachineScaleSetScaleInRules(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - default = "Default" - oldest_vm = "OldestVM" - newest_vm = "NewestVM" + DEFAULT = "Default" + OLDEST_VM = "OldestVM" + NEWEST_VM = "NewestVM" -class VirtualMachineScaleSetSkuScaleType(str, Enum): +class VirtualMachineScaleSetSkuScaleType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The scale type applicable to the sku. """ - automatic = "Automatic" - none = "None" + AUTOMATIC = "Automatic" + NONE = "None" -class VirtualMachineSizeTypes(str, Enum): +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 `_. @@ -387,169 +413,169 @@ class VirtualMachineSizeTypes(str, Enum): `_ """ - basic_a0 = "Basic_A0" - basic_a1 = "Basic_A1" - basic_a2 = "Basic_A2" - basic_a3 = "Basic_A3" - basic_a4 = "Basic_A4" - standard_a0 = "Standard_A0" - standard_a1 = "Standard_A1" - standard_a2 = "Standard_A2" - standard_a3 = "Standard_A3" - standard_a4 = "Standard_A4" - standard_a5 = "Standard_A5" - standard_a6 = "Standard_A6" - standard_a7 = "Standard_A7" - standard_a8 = "Standard_A8" - standard_a9 = "Standard_A9" - standard_a10 = "Standard_A10" - standard_a11 = "Standard_A11" - standard_a1_v2 = "Standard_A1_v2" - standard_a2_v2 = "Standard_A2_v2" - standard_a4_v2 = "Standard_A4_v2" - standard_a8_v2 = "Standard_A8_v2" - standard_a2_m_v2 = "Standard_A2m_v2" - standard_a4_m_v2 = "Standard_A4m_v2" - standard_a8_m_v2 = "Standard_A8m_v2" - standard_b1_s = "Standard_B1s" - standard_b1_ms = "Standard_B1ms" - standard_b2_s = "Standard_B2s" - standard_b2_ms = "Standard_B2ms" - standard_b4_ms = "Standard_B4ms" - standard_b8_ms = "Standard_B8ms" - standard_d1 = "Standard_D1" - standard_d2 = "Standard_D2" - standard_d3 = "Standard_D3" - standard_d4 = "Standard_D4" - standard_d11 = "Standard_D11" - standard_d12 = "Standard_D12" - standard_d13 = "Standard_D13" - standard_d14 = "Standard_D14" - standard_d1_v2 = "Standard_D1_v2" - standard_d2_v2 = "Standard_D2_v2" - standard_d3_v2 = "Standard_D3_v2" - standard_d4_v2 = "Standard_D4_v2" - standard_d5_v2 = "Standard_D5_v2" - standard_d2_v3 = "Standard_D2_v3" - standard_d4_v3 = "Standard_D4_v3" - standard_d8_v3 = "Standard_D8_v3" - standard_d16_v3 = "Standard_D16_v3" - standard_d32_v3 = "Standard_D32_v3" - standard_d64_v3 = "Standard_D64_v3" - standard_d2_s_v3 = "Standard_D2s_v3" - standard_d4_s_v3 = "Standard_D4s_v3" - standard_d8_s_v3 = "Standard_D8s_v3" - standard_d16_s_v3 = "Standard_D16s_v3" - standard_d32_s_v3 = "Standard_D32s_v3" - standard_d64_s_v3 = "Standard_D64s_v3" - standard_d11_v2 = "Standard_D11_v2" - standard_d12_v2 = "Standard_D12_v2" - standard_d13_v2 = "Standard_D13_v2" - standard_d14_v2 = "Standard_D14_v2" - standard_d15_v2 = "Standard_D15_v2" - standard_ds1 = "Standard_DS1" - standard_ds2 = "Standard_DS2" - standard_ds3 = "Standard_DS3" - standard_ds4 = "Standard_DS4" - standard_ds11 = "Standard_DS11" - standard_ds12 = "Standard_DS12" - standard_ds13 = "Standard_DS13" - standard_ds14 = "Standard_DS14" - standard_ds1_v2 = "Standard_DS1_v2" - standard_ds2_v2 = "Standard_DS2_v2" - standard_ds3_v2 = "Standard_DS3_v2" - standard_ds4_v2 = "Standard_DS4_v2" - standard_ds5_v2 = "Standard_DS5_v2" - standard_ds11_v2 = "Standard_DS11_v2" - standard_ds12_v2 = "Standard_DS12_v2" - standard_ds13_v2 = "Standard_DS13_v2" - standard_ds14_v2 = "Standard_DS14_v2" - standard_ds15_v2 = "Standard_DS15_v2" - standard_ds13_4_v2 = "Standard_DS13-4_v2" - standard_ds13_2_v2 = "Standard_DS13-2_v2" - standard_ds14_8_v2 = "Standard_DS14-8_v2" - standard_ds14_4_v2 = "Standard_DS14-4_v2" - standard_e2_v3 = "Standard_E2_v3" - standard_e4_v3 = "Standard_E4_v3" - standard_e8_v3 = "Standard_E8_v3" - standard_e16_v3 = "Standard_E16_v3" - standard_e32_v3 = "Standard_E32_v3" - standard_e64_v3 = "Standard_E64_v3" - standard_e2_s_v3 = "Standard_E2s_v3" - standard_e4_s_v3 = "Standard_E4s_v3" - standard_e8_s_v3 = "Standard_E8s_v3" - standard_e16_s_v3 = "Standard_E16s_v3" - standard_e32_s_v3 = "Standard_E32s_v3" - standard_e64_s_v3 = "Standard_E64s_v3" - standard_e32_16_v3 = "Standard_E32-16_v3" - standard_e32_8_s_v3 = "Standard_E32-8s_v3" - standard_e64_32_s_v3 = "Standard_E64-32s_v3" - standard_e64_16_s_v3 = "Standard_E64-16s_v3" - standard_f1 = "Standard_F1" - standard_f2 = "Standard_F2" - standard_f4 = "Standard_F4" - standard_f8 = "Standard_F8" - standard_f16 = "Standard_F16" - standard_f1_s = "Standard_F1s" - standard_f2_s = "Standard_F2s" - standard_f4_s = "Standard_F4s" - standard_f8_s = "Standard_F8s" - standard_f16_s = "Standard_F16s" - standard_f2_s_v2 = "Standard_F2s_v2" - standard_f4_s_v2 = "Standard_F4s_v2" - standard_f8_s_v2 = "Standard_F8s_v2" - standard_f16_s_v2 = "Standard_F16s_v2" - standard_f32_s_v2 = "Standard_F32s_v2" - standard_f64_s_v2 = "Standard_F64s_v2" - standard_f72_s_v2 = "Standard_F72s_v2" - standard_g1 = "Standard_G1" - standard_g2 = "Standard_G2" - standard_g3 = "Standard_G3" - standard_g4 = "Standard_G4" - standard_g5 = "Standard_G5" - standard_gs1 = "Standard_GS1" - standard_gs2 = "Standard_GS2" - standard_gs3 = "Standard_GS3" - standard_gs4 = "Standard_GS4" - standard_gs5 = "Standard_GS5" - standard_gs4_8 = "Standard_GS4-8" - standard_gs4_4 = "Standard_GS4-4" - standard_gs5_16 = "Standard_GS5-16" - standard_gs5_8 = "Standard_GS5-8" - standard_h8 = "Standard_H8" - standard_h16 = "Standard_H16" - standard_h8_m = "Standard_H8m" - standard_h16_m = "Standard_H16m" - standard_h16_r = "Standard_H16r" - standard_h16_mr = "Standard_H16mr" - standard_l4_s = "Standard_L4s" - standard_l8_s = "Standard_L8s" - standard_l16_s = "Standard_L16s" - standard_l32_s = "Standard_L32s" - standard_m64_s = "Standard_M64s" - standard_m64_ms = "Standard_M64ms" - standard_m128_s = "Standard_M128s" - standard_m128_ms = "Standard_M128ms" - standard_m64_32_ms = "Standard_M64-32ms" - standard_m64_16_ms = "Standard_M64-16ms" - standard_m128_64_ms = "Standard_M128-64ms" - standard_m128_32_ms = "Standard_M128-32ms" - standard_nc6 = "Standard_NC6" - standard_nc12 = "Standard_NC12" - standard_nc24 = "Standard_NC24" - standard_nc24_r = "Standard_NC24r" - standard_nc6_s_v2 = "Standard_NC6s_v2" - standard_nc12_s_v2 = "Standard_NC12s_v2" - standard_nc24_s_v2 = "Standard_NC24s_v2" - standard_nc24_rs_v2 = "Standard_NC24rs_v2" - standard_nc6_s_v3 = "Standard_NC6s_v3" - standard_nc12_s_v3 = "Standard_NC12s_v3" - standard_nc24_s_v3 = "Standard_NC24s_v3" - standard_nc24_rs_v3 = "Standard_NC24rs_v3" - standard_nd6_s = "Standard_ND6s" - standard_nd12_s = "Standard_ND12s" - standard_nd24_s = "Standard_ND24s" - standard_nd24_rs = "Standard_ND24rs" - standard_nv6 = "Standard_NV6" - standard_nv12 = "Standard_NV12" - standard_nv24 = "Standard_NV24" + BASIC_A0 = "Basic_A0" + BASIC_A1 = "Basic_A1" + BASIC_A2 = "Basic_A2" + BASIC_A3 = "Basic_A3" + BASIC_A4 = "Basic_A4" + STANDARD_A0 = "Standard_A0" + STANDARD_A1 = "Standard_A1" + STANDARD_A2 = "Standard_A2" + STANDARD_A3 = "Standard_A3" + STANDARD_A4 = "Standard_A4" + STANDARD_A5 = "Standard_A5" + STANDARD_A6 = "Standard_A6" + STANDARD_A7 = "Standard_A7" + STANDARD_A8 = "Standard_A8" + STANDARD_A9 = "Standard_A9" + STANDARD_A10 = "Standard_A10" + STANDARD_A11 = "Standard_A11" + STANDARD_A1_V2 = "Standard_A1_v2" + STANDARD_A2_V2 = "Standard_A2_v2" + STANDARD_A4_V2 = "Standard_A4_v2" + STANDARD_A8_V2 = "Standard_A8_v2" + STANDARD_A2_M_V2 = "Standard_A2m_v2" + STANDARD_A4_M_V2 = "Standard_A4m_v2" + STANDARD_A8_M_V2 = "Standard_A8m_v2" + STANDARD_B1_S = "Standard_B1s" + STANDARD_B1_MS = "Standard_B1ms" + STANDARD_B2_S = "Standard_B2s" + STANDARD_B2_MS = "Standard_B2ms" + STANDARD_B4_MS = "Standard_B4ms" + STANDARD_B8_MS = "Standard_B8ms" + STANDARD_D1 = "Standard_D1" + STANDARD_D2 = "Standard_D2" + STANDARD_D3 = "Standard_D3" + STANDARD_D4 = "Standard_D4" + STANDARD_D11 = "Standard_D11" + STANDARD_D12 = "Standard_D12" + STANDARD_D13 = "Standard_D13" + STANDARD_D14 = "Standard_D14" + STANDARD_D1_V2 = "Standard_D1_v2" + STANDARD_D2_V2 = "Standard_D2_v2" + STANDARD_D3_V2 = "Standard_D3_v2" + STANDARD_D4_V2 = "Standard_D4_v2" + STANDARD_D5_V2 = "Standard_D5_v2" + STANDARD_D2_V3 = "Standard_D2_v3" + STANDARD_D4_V3 = "Standard_D4_v3" + STANDARD_D8_V3 = "Standard_D8_v3" + STANDARD_D16_V3 = "Standard_D16_v3" + STANDARD_D32_V3 = "Standard_D32_v3" + STANDARD_D64_V3 = "Standard_D64_v3" + STANDARD_D2_S_V3 = "Standard_D2s_v3" + STANDARD_D4_S_V3 = "Standard_D4s_v3" + STANDARD_D8_S_V3 = "Standard_D8s_v3" + STANDARD_D16_S_V3 = "Standard_D16s_v3" + STANDARD_D32_S_V3 = "Standard_D32s_v3" + STANDARD_D64_S_V3 = "Standard_D64s_v3" + STANDARD_D11_V2 = "Standard_D11_v2" + STANDARD_D12_V2 = "Standard_D12_v2" + STANDARD_D13_V2 = "Standard_D13_v2" + STANDARD_D14_V2 = "Standard_D14_v2" + STANDARD_D15_V2 = "Standard_D15_v2" + STANDARD_DS1 = "Standard_DS1" + STANDARD_DS2 = "Standard_DS2" + STANDARD_DS3 = "Standard_DS3" + STANDARD_DS4 = "Standard_DS4" + STANDARD_DS11 = "Standard_DS11" + STANDARD_DS12 = "Standard_DS12" + STANDARD_DS13 = "Standard_DS13" + STANDARD_DS14 = "Standard_DS14" + STANDARD_DS1_V2 = "Standard_DS1_v2" + STANDARD_DS2_V2 = "Standard_DS2_v2" + STANDARD_DS3_V2 = "Standard_DS3_v2" + STANDARD_DS4_V2 = "Standard_DS4_v2" + STANDARD_DS5_V2 = "Standard_DS5_v2" + STANDARD_DS11_V2 = "Standard_DS11_v2" + STANDARD_DS12_V2 = "Standard_DS12_v2" + STANDARD_DS13_V2 = "Standard_DS13_v2" + STANDARD_DS14_V2 = "Standard_DS14_v2" + STANDARD_DS15_V2 = "Standard_DS15_v2" + STANDARD_DS13_4_V2 = "Standard_DS13-4_v2" + STANDARD_DS13_2_V2 = "Standard_DS13-2_v2" + STANDARD_DS14_8_V2 = "Standard_DS14-8_v2" + STANDARD_DS14_4_V2 = "Standard_DS14-4_v2" + STANDARD_E2_V3 = "Standard_E2_v3" + STANDARD_E4_V3 = "Standard_E4_v3" + STANDARD_E8_V3 = "Standard_E8_v3" + STANDARD_E16_V3 = "Standard_E16_v3" + STANDARD_E32_V3 = "Standard_E32_v3" + STANDARD_E64_V3 = "Standard_E64_v3" + STANDARD_E2_S_V3 = "Standard_E2s_v3" + STANDARD_E4_S_V3 = "Standard_E4s_v3" + STANDARD_E8_S_V3 = "Standard_E8s_v3" + STANDARD_E16_S_V3 = "Standard_E16s_v3" + STANDARD_E32_S_V3 = "Standard_E32s_v3" + STANDARD_E64_S_V3 = "Standard_E64s_v3" + STANDARD_E32_16_V3 = "Standard_E32-16_v3" + STANDARD_E32_8_S_V3 = "Standard_E32-8s_v3" + STANDARD_E64_32_S_V3 = "Standard_E64-32s_v3" + STANDARD_E64_16_S_V3 = "Standard_E64-16s_v3" + STANDARD_F1 = "Standard_F1" + STANDARD_F2 = "Standard_F2" + STANDARD_F4 = "Standard_F4" + STANDARD_F8 = "Standard_F8" + STANDARD_F16 = "Standard_F16" + STANDARD_F1_S = "Standard_F1s" + STANDARD_F2_S = "Standard_F2s" + STANDARD_F4_S = "Standard_F4s" + STANDARD_F8_S = "Standard_F8s" + STANDARD_F16_S = "Standard_F16s" + STANDARD_F2_S_V2 = "Standard_F2s_v2" + STANDARD_F4_S_V2 = "Standard_F4s_v2" + STANDARD_F8_S_V2 = "Standard_F8s_v2" + STANDARD_F16_S_V2 = "Standard_F16s_v2" + STANDARD_F32_S_V2 = "Standard_F32s_v2" + STANDARD_F64_S_V2 = "Standard_F64s_v2" + STANDARD_F72_S_V2 = "Standard_F72s_v2" + STANDARD_G1 = "Standard_G1" + STANDARD_G2 = "Standard_G2" + STANDARD_G3 = "Standard_G3" + STANDARD_G4 = "Standard_G4" + STANDARD_G5 = "Standard_G5" + STANDARD_GS1 = "Standard_GS1" + STANDARD_GS2 = "Standard_GS2" + STANDARD_GS3 = "Standard_GS3" + STANDARD_GS4 = "Standard_GS4" + STANDARD_GS5 = "Standard_GS5" + STANDARD_GS4_8 = "Standard_GS4-8" + STANDARD_GS4_4 = "Standard_GS4-4" + STANDARD_GS5_16 = "Standard_GS5-16" + STANDARD_GS5_8 = "Standard_GS5-8" + STANDARD_H8 = "Standard_H8" + STANDARD_H16 = "Standard_H16" + STANDARD_H8_M = "Standard_H8m" + STANDARD_H16_M = "Standard_H16m" + STANDARD_H16_R = "Standard_H16r" + STANDARD_H16_MR = "Standard_H16mr" + STANDARD_L4_S = "Standard_L4s" + STANDARD_L8_S = "Standard_L8s" + STANDARD_L16_S = "Standard_L16s" + STANDARD_L32_S = "Standard_L32s" + STANDARD_M64_S = "Standard_M64s" + STANDARD_M64_MS = "Standard_M64ms" + STANDARD_M128_S = "Standard_M128s" + STANDARD_M128_MS = "Standard_M128ms" + STANDARD_M64_32_MS = "Standard_M64-32ms" + STANDARD_M64_16_MS = "Standard_M64-16ms" + STANDARD_M128_64_MS = "Standard_M128-64ms" + STANDARD_M128_32_MS = "Standard_M128-32ms" + STANDARD_NC6 = "Standard_NC6" + STANDARD_NC12 = "Standard_NC12" + STANDARD_NC24 = "Standard_NC24" + STANDARD_NC24_R = "Standard_NC24r" + STANDARD_NC6_S_V2 = "Standard_NC6s_v2" + STANDARD_NC12_S_V2 = "Standard_NC12s_v2" + STANDARD_NC24_S_V2 = "Standard_NC24s_v2" + STANDARD_NC24_RS_V2 = "Standard_NC24rs_v2" + STANDARD_NC6_S_V3 = "Standard_NC6s_v3" + STANDARD_NC12_S_V3 = "Standard_NC12s_v3" + STANDARD_NC24_S_V3 = "Standard_NC24s_v3" + STANDARD_NC24_RS_V3 = "Standard_NC24rs_v3" + STANDARD_ND6_S = "Standard_ND6s" + STANDARD_ND12_S = "Standard_ND12s" + STANDARD_ND24_S = "Standard_ND24s" + STANDARD_ND24_RS = "Standard_ND24rs" + STANDARD_NV6 = "Standard_NV6" + STANDARD_NV12 = "Standard_NV12" + STANDARD_NV24 = "Standard_NV24" 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 70da329938b1..7d62132eebe3 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 @@ -1290,28 +1290,21 @@ def __init__( class DiffDiskSettings(msrest.serialization.Model): """Describes the parameters of ephemeral disk settings that can be specified for operating system disk. :code:`
`:code:`
` NOTE: The ephemeral disk settings can only be specified for managed disk. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar option: Specifies the ephemeral disk settings for operating system disk. Default value: - "Local". - :vartype option: str + :param option: Specifies the ephemeral disk settings for operating system disk. Possible values + include: "Local". + :type option: str or ~azure.mgmt.compute.v2019_03_01.models.DiffDiskOptions """ - _validation = { - 'option': {'constant': True}, - } - _attribute_map = { 'option': {'key': 'option', 'type': 'str'}, } - option = "Local" - def __init__( self, **kwargs ): super(DiffDiskSettings, self).__init__(**kwargs) + self.option = kwargs.get('option', None) class Disallowed(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 8d11f1bd3f83..342029e3ce17 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 @@ -1403,28 +1403,23 @@ def __init__( class DiffDiskSettings(msrest.serialization.Model): """Describes the parameters of ephemeral disk settings that can be specified for operating system disk. :code:`
`:code:`
` NOTE: The ephemeral disk settings can only be specified for managed disk. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar option: Specifies the ephemeral disk settings for operating system disk. Default value: - "Local". - :vartype option: str + :param option: Specifies the ephemeral disk settings for operating system disk. Possible values + include: "Local". + :type option: str or ~azure.mgmt.compute.v2019_03_01.models.DiffDiskOptions """ - _validation = { - 'option': {'constant': True}, - } - _attribute_map = { 'option': {'key': 'option', 'type': 'str'}, } - option = "Local" - def __init__( self, + *, + option: Optional[Union[str, "DiffDiskOptions"]] = None, **kwargs ): super(DiffDiskSettings, self).__init__(**kwargs) + self.option = option class Disallowed(msrest.serialization.Model): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_availability_sets_operations.py index a3d2d90f1415..528d1c83dacd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_availability_sets_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -67,10 +67,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -88,14 +91,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailabilitySet') 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 @@ -133,10 +134,13 @@ def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -154,14 +158,12 @@ def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailabilitySetUpdate') 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 @@ -196,7 +198,9 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -216,7 +220,6 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,9 +252,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -268,9 +274,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -295,7 +300,8 @@ def list_by_subscription( # type: (...) -> Iterable["models.AvailabilitySetListResult"] """Lists all availability sets in a subscription. - :param expand: The expand expression to apply to the operation. + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AvailabilitySetListResult or the result of cls(response) @@ -303,11 +309,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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_subscription.metadata['url'] # type: ignore @@ -321,15 +334,11 @@ def prepare_request(next_link=None): if expand is not None: query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -372,11 +381,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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 @@ -389,15 +405,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -432,7 +444,7 @@ def list_available_sizes( ): # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes that can be used to create a new virtual machine in - an existing availability set. + an existing availability set. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -444,11 +456,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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_available_sizes.metadata['url'] # type: ignore @@ -462,15 +481,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_host_groups_operations.py index 6ec2fc81f992..260a08c183ce 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_host_groups_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -69,10 +69,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -90,14 +93,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DedicatedHostGroup') 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 @@ -105,7 +106,6 @@ def create_or_update( 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('DedicatedHostGroup', pipeline_response) @@ -140,10 +140,13 @@ def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -161,14 +164,12 @@ def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DedicatedHostGroupUpdate') 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 @@ -203,7 +204,9 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -223,7 +226,6 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,9 +258,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -275,9 +280,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -301,7 +305,7 @@ def list_by_resource_group( ): # type: (...) -> Iterable["models.DedicatedHostGroupListResult"] """Lists all of the dedicated host groups in the specified resource group. Use the nextLink - property in the response to get the next page of dedicated host groups. + property in the response to get the next page of dedicated host groups. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -311,11 +315,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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 @@ -328,15 +339,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -369,7 +376,7 @@ def list_by_subscription( ): # type: (...) -> Iterable["models.DedicatedHostGroupListResult"] """Lists all of the dedicated host groups in the subscription. Use the nextLink property in the - response to get the next page of dedicated host groups. + response to get the next page of dedicated host groups. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DedicatedHostGroupListResult or the result of cls(response) @@ -377,11 +384,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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_subscription.metadata['url'] # type: ignore @@ -393,15 +407,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_hosts_operations.py index 84bb4c1720a4..0ecc81dd5914 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_hosts_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -57,10 +57,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.DedicatedHost" cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -79,14 +82,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DedicatedHost') 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 @@ -94,7 +95,6 @@ def _create_or_update_initial( 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('DedicatedHost', pipeline_response) @@ -115,7 +115,7 @@ def begin_create_or_update( parameters, # type: "models.DedicatedHost" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DedicatedHost"] """Create or update a dedicated host . :param resource_group_name: The name of the resource group. @@ -187,10 +187,13 @@ def _update_initial( ): # type: (...) -> "models.DedicatedHost" cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -209,14 +212,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DedicatedHostUpdate') 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 @@ -240,7 +241,7 @@ def begin_update( parameters, # type: "models.DedicatedHostUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DedicatedHost"] """Update an dedicated host . :param resource_group_name: The name of the resource group. @@ -311,7 +312,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -332,7 +335,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -353,7 +355,7 @@ def begin_delete( host_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Delete a dedicated host. :param resource_group_name: The name of the resource group. @@ -434,9 +436,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -456,9 +461,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -483,7 +487,7 @@ def list_by_host_group( ): # type: (...) -> Iterable["models.DedicatedHostListResult"] """Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink - property in the response to get the next page of dedicated hosts. + property in the response to get the next page of dedicated hosts. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -495,11 +499,18 @@ def list_by_host_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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_host_group.metadata['url'] # type: ignore @@ -513,15 +524,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_disks_operations.py index 5853a54aee0f..f937e56388e2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_disks_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.Disk" cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('Disk', pipeline_response) @@ -112,14 +112,14 @@ def begin_create_or_update( disk, # type: "models.Disk" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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.v2019_03_01.models.Disk @@ -182,10 +182,13 @@ def _update_initial( ): # type: (...) -> "models.Disk" cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -203,14 +206,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -218,7 +219,6 @@ def _update_initial( 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('Disk', pipeline_response) @@ -238,14 +238,14 @@ def begin_update( disk, # type: "models.DiskUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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.v2019_03_01.models.DiskUpdate @@ -320,9 +320,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -339,9 +342,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -366,7 +368,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -386,7 +390,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -406,14 +409,14 @@ def begin_delete( disk_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. @@ -477,11 +480,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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 @@ -494,15 +504,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -542,11 +548,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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 @@ -558,15 +571,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -600,12 +609,15 @@ def _grant_access_initial( grant_access_data, # type: "models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> "models.AccessUri" - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # 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 = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._grant_access_initial.metadata['url'] # type: ignore @@ -623,14 +635,12 @@ def _grant_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -655,17 +665,17 @@ def begin_grant_access( grant_access_data, # type: "models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. + operation. :type grant_access_data: ~azure.mgmt.compute.v2019_03_01.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. @@ -725,7 +735,9 @@ def _revoke_access_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -745,7 +757,6 @@ def _revoke_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -765,14 +776,14 @@ def begin_revoke_access( disk_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_galleries_operations.py index f07ff585aa10..144a47bb737d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_galleries_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.Gallery" cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery, 'Gallery') 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('Gallery', pipeline_response) @@ -115,13 +115,13 @@ def begin_create_or_update( gallery, # type: "models.Gallery" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Gallery"] """Create or update a Shared Image Gallery. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery. The allowed characters are alphabets - and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. + and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. :type gallery_name: str :param gallery: Parameters supplied to the create or update Shared Image Gallery operation. :type gallery: ~azure.mgmt.compute.v2019_03_01.models.Gallery @@ -194,9 +194,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -213,9 +216,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -240,9 +242,12 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -259,8 +264,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -280,7 +285,7 @@ def begin_delete( gallery_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Delete a Shared Image Gallery. :param resource_group_name: The name of the resource group. @@ -349,11 +354,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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 @@ -366,15 +378,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -414,11 +422,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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 @@ -430,15 +445,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_application_versions_operations.py index c4a123ec9a25..fc9495b0e662 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_application_versions_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -58,10 +58,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.GalleryApplicationVersion" cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -81,14 +84,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_application_version, 'GalleryApplicationVersion') 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 @@ -96,7 +97,6 @@ def _create_or_update_initial( 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('GalleryApplicationVersion', pipeline_response) @@ -121,24 +121,24 @@ def begin_create_or_update( gallery_application_version, # type: "models.GalleryApplicationVersion" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GalleryApplicationVersion"] """Create or update a gallery Application Version. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. + Definition resides. :type gallery_name: str :param gallery_application_name: The name of the gallery Application Definition in which the - Application Version is to be created. + Application Version is to be created. :type gallery_application_name: str :param gallery_application_version_name: The name of the gallery Application Version to be - created. Needs to follow semantic version name pattern: The allowed characters are digit and - period. Digits must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. + created. Needs to follow semantic version name pattern: The allowed characters are digit and + period. Digits must be within the range of a 32-bit integer. Format: + :code:``.:code:``.:code:``. :type gallery_application_version_name: str :param gallery_application_version: Parameters supplied to the create or update gallery - Application Version operation. + Application Version operation. :type gallery_application_version: ~azure.mgmt.compute.v2019_03_01.models.GalleryApplicationVersion :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. @@ -198,7 +198,7 @@ def get( gallery_name, # type: str gallery_application_name, # type: str gallery_application_version_name, # type: str - expand="ReplicationStatus", # type: Optional[str] + expand=None, # type: Optional[Union[str, "models.ReplicationStatusTypes"]] **kwargs # type: Any ): # type: (...) -> "models.GalleryApplicationVersion" @@ -216,16 +216,19 @@ def get( retrieved. :type gallery_application_version_name: str :param expand: The expand expression to apply on the operation. - :type expand: str + :type expand: str or ~azure.mgmt.compute.v2019_03_01.models.ReplicationStatusTypes :keyword callable cls: A custom type or function that will be passed the direct response :return: GalleryApplicationVersion, or the result of cls(response) :rtype: ~azure.mgmt.compute.v2019_03_01.models.GalleryApplicationVersion :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -246,9 +249,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -275,9 +277,12 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -296,8 +301,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -319,19 +324,19 @@ def begin_delete( gallery_application_version_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Delete a gallery Application Version. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. + Definition resides. :type gallery_name: str :param gallery_application_name: The name of the gallery Application Definition in which the - Application Version resides. + Application Version resides. :type gallery_application_name: str :param gallery_application_version_name: The name of the gallery Application Version to be - deleted. + deleted. :type gallery_application_version_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. @@ -394,10 +399,10 @@ def list_by_gallery_application( :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. + Definition resides. :type gallery_name: str :param gallery_application_name: The name of the Shared Application Gallery Application - Definition from which the Application Versions are to be listed. + Definition from which the Application Versions are to be listed. :type gallery_application_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GalleryApplicationVersionList or the result of cls(response) @@ -405,11 +410,18 @@ def list_by_gallery_application( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersionList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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_gallery_application.metadata['url'] # type: ignore @@ -424,15 +436,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_applications_operations.py index 38dcebbac963..47ac3bedda5e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_applications_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -57,10 +57,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.GalleryApplication" cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -79,14 +82,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_application, 'GalleryApplication') 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 @@ -94,7 +95,6 @@ def _create_or_update_initial( 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('GalleryApplication', pipeline_response) @@ -118,20 +118,20 @@ def begin_create_or_update( gallery_application, # type: "models.GalleryApplication" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GalleryApplication"] """Create or update a gallery Application Definition. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition is to be created. + Definition is to be created. :type gallery_name: str :param gallery_application_name: The name of the gallery Application Definition to be created - or updated. The allowed characters are alphabets and numbers with dots, dashes, and periods - allowed in the middle. The maximum length is 80 characters. + or updated. The allowed characters are alphabets and numbers with dots, dashes, and periods + allowed in the middle. The maximum length is 80 characters. :type gallery_application_name: str :param gallery_application: Parameters supplied to the create or update gallery Application - operation. + operation. :type gallery_application: ~azure.mgmt.compute.v2019_03_01.models.GalleryApplication :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. @@ -208,9 +208,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -228,9 +231,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,9 +258,12 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -276,8 +281,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -298,13 +303,13 @@ def begin_delete( gallery_application_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Delete a gallery Application. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition is to be deleted. + Definition is to be deleted. :type gallery_name: str :param gallery_application_name: The name of the gallery Application Definition to be deleted. :type gallery_application_name: str @@ -367,7 +372,7 @@ def list_by_gallery( :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery from which Application - Definitions are to be listed. + Definitions are to be listed. :type gallery_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GalleryApplicationList or the result of cls(response) @@ -375,11 +380,18 @@ def list_by_gallery( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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_gallery.metadata['url'] # type: ignore @@ -393,15 +405,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_image_versions_operations.py index 8904ab844256..4f316446431a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_image_versions_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -58,10 +58,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.GalleryImageVersion" cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -81,14 +84,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_image_version, 'GalleryImageVersion') 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 @@ -96,7 +97,6 @@ def _create_or_update_initial( 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('GalleryImageVersion', pipeline_response) @@ -121,24 +121,24 @@ def begin_create_or_update( gallery_image_version, # type: "models.GalleryImageVersion" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GalleryImageVersion"] """Create or update a gallery Image Version. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. + resides. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition in which the Image Version - is to be created. + is to be created. :type gallery_image_name: str :param gallery_image_version_name: The name of the gallery Image Version to be created. Needs - to follow semantic version name pattern: The allowed characters are digit and period. Digits - must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. + to follow semantic version name pattern: The allowed characters are digit and period. Digits + must be within the range of a 32-bit integer. Format: + :code:``.:code:``.:code:``. :type gallery_image_version_name: str :param gallery_image_version: Parameters supplied to the create or update gallery Image Version - operation. + operation. :type gallery_image_version: ~azure.mgmt.compute.v2019_03_01.models.GalleryImageVersion :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. @@ -198,7 +198,7 @@ def get( gallery_name, # type: str gallery_image_name, # type: str gallery_image_version_name, # type: str - expand="ReplicationStatus", # type: Optional[str] + expand=None, # type: Optional[Union[str, "models.ReplicationStatusTypes"]] **kwargs # type: Any ): # type: (...) -> "models.GalleryImageVersion" @@ -215,16 +215,19 @@ def get( :param gallery_image_version_name: The name of the gallery Image Version to be retrieved. :type gallery_image_version_name: str :param expand: The expand expression to apply on the operation. - :type expand: str + :type expand: str or ~azure.mgmt.compute.v2019_03_01.models.ReplicationStatusTypes :keyword callable cls: A custom type or function that will be passed the direct response :return: GalleryImageVersion, or the result of cls(response) :rtype: ~azure.mgmt.compute.v2019_03_01.models.GalleryImageVersion :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -245,9 +248,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -274,9 +276,12 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -295,8 +300,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -318,16 +323,16 @@ def begin_delete( gallery_image_version_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Delete a gallery Image Version. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. + resides. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition in which the Image Version - resides. + resides. :type gallery_image_name: str :param gallery_image_version_name: The name of the gallery Image Version to be deleted. :type gallery_image_version_name: str @@ -392,10 +397,10 @@ def list_by_gallery_image( :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. + resides. :type gallery_name: str :param gallery_image_name: The name of the Shared Image Gallery Image Definition from which the - Image Versions are to be listed. + Image Versions are to be listed. :type gallery_image_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GalleryImageVersionList or the result of cls(response) @@ -403,11 +408,18 @@ def list_by_gallery_image( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersionList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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_gallery_image.metadata['url'] # type: ignore @@ -422,15 +434,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_images_operations.py index e2f88cf1c9fb..19da796db09f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_images_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -57,10 +57,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.GalleryImage" cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -79,14 +82,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_image, 'GalleryImage') 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 @@ -94,7 +95,6 @@ def _create_or_update_initial( 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('GalleryImage', pipeline_response) @@ -118,17 +118,17 @@ def begin_create_or_update( gallery_image, # type: "models.GalleryImage" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GalleryImage"] """Create or update a gallery Image Definition. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to - be created. + be created. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition to be created or updated. - The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the - middle. The maximum length is 80 characters. + The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the + middle. The maximum length is 80 characters. :type gallery_image_name: str :param gallery_image: Parameters supplied to the create or update gallery image operation. :type gallery_image: ~azure.mgmt.compute.v2019_03_01.models.GalleryImage @@ -206,9 +206,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -226,9 +229,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,9 +256,12 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -274,8 +279,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -296,13 +301,13 @@ def begin_delete( gallery_image_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Delete a gallery image. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to - be deleted. + be deleted. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition to be deleted. :type gallery_image_name: str @@ -365,7 +370,7 @@ def list_by_gallery( :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery from which Image Definitions are to - be listed. + be listed. :type gallery_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GalleryImageList or the result of cls(response) @@ -373,11 +378,18 @@ def list_by_gallery( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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_gallery.metadata['url'] # type: ignore @@ -391,15 +403,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_images_operations.py index 87badaf386fa..65155a2e97aa 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_images_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.Image" cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'Image') 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('Image', pipeline_response) @@ -112,7 +112,7 @@ def begin_create_or_update( parameters, # type: "models.Image" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Image"] """Create or update an image. :param resource_group_name: The name of the resource group. @@ -180,10 +180,13 @@ def _update_initial( ): # type: (...) -> "models.Image" cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -201,14 +204,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ImageUpdate') 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 @@ -216,7 +217,6 @@ def _update_initial( 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('Image', pipeline_response) @@ -236,7 +236,7 @@ def begin_update( parameters, # type: "models.ImageUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Image"] """Update an image. :param resource_group_name: The name of the resource group. @@ -303,7 +303,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -323,7 +325,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -343,7 +344,7 @@ def begin_delete( image_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes an Image. :param resource_group_name: The name of the resource group. @@ -418,9 +419,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -439,9 +443,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -474,11 +477,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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 @@ -491,15 +501,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -532,7 +538,7 @@ def list( ): # type: (...) -> Iterable["models.ImageListResult"] """Gets the list of Images in the subscription. Use nextLink property in the response to get the - next page of Images. Do this till nextLink is null to fetch all the Images. + next page of Images. Do this till nextLink is null to fetch all the Images. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ImageListResult or the result of cls(response) @@ -540,11 +546,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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 @@ -556,15 +569,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_log_analytics_operations.py index 0af815451016..229907bb477a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_log_analytics_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod @@ -52,12 +52,15 @@ def _export_request_rate_by_interval_initial( parameters, # type: "models.RequestRateByIntervalInput" **kwargs # type: Any ): - # type: (...) -> "models.LogAnalyticsOperationResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._export_request_rate_by_interval_initial.metadata['url'] # type: ignore @@ -74,14 +77,12 @@ def _export_request_rate_by_interval_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RequestRateByIntervalInput') 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 @@ -105,9 +106,9 @@ def begin_export_request_rate_by_interval( parameters, # type: "models.RequestRateByIntervalInput" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LogAnalyticsOperationResult"] """Export logs that show Api requests made by this subscription in the given time window to show - throttling activities. + throttling activities. :param location: The location upon which virtual-machine-sizes is queried. :type location: str @@ -168,12 +169,15 @@ def _export_throttled_requests_initial( parameters, # type: "models.LogAnalyticsInputBase" **kwargs # type: Any ): - # type: (...) -> "models.LogAnalyticsOperationResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._export_throttled_requests_initial.metadata['url'] # type: ignore @@ -190,14 +194,12 @@ def _export_throttled_requests_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LogAnalyticsInputBase') 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 @@ -221,9 +223,9 @@ def begin_export_throttled_requests( parameters, # type: "models.LogAnalyticsInputBase" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LogAnalyticsOperationResult"] """Export logs that show total throttled Api requests for this subscription in the given time - window. + window. :param location: The location upon which virtual-machine-sizes is queried. :type location: str diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_operations.py index b6b54921d487..5f4673ddc931 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -58,11 +58,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeOperationListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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 @@ -70,15 +77,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_proximity_placement_groups_operations.py index 2a2325809f17..0869eeaf9f67 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_proximity_placement_groups_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -67,10 +67,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -88,14 +91,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ProximityPlacementGroup') 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 @@ -103,7 +104,6 @@ def create_or_update( 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('ProximityPlacementGroup', pipeline_response) @@ -138,10 +138,13 @@ def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -159,14 +162,12 @@ def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'UpdateResource') 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 @@ -201,7 +202,9 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -221,7 +224,6 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,9 +256,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -273,9 +278,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -305,11 +309,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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_subscription.metadata['url'] # type: ignore @@ -321,15 +332,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -372,11 +379,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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 @@ -389,15 +403,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_snapshots_operations.py index f4b05256f017..ffb6f073eb31 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_snapshots_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.Snapshot" cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('Snapshot', pipeline_response) @@ -112,14 +112,14 @@ def begin_create_or_update( snapshot, # type: "models.Snapshot" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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.v2019_03_01.models.Snapshot @@ -182,10 +182,13 @@ def _update_initial( ): # type: (...) -> "models.Snapshot" cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -203,14 +206,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -218,7 +219,6 @@ def _update_initial( 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('Snapshot', pipeline_response) @@ -238,14 +238,14 @@ def begin_update( snapshot, # type: "models.SnapshotUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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.v2019_03_01.models.SnapshotUpdate @@ -320,9 +320,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -339,9 +342,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -366,7 +368,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -386,7 +390,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -406,14 +409,14 @@ def begin_delete( snapshot_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. @@ -477,11 +480,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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 @@ -494,15 +504,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -542,11 +548,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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 @@ -558,15 +571,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -600,12 +609,15 @@ def _grant_access_initial( grant_access_data, # type: "models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> "models.AccessUri" - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # 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 = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._grant_access_initial.metadata['url'] # type: ignore @@ -623,14 +635,12 @@ def _grant_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -655,17 +665,17 @@ def begin_grant_access( grant_access_data, # type: "models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. + operation. :type grant_access_data: ~azure.mgmt.compute.v2019_03_01.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. @@ -725,7 +735,9 @@ def _revoke_access_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -745,7 +757,6 @@ def _revoke_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -765,14 +776,14 @@ def begin_revoke_access( snapshot_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_usage_operations.py index 0cf3be42cfc4..1d49856c13b4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_usage_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,7 +52,7 @@ def list( ): # type: (...) -> Iterable["models.ListUsagesResult"] """Gets, for the specified location, the current compute resource usage information as well as the - limits for compute resources under the subscription. + limits for compute resources under the subscription. :param location: The location for which resource usage is queried. :type location: str @@ -62,11 +62,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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 @@ -79,15 +86,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_extension_images_operations.py index 9597e39c5cfb..b7dbb7b2b85a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_extension_images_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -69,9 +69,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -90,9 +93,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -128,9 +130,12 @@ def list_types( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.list_types.metadata['url'] # type: ignore @@ -147,9 +152,8 @@ def list_types( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -197,9 +201,12 @@ def list_versions( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.list_versions.metadata['url'] # type: ignore @@ -223,9 +230,8 @@ def list_versions( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_extensions_operations.py index fb60c3fdfc67..f3e15865c4c5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_extensions_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachineExtension" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -78,14 +81,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtension') 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 @@ -93,7 +94,6 @@ def _create_or_update_initial( 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('VirtualMachineExtension', pipeline_response) @@ -114,18 +114,18 @@ def begin_create_or_update( extension_parameters, # type: "models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineExtension"] """The operation to create or update the extension. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_name: The name of the virtual machine where the extension should be created or - updated. + updated. :type vm_name: str :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Create Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineExtension :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. @@ -188,10 +188,13 @@ def _update_initial( ): # type: (...) -> "models.VirtualMachineExtension" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -210,14 +213,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtensionUpdate') 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 @@ -241,7 +242,7 @@ def begin_update( extension_parameters, # type: "models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineExtension"] """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -251,7 +252,7 @@ def begin_update( :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Update Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineExtensionUpdate :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. @@ -313,7 +314,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -334,7 +337,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -355,7 +357,7 @@ def begin_delete( vm_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -436,9 +438,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -458,9 +463,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -499,9 +503,12 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -520,9 +527,8 @@ def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_images_operations.py index 6a170615902e..0855b6112386 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_images_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -72,9 +72,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -94,9 +97,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -148,9 +150,12 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -175,9 +180,8 @@ def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -213,9 +217,12 @@ def list_offers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.list_offers.metadata['url'] # type: ignore @@ -232,9 +239,8 @@ def list_offers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -267,9 +273,12 @@ def list_publishers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.list_publishers.metadata['url'] # type: ignore @@ -285,9 +294,8 @@ def list_publishers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -326,9 +334,12 @@ def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.list_skus.metadata['url'] # type: ignore @@ -346,9 +357,8 @@ def list_skus( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_run_commands_operations.py index 067215da117b..4fc1d9008a9f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_run_commands_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -61,11 +61,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json, text/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 @@ -78,15 +85,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -132,9 +135,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandDocument"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json, text/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -151,9 +157,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_extensions_operations.py index 3c11f96bec77..b546383f0e42 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -57,10 +57,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachineScaleSetExtension" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -79,14 +82,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineScaleSetExtension') 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 @@ -94,7 +95,6 @@ def _create_or_update_initial( 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('VirtualMachineScaleSetExtension', pipeline_response) @@ -115,18 +115,18 @@ def begin_create_or_update( extension_parameters, # type: "models.VirtualMachineScaleSetExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineScaleSetExtension"] """The operation to create or update an extension. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_scale_set_name: The name of the VM scale set where the extension should be create or - updated. + updated. :type vm_scale_set_name: str :param vmss_extension_name: The name of the VM scale set extension. :type vmss_extension_name: str :param extension_parameters: Parameters supplied to the Create VM scale set Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSetExtension :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. @@ -188,7 +188,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -209,7 +211,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -230,7 +231,7 @@ def begin_delete( vmss_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -311,9 +312,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -333,9 +337,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -371,11 +374,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtensionListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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 @@ -389,15 +399,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index cab6ce6e9e15..06c88508528f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod @@ -54,7 +54,9 @@ def _cancel_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -74,7 +76,6 @@ def _cancel_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -94,7 +95,7 @@ def begin_cancel( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Cancels the current virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -155,7 +156,9 @@ def _start_os_upgrade_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -175,7 +178,6 @@ def _start_os_upgrade_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -195,10 +197,10 @@ def begin_start_os_upgrade( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts a rolling upgrade to move all virtual machine scale set instances to the latest - available Platform Image OS version. Instances which are already running the latest available - OS version are not affected. + available Platform Image OS version. Instances which are already running the latest available + OS version are not affected. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -258,7 +260,9 @@ def _start_extension_upgrade_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -278,7 +282,6 @@ def _start_extension_upgrade_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -298,10 +301,10 @@ def begin_start_extension_upgrade( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to - the latest available extension version. Instances which are already running the latest - extension versions are not affected. + the latest available extension version. Instances which are already running the latest + extension versions are not affected. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -372,9 +375,12 @@ def get_latest( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RollingUpgradeStatusInfo"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get_latest.metadata['url'] # type: ignore @@ -391,9 +397,8 @@ def get_latest( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_vms_operations.py index ab82ebef434a..376a32c03579 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -57,7 +57,9 @@ def _reimage_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") @@ -80,7 +82,6 @@ def _reimage_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_scale_set_vm_reimage_input is not None: body_content = self._serialize.body(vm_scale_set_vm_reimage_input, 'VirtualMachineReimageParameters') @@ -88,7 +89,6 @@ def _reimage_initial( body_content = None 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 @@ -109,7 +109,7 @@ def begin_reimage( vm_scale_set_vm_reimage_input=None, # type: Optional["models.VirtualMachineReimageParameters"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -177,7 +177,9 @@ def _reimage_all_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -198,7 +200,6 @@ def _reimage_all_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -219,9 +220,9 @@ def begin_reimage_all( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. - This operation is only supported for managed disks. + This operation is only supported for managed disks. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -285,7 +286,9 @@ def _deallocate_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -306,7 +309,6 @@ def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -327,10 +329,10 @@ def begin_deallocate( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and - releases the compute resources it uses. You are not billed for the compute resources of this - virtual machine once it is deallocated. + releases the compute resources it uses. You are not billed for the compute resources of this + virtual machine once it is deallocated. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -395,10 +397,13 @@ def _update_initial( ): # type: (...) -> "models.VirtualMachineScaleSetVM" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -417,14 +422,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSetVM') 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 @@ -432,7 +435,6 @@ def _update_initial( 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('VirtualMachineScaleSetVM', pipeline_response) @@ -453,13 +455,13 @@ def begin_update( parameters, # type: "models.VirtualMachineScaleSetVM" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineScaleSetVM"] """Updates a virtual machine of a VM scale set. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_scale_set_name: The name of the VM scale set where the extension should be create or - updated. + updated. :type vm_scale_set_name: str :param instance_id: The instance ID of the virtual machine. :type instance_id: str @@ -525,7 +527,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -546,7 +550,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -567,7 +570,7 @@ def begin_delete( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -648,9 +651,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -670,9 +676,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -711,9 +716,12 @@ def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -731,9 +739,8 @@ def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -766,11 +773,14 @@ def list( :type resource_group_name: str :param virtual_machine_scale_set_name: The name of the VM scale set. :type virtual_machine_scale_set_name: str - :param filter: The filter to apply to the operation. + :param filter: The filter to apply to the operation. Allowed values are + 'startswith(instanceView/statuses/code, 'PowerState') eq true', 'properties/latestModelApplied + eq true', 'properties/latestModelApplied eq false'. :type filter: str - :param select: The list parameters. + :param select: The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. :type select: str - :param expand: The expand expression to apply to the operation. + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetVMListResult or the result of cls(response) @@ -778,11 +788,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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 @@ -802,15 +819,11 @@ def prepare_request(next_link=None): query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -847,7 +860,9 @@ def _power_off_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -870,7 +885,6 @@ def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -892,10 +906,10 @@ def begin_power_off( skip_shutdown=False, # type: Optional[bool] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached - and you are getting charged for the resources. Instead, use deallocate to release resources and - avoid charges. + and you are getting charged for the resources. Instead, use deallocate to release resources and + avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -904,8 +918,8 @@ def begin_power_off( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param skip_shutdown: The parameter to request non-graceful VM shutdown. True value for this - flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this - flag is false if not specified. + flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this + flag is false if not specified. :type skip_shutdown: 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. @@ -964,7 +978,9 @@ def _restart_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -985,7 +1001,6 @@ def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1006,7 +1021,7 @@ def begin_restart( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Restarts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1071,7 +1086,9 @@ def _start_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -1092,7 +1109,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1113,7 +1129,7 @@ def begin_start( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1178,7 +1194,9 @@ def _redeploy_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -1199,7 +1217,6 @@ def _redeploy_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1220,9 +1237,9 @@ def begin_redeploy( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and - powers it back on. + powers it back on. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1286,7 +1303,9 @@ def _perform_maintenance_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -1307,7 +1326,6 @@ def _perform_maintenance_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1328,7 +1346,7 @@ def begin_perform_maintenance( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Performs maintenance on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1392,12 +1410,15 @@ def _run_command_initial( parameters, # type: "models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> "models.RunCommandResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" # Construct URL url = self._run_command_initial.metadata['url'] # type: ignore @@ -1416,14 +1437,12 @@ def _run_command_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RunCommandInput') 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 @@ -1449,7 +1468,7 @@ def begin_run_command( parameters, # type: "models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RunCommandResult"] """Run command on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_sets_operations.py index e6cab03b69c6..3d2631794080 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_sets_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachineScaleSet" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSet') 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('VirtualMachineScaleSet', pipeline_response) @@ -112,7 +112,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualMachineScaleSet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -180,10 +180,13 @@ def _update_initial( ): # type: (...) -> "models.VirtualMachineScaleSet" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -201,14 +204,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSetUpdate') 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 @@ -231,7 +232,7 @@ def begin_update( parameters, # type: "models.VirtualMachineScaleSetUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] """Update a VM scale set. :param resource_group_name: The name of the resource group. @@ -298,7 +299,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -318,7 +321,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -338,7 +340,7 @@ def begin_delete( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VM scale set. :param resource_group_name: The name of the resource group. @@ -410,9 +412,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -429,9 +434,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -457,7 +461,9 @@ def _deallocate_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") @@ -479,7 +485,6 @@ def _deallocate_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -487,7 +492,6 @@ def _deallocate_initial( body_content = None 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 @@ -507,10 +511,10 @@ def begin_deallocate( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and - releases the compute resources. You are not billed for the compute resources that this virtual - machine scale set deallocates. + releases the compute resources. You are not billed for the compute resources that this virtual + machine scale set deallocates. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -574,7 +578,9 @@ def _delete_instances_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") @@ -596,12 +602,10 @@ def _delete_instances_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -621,7 +625,7 @@ def begin_delete_instances( vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -696,9 +700,12 @@ def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -715,9 +722,8 @@ def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -750,11 +756,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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 @@ -767,15 +780,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -808,8 +817,8 @@ def list_all( ): # type: (...) -> Iterable["models.VirtualMachineScaleSetListWithLinkResult"] """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource - group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this - till nextLink is null to fetch all the VM Scale Sets. + group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this + till nextLink is null to fetch all the VM Scale Sets. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetListWithLinkResult or the result of cls(response) @@ -817,11 +826,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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_all.metadata['url'] # type: ignore @@ -833,15 +849,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -876,7 +888,7 @@ def list_skus( ): # type: (...) -> Iterable["models.VirtualMachineScaleSetListSkusResult"] """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM - instances allowed for each SKU. + instances allowed for each SKU. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -888,11 +900,18 @@ def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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_skus.metadata['url'] # type: ignore @@ -906,15 +925,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -960,11 +975,18 @@ def get_os_upgrade_history( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListOSUpgradeHistory"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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.get_os_upgrade_history.metadata['url'] # type: ignore @@ -978,15 +1000,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1023,7 +1041,9 @@ def _power_off_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") @@ -1047,7 +1067,6 @@ def _power_off_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1055,7 +1074,6 @@ def _power_off_initial( body_content = None 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 @@ -1076,18 +1094,18 @@ def begin_power_off( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still - attached and you are getting charged for the resources. Instead, use deallocate to release - resources and avoid charges. + attached and you are getting charged for the resources. Instead, use deallocate to release + resources and avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_scale_set_name: The name of the VM scale set. :type vm_scale_set_name: str :param skip_shutdown: The parameter to request non-graceful VM shutdown. True value for this - flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this - flag is false if not specified. + flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this + flag is false if not specified. :type skip_shutdown: bool :param vm_instance_i_ds: A list of virtual machine instance IDs from the VM scale set. :type vm_instance_i_ds: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSetVMInstanceIDs @@ -1148,7 +1166,9 @@ def _restart_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") @@ -1170,7 +1190,6 @@ def _restart_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1178,7 +1197,6 @@ def _restart_initial( body_content = None 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 @@ -1198,7 +1216,7 @@ def begin_restart( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Restarts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1263,7 +1281,9 @@ def _start_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") @@ -1285,7 +1305,6 @@ def _start_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1293,7 +1312,6 @@ def _start_initial( body_content = None 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 @@ -1313,7 +1331,7 @@ def begin_start( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1378,7 +1396,9 @@ def _redeploy_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") @@ -1400,7 +1420,6 @@ def _redeploy_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1408,7 +1427,6 @@ def _redeploy_initial( body_content = None 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 @@ -1428,9 +1446,9 @@ def begin_redeploy( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, - and powers them back on. + and powers them back on. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1494,7 +1512,9 @@ def _perform_maintenance_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") @@ -1516,7 +1536,6 @@ def _perform_maintenance_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1524,7 +1543,6 @@ def _perform_maintenance_initial( body_content = None 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 @@ -1544,11 +1562,11 @@ def begin_perform_maintenance( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances - which are not eligible for perform maintenance will be failed. Please refer to best practices - for more details: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual- - machine-scale-sets-maintenance-notifications. + which are not eligible for perform maintenance will be failed. Please refer to best practices + for more details: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual- + machine-scale-sets-maintenance-notifications. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1612,7 +1630,9 @@ def _update_instances_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") @@ -1634,12 +1654,10 @@ def _update_instances_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -1659,7 +1677,7 @@ def begin_update_instances( vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. :param resource_group_name: The name of the resource group. @@ -1724,7 +1742,9 @@ def _reimage_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") @@ -1746,7 +1766,6 @@ def _reimage_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_scale_set_reimage_input is not None: body_content = self._serialize.body(vm_scale_set_reimage_input, 'VirtualMachineScaleSetReimageParameters') @@ -1754,7 +1773,6 @@ def _reimage_initial( body_content = None 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 @@ -1774,10 +1792,10 @@ def begin_reimage( vm_scale_set_reimage_input=None, # type: Optional["models.VirtualMachineScaleSetReimageParameters"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which - don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual - machine is reset to initial state. + don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual + machine is reset to initial state. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1841,7 +1859,9 @@ def _reimage_all_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") @@ -1863,7 +1883,6 @@ def _reimage_all_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1871,7 +1890,6 @@ def _reimage_all_initial( body_content = None 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 @@ -1891,9 +1909,9 @@ def begin_reimage_all( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This - operation is only supported for managed disks. + operation is only supported for managed disks. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1972,9 +1990,12 @@ def force_recovery_service_fabric_platform_update_domain_walk( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RecoveryWalkResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.force_recovery_service_fabric_platform_update_domain_walk.metadata['url'] # type: ignore @@ -1992,9 +2013,8 @@ def force_recovery_service_fabric_platform_update_domain_walk( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -2033,8 +2053,11 @@ def convert_to_single_placement_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL @@ -2048,17 +2071,16 @@ def convert_to_single_placement_group( # 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') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VMScaleSetConvertToSinglePlacementGroupInput') 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_sizes_operations.py index 1df4b6524911..524848604bc5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_sizes_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,7 +52,7 @@ def list( ): # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] """This API is deprecated. Use `Resources Skus `_. + us/rest/api/compute/resourceskus/list>`_. :param location: The location upon which virtual-machine-sizes is queried. :type location: str @@ -62,11 +62,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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 @@ -79,15 +86,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machines_operations.py index 0e297c827a15..5cd0c795bfc5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machines_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -63,11 +63,18 @@ def list_by_location( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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_location.metadata['url'] # type: ignore @@ -80,15 +87,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -122,12 +125,15 @@ def _capture_initial( parameters, # type: "models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._capture_initial.metadata['url'] # type: ignore @@ -145,14 +151,12 @@ def _capture_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineCaptureParameters') 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 @@ -177,9 +181,9 @@ def begin_capture( parameters, # type: "models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineCaptureResult"] """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used - to create similar VMs. + to create similar VMs. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -246,10 +250,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachine" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -267,14 +274,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachine') 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 @@ -282,7 +287,6 @@ def _create_or_update_initial( 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('VirtualMachine', pipeline_response) @@ -302,7 +306,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualMachine" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachine"] """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -370,10 +374,13 @@ def _update_initial( ): # type: (...) -> "models.VirtualMachine" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -391,14 +398,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineUpdate') 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 @@ -406,7 +411,6 @@ def _update_initial( 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('VirtualMachine', pipeline_response) @@ -426,7 +430,7 @@ def begin_update( parameters, # type: "models.VirtualMachineUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachine"] """The operation to update a virtual machine. :param resource_group_name: The name of the resource group. @@ -493,7 +497,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -513,7 +519,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -533,7 +538,7 @@ def begin_delete( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to delete a virtual machine. :param resource_group_name: The name of the resource group. @@ -608,9 +613,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -629,9 +637,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -667,9 +674,12 @@ def instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.instance_view.metadata['url'] # type: ignore @@ -686,9 +696,8 @@ def instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -713,7 +722,9 @@ def _convert_to_managed_disks_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -733,7 +744,6 @@ def _convert_to_managed_disks_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -753,9 +763,9 @@ def begin_convert_to_managed_disks( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop- - deallocated before invoking this operation. + deallocated before invoking this operation. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -815,7 +825,9 @@ def _deallocate_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -835,7 +847,6 @@ def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -855,9 +866,9 @@ def begin_deallocate( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Shuts down the virtual machine and releases the compute resources. You are not billed for the - compute resources that this virtual machine uses. + compute resources that this virtual machine uses. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -928,7 +939,9 @@ def generalize( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -948,7 +961,6 @@ def generalize( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -969,7 +981,7 @@ def list( ): # type: (...) -> Iterable["models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified resource group. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -979,11 +991,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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 @@ -996,15 +1015,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1037,7 +1052,7 @@ def list_all( ): # type: (...) -> Iterable["models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified subscription. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineListResult or the result of cls(response) @@ -1045,11 +1060,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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_all.metadata['url'] # type: ignore @@ -1061,15 +1083,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1104,7 +1122,7 @@ def list_available_sizes( ): # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes to which the specified virtual machine can be - resized. + resized. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1116,11 +1134,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + 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_available_sizes.metadata['url'] # type: ignore @@ -1134,15 +1159,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1178,7 +1199,9 @@ def _power_off_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -1200,7 +1223,6 @@ def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1221,17 +1243,17 @@ def begin_power_off( skip_shutdown=False, # type: Optional[bool] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with - the same provisioned resources. You are still charged for this virtual machine. + the same provisioned resources. You are still charged for this virtual machine. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_name: The name of the virtual machine. :type vm_name: str :param skip_shutdown: The parameter to request non-graceful VM shutdown. True value for this - flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this - flag is false if not specified. + flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this + flag is false if not specified. :type skip_shutdown: 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. @@ -1288,7 +1310,9 @@ def _restart_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -1308,7 +1332,6 @@ def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1328,7 +1351,7 @@ def begin_restart( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to restart a virtual machine. :param resource_group_name: The name of the resource group. @@ -1389,7 +1412,9 @@ def _start_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -1409,7 +1434,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1429,7 +1453,7 @@ def begin_start( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to start a virtual machine. :param resource_group_name: The name of the resource group. @@ -1490,7 +1514,9 @@ def _redeploy_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -1510,7 +1536,6 @@ def _redeploy_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1530,7 +1555,7 @@ def begin_redeploy( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Shuts down the virtual machine, moves it to a new node, and powers it back on. :param resource_group_name: The name of the resource group. @@ -1592,7 +1617,9 @@ def _reimage_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") @@ -1614,7 +1641,6 @@ def _reimage_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: body_content = self._serialize.body(parameters, 'VirtualMachineReimageParameters') @@ -1622,7 +1648,6 @@ def _reimage_initial( body_content = None 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 @@ -1642,7 +1667,7 @@ def begin_reimage( parameters=None, # type: Optional["models.VirtualMachineReimageParameters"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Reimages the virtual machine which has an ephemeral OS disk back to its initial state. :param resource_group_name: The name of the resource group. @@ -1706,7 +1731,9 @@ def _perform_maintenance_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" @@ -1726,7 +1753,6 @@ def _perform_maintenance_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1746,7 +1772,7 @@ def begin_perform_maintenance( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to perform maintenance on a virtual machine. :param resource_group_name: The name of the resource group. @@ -1806,12 +1832,15 @@ def _run_command_initial( parameters, # type: "models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> "models.RunCommandResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" # Construct URL url = self._run_command_initial.metadata['url'] # type: ignore @@ -1829,14 +1858,12 @@ def _run_command_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RunCommandInput') 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 @@ -1861,7 +1888,7 @@ def begin_run_command( parameters, # type: "models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RunCommandResult"] """Run command on the VM. :param resource_group_name: The name of the resource group. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/__init__.py index 20a4019e9c23..cdc7f7a1709a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/__init__.py @@ -10,7 +10,7 @@ __all__ = ['ComputeManagementClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass 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 1e7983619226..cbbf6786ef71 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 @@ -32,7 +32,6 @@ class ComputeManagementClient(object): :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. :type subscription_id: str :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -50,6 +49,7 @@ 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/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_configuration.py index af4082a9728b..449ea85e35fd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -47,8 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2019-04-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-compute/{}'.format(VERSION)) self._configure(**kwargs) @@ -61,6 +61,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) 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 0564b1b9feb0..dfb7d12af0ac 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 @@ -4,7 +4,11 @@ "client": { "name": "ComputeManagementClient", "filename": "_compute_management_client", - "description": "Compute Client." + "description": "Compute Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": false }, "global_parameters": { "sync_method": { @@ -41,7 +45,10 @@ }, "config": { "credential": true, - "credential_scopes": ["https://management.azure.com/.default"] + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null }, "operation_groups": { "resource_skus": "ResourceSkusOperations" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/__init__.py index c8a8b4817269..9e9459635989 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._compute_management_client_async import ComputeManagementClient +from ._compute_management_client import ComputeManagementClient __all__ = ['ComputeManagementClient'] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/_compute_management_client_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/_compute_management_client.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/_compute_management_client_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/_compute_management_client.py index 59c8f9598361..8ff46cd8a872 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/_compute_management_client_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/_compute_management_client.py @@ -15,8 +15,8 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration_async import ComputeManagementClientConfiguration -from .operations_async import ResourceSkusOperations +from ._configuration import ComputeManagementClientConfiguration +from .operations import ResourceSkusOperations from .. import models @@ -24,13 +24,12 @@ class ComputeManagementClient(object): """Compute Client. :ivar resource_skus: ResourceSkusOperations operations - :vartype resource_skus: azure.mgmt.compute.v2019_04_01.aio.operations_async.ResourceSkusOperations + :vartype resource_skus: azure.mgmt.compute.v2019_04_01.aio.operations.ResourceSkusOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. :type subscription_id: str :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -47,6 +46,7 @@ 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/aio/_configuration_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/_configuration.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/_configuration_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/_configuration.py index 1a851469103c..a97c9b38f7c0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/_configuration_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -44,8 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2019-04-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-compute/{}'.format(VERSION)) self._configure(**kwargs) @@ -57,6 +57,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/operations_async/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/operations/__init__.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/operations_async/__init__.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/operations/__init__.py index a23395bbba25..46d684b6a0cc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/operations_async/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/operations/__init__.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._resource_skus_operations_async import ResourceSkusOperations +from ._resource_skus_operations import ResourceSkusOperations __all__ = [ 'ResourceSkusOperations', diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/operations_async/_resource_skus_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/operations/_resource_skus_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/operations_async/_resource_skus_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/operations/_resource_skus_operations.py index e464628a531e..85c398c48a98 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/operations_async/_resource_skus_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/operations/_resource_skus_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -49,7 +49,7 @@ def list( """Gets the list of Microsoft.Compute SKUs available for your Subscription. :param filter: The filter to apply on the operation. Only **location** filter is supported - currently. + currently. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSkusResult or the result of cls(response) @@ -57,11 +57,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceSkusResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" + 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 @@ -75,15 +82,11 @@ def prepare_request(next_link=None): if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/models/_compute_management_client_enums.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/models/_compute_management_client_enums.py index e34b0cbf9f58..7675dc0dd449 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/models/_compute_management_client_enums.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/models/_compute_management_client_enums.py @@ -6,26 +6,44 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum +from enum import Enum, EnumMeta +from six import with_metaclass -class ResourceSkuCapacityScaleType(str, Enum): +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class ResourceSkuCapacityScaleType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The scale type applicable to the sku. """ - automatic = "Automatic" - manual = "Manual" - none = "None" + AUTOMATIC = "Automatic" + MANUAL = "Manual" + NONE = "None" -class ResourceSkuRestrictionsReasonCode(str, Enum): +class ResourceSkuRestrictionsReasonCode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The reason for restriction. """ - quota_id = "QuotaId" - not_available_for_subscription = "NotAvailableForSubscription" + QUOTA_ID = "QuotaId" + NOT_AVAILABLE_FOR_SUBSCRIPTION = "NotAvailableForSubscription" -class ResourceSkuRestrictionsType(str, Enum): +class ResourceSkuRestrictionsType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The type of restrictions. """ - location = "Location" - zone = "Zone" + LOCATION = "Location" + ZONE = "Zone" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/operations/_resource_skus_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/operations/_resource_skus_operations.py index 6c02e8d721a7..e7abe04f0ed1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/operations/_resource_skus_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/operations/_resource_skus_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -54,7 +54,7 @@ def list( """Gets the list of Microsoft.Compute SKUs available for your Subscription. :param filter: The filter to apply on the operation. Only **location** filter is supported - currently. + currently. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSkusResult or the result of cls(response) @@ -62,11 +62,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceSkusResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" + 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 @@ -80,15 +87,11 @@ def prepare_request(next_link=None): if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/__init__.py index 20a4019e9c23..cdc7f7a1709a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/__init__.py @@ -10,7 +10,7 @@ __all__ = ['ComputeManagementClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass 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 6552f8960011..7a3a61413914 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,6 +128,7 @@ 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/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_configuration.py index b7406933a513..95f9b3d41e22 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -47,8 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2019-07-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-compute/{}'.format(VERSION)) self._configure(**kwargs) @@ -61,6 +61,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) 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 ae3542408156..835440e1eadf 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 @@ -4,7 +4,11 @@ "client": { "name": "ComputeManagementClient", "filename": "_compute_management_client", - "description": "Compute Client." + "description": "Compute Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true }, "global_parameters": { "sync_method": { @@ -41,7 +45,10 @@ }, "config": { "credential": true, - "credential_scopes": ["https://management.azure.com/.default"] + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null }, "operation_groups": { "operations": "Operations", diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/__init__.py index c8a8b4817269..9e9459635989 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._compute_management_client_async import ComputeManagementClient +from ._compute_management_client import ComputeManagementClient __all__ = ['ComputeManagementClient'] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/_compute_management_client_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/_compute_management_client.py similarity index 76% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/_compute_management_client_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/_compute_management_client.py index f3b57acd86d0..f161044379f0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/_compute_management_client_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/_compute_management_client.py @@ -15,34 +15,34 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration_async import ComputeManagementClientConfiguration -from .operations_async import Operations -from .operations_async import AvailabilitySetsOperations -from .operations_async import ProximityPlacementGroupsOperations -from .operations_async import DedicatedHostGroupsOperations -from .operations_async import DedicatedHostsOperations -from .operations_async import VirtualMachineExtensionImagesOperations -from .operations_async import VirtualMachineExtensionsOperations -from .operations_async import VirtualMachineImagesOperations -from .operations_async import UsageOperations -from .operations_async import VirtualMachinesOperations -from .operations_async import VirtualMachineSizesOperations -from .operations_async import ImagesOperations -from .operations_async import VirtualMachineScaleSetsOperations -from .operations_async import VirtualMachineScaleSetExtensionsOperations -from .operations_async import VirtualMachineScaleSetRollingUpgradesOperations -from .operations_async import VirtualMachineScaleSetVMExtensionsOperations -from .operations_async import VirtualMachineScaleSetVMsOperations -from .operations_async import LogAnalyticsOperations -from .operations_async import DisksOperations -from .operations_async import SnapshotsOperations -from .operations_async import DiskEncryptionSetsOperations -from .operations_async import GalleriesOperations -from .operations_async import GalleryImagesOperations -from .operations_async import GalleryImageVersionsOperations -from .operations_async import GalleryApplicationsOperations -from .operations_async import GalleryApplicationVersionsOperations -from .operations_async import VirtualMachineRunCommandsOperations +from ._configuration import ComputeManagementClientConfiguration +from .operations import Operations +from .operations import AvailabilitySetsOperations +from .operations import ProximityPlacementGroupsOperations +from .operations import DedicatedHostGroupsOperations +from .operations import DedicatedHostsOperations +from .operations import VirtualMachineExtensionImagesOperations +from .operations import VirtualMachineExtensionsOperations +from .operations import VirtualMachineImagesOperations +from .operations import UsageOperations +from .operations import VirtualMachinesOperations +from .operations import VirtualMachineSizesOperations +from .operations import ImagesOperations +from .operations import VirtualMachineScaleSetsOperations +from .operations import VirtualMachineScaleSetExtensionsOperations +from .operations import VirtualMachineScaleSetRollingUpgradesOperations +from .operations import VirtualMachineScaleSetVMExtensionsOperations +from .operations import VirtualMachineScaleSetVMsOperations +from .operations import LogAnalyticsOperations +from .operations import DisksOperations +from .operations import SnapshotsOperations +from .operations import DiskEncryptionSetsOperations +from .operations import GalleriesOperations +from .operations import GalleryImagesOperations +from .operations import GalleryImageVersionsOperations +from .operations import GalleryApplicationsOperations +from .operations import GalleryApplicationVersionsOperations +from .operations import VirtualMachineRunCommandsOperations from .. import models @@ -50,59 +50,59 @@ class ComputeManagementClient(object): """Compute Client. :ivar operations: Operations operations - :vartype operations: azure.mgmt.compute.v2019_07_01.aio.operations_async.Operations + :vartype operations: azure.mgmt.compute.v2019_07_01.aio.operations.Operations :ivar availability_sets: AvailabilitySetsOperations operations - :vartype availability_sets: azure.mgmt.compute.v2019_07_01.aio.operations_async.AvailabilitySetsOperations + :vartype availability_sets: azure.mgmt.compute.v2019_07_01.aio.operations.AvailabilitySetsOperations :ivar proximity_placement_groups: ProximityPlacementGroupsOperations operations - :vartype proximity_placement_groups: azure.mgmt.compute.v2019_07_01.aio.operations_async.ProximityPlacementGroupsOperations + :vartype proximity_placement_groups: azure.mgmt.compute.v2019_07_01.aio.operations.ProximityPlacementGroupsOperations :ivar dedicated_host_groups: DedicatedHostGroupsOperations operations - :vartype dedicated_host_groups: azure.mgmt.compute.v2019_07_01.aio.operations_async.DedicatedHostGroupsOperations + :vartype dedicated_host_groups: azure.mgmt.compute.v2019_07_01.aio.operations.DedicatedHostGroupsOperations :ivar dedicated_hosts: DedicatedHostsOperations operations - :vartype dedicated_hosts: azure.mgmt.compute.v2019_07_01.aio.operations_async.DedicatedHostsOperations + :vartype dedicated_hosts: azure.mgmt.compute.v2019_07_01.aio.operations.DedicatedHostsOperations :ivar virtual_machine_extension_images: VirtualMachineExtensionImagesOperations operations - :vartype virtual_machine_extension_images: azure.mgmt.compute.v2019_07_01.aio.operations_async.VirtualMachineExtensionImagesOperations + :vartype virtual_machine_extension_images: azure.mgmt.compute.v2019_07_01.aio.operations.VirtualMachineExtensionImagesOperations :ivar virtual_machine_extensions: VirtualMachineExtensionsOperations operations - :vartype virtual_machine_extensions: azure.mgmt.compute.v2019_07_01.aio.operations_async.VirtualMachineExtensionsOperations + :vartype virtual_machine_extensions: azure.mgmt.compute.v2019_07_01.aio.operations.VirtualMachineExtensionsOperations :ivar virtual_machine_images: VirtualMachineImagesOperations operations - :vartype virtual_machine_images: azure.mgmt.compute.v2019_07_01.aio.operations_async.VirtualMachineImagesOperations + :vartype virtual_machine_images: azure.mgmt.compute.v2019_07_01.aio.operations.VirtualMachineImagesOperations :ivar usage: UsageOperations operations - :vartype usage: azure.mgmt.compute.v2019_07_01.aio.operations_async.UsageOperations + :vartype usage: azure.mgmt.compute.v2019_07_01.aio.operations.UsageOperations :ivar virtual_machines: VirtualMachinesOperations operations - :vartype virtual_machines: azure.mgmt.compute.v2019_07_01.aio.operations_async.VirtualMachinesOperations + :vartype virtual_machines: azure.mgmt.compute.v2019_07_01.aio.operations.VirtualMachinesOperations :ivar virtual_machine_sizes: VirtualMachineSizesOperations operations - :vartype virtual_machine_sizes: azure.mgmt.compute.v2019_07_01.aio.operations_async.VirtualMachineSizesOperations + :vartype virtual_machine_sizes: azure.mgmt.compute.v2019_07_01.aio.operations.VirtualMachineSizesOperations :ivar images: ImagesOperations operations - :vartype images: azure.mgmt.compute.v2019_07_01.aio.operations_async.ImagesOperations + :vartype images: azure.mgmt.compute.v2019_07_01.aio.operations.ImagesOperations :ivar virtual_machine_scale_sets: VirtualMachineScaleSetsOperations operations - :vartype virtual_machine_scale_sets: azure.mgmt.compute.v2019_07_01.aio.operations_async.VirtualMachineScaleSetsOperations + :vartype virtual_machine_scale_sets: azure.mgmt.compute.v2019_07_01.aio.operations.VirtualMachineScaleSetsOperations :ivar virtual_machine_scale_set_extensions: VirtualMachineScaleSetExtensionsOperations operations - :vartype virtual_machine_scale_set_extensions: azure.mgmt.compute.v2019_07_01.aio.operations_async.VirtualMachineScaleSetExtensionsOperations + :vartype virtual_machine_scale_set_extensions: azure.mgmt.compute.v2019_07_01.aio.operations.VirtualMachineScaleSetExtensionsOperations :ivar virtual_machine_scale_set_rolling_upgrades: VirtualMachineScaleSetRollingUpgradesOperations operations - :vartype virtual_machine_scale_set_rolling_upgrades: azure.mgmt.compute.v2019_07_01.aio.operations_async.VirtualMachineScaleSetRollingUpgradesOperations + :vartype virtual_machine_scale_set_rolling_upgrades: azure.mgmt.compute.v2019_07_01.aio.operations.VirtualMachineScaleSetRollingUpgradesOperations :ivar virtual_machine_scale_set_vm_extensions: VirtualMachineScaleSetVMExtensionsOperations operations - :vartype virtual_machine_scale_set_vm_extensions: azure.mgmt.compute.v2019_07_01.aio.operations_async.VirtualMachineScaleSetVMExtensionsOperations + :vartype virtual_machine_scale_set_vm_extensions: azure.mgmt.compute.v2019_07_01.aio.operations.VirtualMachineScaleSetVMExtensionsOperations :ivar virtual_machine_scale_set_vms: VirtualMachineScaleSetVMsOperations operations - :vartype virtual_machine_scale_set_vms: azure.mgmt.compute.v2019_07_01.aio.operations_async.VirtualMachineScaleSetVMsOperations + :vartype virtual_machine_scale_set_vms: azure.mgmt.compute.v2019_07_01.aio.operations.VirtualMachineScaleSetVMsOperations :ivar log_analytics: LogAnalyticsOperations operations - :vartype log_analytics: azure.mgmt.compute.v2019_07_01.aio.operations_async.LogAnalyticsOperations + :vartype log_analytics: azure.mgmt.compute.v2019_07_01.aio.operations.LogAnalyticsOperations :ivar disks: DisksOperations operations - :vartype disks: azure.mgmt.compute.v2019_07_01.aio.operations_async.DisksOperations + :vartype disks: azure.mgmt.compute.v2019_07_01.aio.operations.DisksOperations :ivar snapshots: SnapshotsOperations operations - :vartype snapshots: azure.mgmt.compute.v2019_07_01.aio.operations_async.SnapshotsOperations + :vartype snapshots: azure.mgmt.compute.v2019_07_01.aio.operations.SnapshotsOperations :ivar disk_encryption_sets: DiskEncryptionSetsOperations operations - :vartype disk_encryption_sets: azure.mgmt.compute.v2019_07_01.aio.operations_async.DiskEncryptionSetsOperations + :vartype disk_encryption_sets: azure.mgmt.compute.v2019_07_01.aio.operations.DiskEncryptionSetsOperations :ivar galleries: GalleriesOperations operations - :vartype galleries: azure.mgmt.compute.v2019_07_01.aio.operations_async.GalleriesOperations + :vartype galleries: azure.mgmt.compute.v2019_07_01.aio.operations.GalleriesOperations :ivar gallery_images: GalleryImagesOperations operations - :vartype gallery_images: azure.mgmt.compute.v2019_07_01.aio.operations_async.GalleryImagesOperations + :vartype gallery_images: azure.mgmt.compute.v2019_07_01.aio.operations.GalleryImagesOperations :ivar gallery_image_versions: GalleryImageVersionsOperations operations - :vartype gallery_image_versions: azure.mgmt.compute.v2019_07_01.aio.operations_async.GalleryImageVersionsOperations + :vartype gallery_image_versions: azure.mgmt.compute.v2019_07_01.aio.operations.GalleryImageVersionsOperations :ivar gallery_applications: GalleryApplicationsOperations operations - :vartype gallery_applications: azure.mgmt.compute.v2019_07_01.aio.operations_async.GalleryApplicationsOperations + :vartype gallery_applications: azure.mgmt.compute.v2019_07_01.aio.operations.GalleryApplicationsOperations :ivar gallery_application_versions: GalleryApplicationVersionsOperations operations - :vartype gallery_application_versions: azure.mgmt.compute.v2019_07_01.aio.operations_async.GalleryApplicationVersionsOperations + :vartype gallery_application_versions: azure.mgmt.compute.v2019_07_01.aio.operations.GalleryApplicationVersionsOperations :ivar virtual_machine_run_commands: VirtualMachineRunCommandsOperations operations - :vartype virtual_machine_run_commands: azure.mgmt.compute.v2019_07_01.aio.operations_async.VirtualMachineRunCommandsOperations + :vartype virtual_machine_run_commands: azure.mgmt.compute.v2019_07_01.aio.operations.VirtualMachineRunCommandsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. @@ -125,6 +125,7 @@ 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/aio/_configuration_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/_configuration.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/_configuration_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/_configuration.py index 3334790dd9ce..4203940bea31 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/_configuration_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -44,8 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2019-07-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-compute/{}'.format(VERSION)) self._configure(**kwargs) @@ -57,6 +57,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/__init__.py new file mode 100644 index 000000000000..84aa626c09ed --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/__init__.py @@ -0,0 +1,65 @@ +# 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 ._operations import Operations +from ._availability_sets_operations import AvailabilitySetsOperations +from ._proximity_placement_groups_operations import ProximityPlacementGroupsOperations +from ._dedicated_host_groups_operations import DedicatedHostGroupsOperations +from ._dedicated_hosts_operations import DedicatedHostsOperations +from ._virtual_machine_extension_images_operations import VirtualMachineExtensionImagesOperations +from ._virtual_machine_extensions_operations import VirtualMachineExtensionsOperations +from ._virtual_machine_images_operations import VirtualMachineImagesOperations +from ._usage_operations import UsageOperations +from ._virtual_machines_operations import VirtualMachinesOperations +from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations +from ._images_operations import ImagesOperations +from ._virtual_machine_scale_sets_operations import VirtualMachineScaleSetsOperations +from ._virtual_machine_scale_set_extensions_operations import VirtualMachineScaleSetExtensionsOperations +from ._virtual_machine_scale_set_rolling_upgrades_operations import VirtualMachineScaleSetRollingUpgradesOperations +from ._virtual_machine_scale_set_vm_extensions_operations import VirtualMachineScaleSetVMExtensionsOperations +from ._virtual_machine_scale_set_vms_operations import VirtualMachineScaleSetVMsOperations +from ._log_analytics_operations import LogAnalyticsOperations +from ._disks_operations import DisksOperations +from ._snapshots_operations import SnapshotsOperations +from ._disk_encryption_sets_operations import DiskEncryptionSetsOperations +from ._galleries_operations import GalleriesOperations +from ._gallery_images_operations import GalleryImagesOperations +from ._gallery_image_versions_operations import GalleryImageVersionsOperations +from ._gallery_applications_operations import GalleryApplicationsOperations +from ._gallery_application_versions_operations import GalleryApplicationVersionsOperations +from ._virtual_machine_run_commands_operations import VirtualMachineRunCommandsOperations + +__all__ = [ + 'Operations', + 'AvailabilitySetsOperations', + 'ProximityPlacementGroupsOperations', + 'DedicatedHostGroupsOperations', + 'DedicatedHostsOperations', + 'VirtualMachineExtensionImagesOperations', + 'VirtualMachineExtensionsOperations', + 'VirtualMachineImagesOperations', + 'UsageOperations', + 'VirtualMachinesOperations', + 'VirtualMachineSizesOperations', + 'ImagesOperations', + 'VirtualMachineScaleSetsOperations', + 'VirtualMachineScaleSetExtensionsOperations', + 'VirtualMachineScaleSetRollingUpgradesOperations', + 'VirtualMachineScaleSetVMExtensionsOperations', + 'VirtualMachineScaleSetVMsOperations', + 'LogAnalyticsOperations', + 'DisksOperations', + 'SnapshotsOperations', + 'DiskEncryptionSetsOperations', + 'GalleriesOperations', + 'GalleryImagesOperations', + 'GalleryImageVersionsOperations', + 'GalleryApplicationsOperations', + 'GalleryApplicationVersionsOperations', + 'VirtualMachineRunCommandsOperations', +] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_availability_sets_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_availability_sets_operations.py similarity index 90% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_availability_sets_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_availability_sets_operations.py index eca98cf885b4..bb66ddd2a798 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_availability_sets_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_availability_sets_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -62,10 +62,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -83,14 +86,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailabilitySet') 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 @@ -127,10 +128,13 @@ async def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -148,14 +152,12 @@ async def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailabilitySetUpdate') 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 @@ -189,7 +191,9 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -209,7 +213,6 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -241,9 +244,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -260,9 +266,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -286,7 +291,8 @@ def list_by_subscription( ) -> AsyncIterable["models.AvailabilitySetListResult"]: """Lists all availability sets in a subscription. - :param expand: The expand expression to apply to the operation. + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AvailabilitySetListResult or the result of cls(response) @@ -294,11 +300,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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_subscription.metadata['url'] # type: ignore @@ -312,15 +325,11 @@ def prepare_request(next_link=None): if expand is not None: query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -362,11 +371,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -379,15 +395,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -421,7 +433,7 @@ def list_available_sizes( **kwargs ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes that can be used to create a new virtual machine in - an existing availability set. + an existing availability set. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -433,11 +445,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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_available_sizes.metadata['url'] # type: ignore @@ -451,15 +470,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_dedicated_host_groups_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_dedicated_host_groups_operations.py similarity index 90% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_dedicated_host_groups_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_dedicated_host_groups_operations.py index c84d828a6da3..6a2ce07e2e34 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_dedicated_host_groups_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_dedicated_host_groups_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -64,10 +64,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -85,14 +88,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DedicatedHostGroup') 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 @@ -100,7 +101,6 @@ async def create_or_update( 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('DedicatedHostGroup', pipeline_response) @@ -134,10 +134,13 @@ async def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -155,14 +158,12 @@ async def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DedicatedHostGroupUpdate') 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 @@ -196,7 +197,9 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -216,7 +219,6 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -248,9 +250,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -267,9 +272,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -292,7 +296,7 @@ def list_by_resource_group( **kwargs ) -> AsyncIterable["models.DedicatedHostGroupListResult"]: """Lists all of the dedicated host groups in the specified resource group. Use the nextLink - property in the response to get the next page of dedicated host groups. + property in the response to get the next page of dedicated host groups. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -302,11 +306,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -319,15 +330,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -359,7 +366,7 @@ def list_by_subscription( **kwargs ) -> AsyncIterable["models.DedicatedHostGroupListResult"]: """Lists all of the dedicated host groups in the subscription. Use the nextLink property in the - response to get the next page of dedicated host groups. + response to get the next page of dedicated host groups. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DedicatedHostGroupListResult or the result of cls(response) @@ -367,11 +374,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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_subscription.metadata['url'] # type: ignore @@ -383,15 +397,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_dedicated_hosts_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_dedicated_hosts_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_dedicated_hosts_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_dedicated_hosts_operations.py index fb45b1feec70..d76c1bf915a5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_dedicated_hosts_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_dedicated_hosts_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,10 +52,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.DedicatedHost": cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -74,14 +77,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DedicatedHost') 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 @@ -89,7 +90,6 @@ async def _create_or_update_initial( 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('DedicatedHost', pipeline_response) @@ -109,7 +109,7 @@ async def begin_create_or_update( host_name: str, parameters: "models.DedicatedHost", **kwargs - ) -> "models.DedicatedHost": + ) -> AsyncLROPoller["models.DedicatedHost"]: """Create or update a dedicated host . :param resource_group_name: The name of the resource group. @@ -126,8 +126,8 @@ async def begin_create_or_update( 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: DedicatedHost, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_07_01.models.DedicatedHost + :return: An instance of AsyncLROPoller that returns either DedicatedHost or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_07_01.models.DedicatedHost] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -180,10 +180,13 @@ async def _update_initial( **kwargs ) -> "models.DedicatedHost": cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -202,14 +205,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DedicatedHostUpdate') 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 @@ -232,7 +233,7 @@ async def begin_update( host_name: str, parameters: "models.DedicatedHostUpdate", **kwargs - ) -> "models.DedicatedHost": + ) -> AsyncLROPoller["models.DedicatedHost"]: """Update an dedicated host . :param resource_group_name: The name of the resource group. @@ -249,8 +250,8 @@ async def begin_update( 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: DedicatedHost, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_07_01.models.DedicatedHost + :return: An instance of AsyncLROPoller that returns either DedicatedHost or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_07_01.models.DedicatedHost] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -302,7 +303,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -323,7 +326,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -343,7 +345,7 @@ async def begin_delete( host_group_name: str, host_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Delete a dedicated host. :param resource_group_name: The name of the resource group. @@ -358,8 +360,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -423,9 +425,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -445,9 +450,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -471,7 +475,7 @@ def list_by_host_group( **kwargs ) -> AsyncIterable["models.DedicatedHostListResult"]: """Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink - property in the response to get the next page of dedicated hosts. + property in the response to get the next page of dedicated hosts. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -483,11 +487,18 @@ def list_by_host_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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_host_group.metadata['url'] # type: ignore @@ -501,15 +512,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_disk_encryption_sets_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_disk_encryption_sets_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_disk_encryption_sets_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_disk_encryption_sets_operations.py index 08e5de231198..e2309f5533ef 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_disk_encryption_sets_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_disk_encryption_sets_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.DiskEncryptionSet": cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('DiskEncryptionSet', pipeline_response) @@ -106,17 +106,17 @@ async def begin_create_or_update( disk_encryption_set_name: str, disk_encryption_set: "models.DiskEncryptionSet", **kwargs - ) -> "models.DiskEncryptionSet": + ) -> 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. + 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. + encryption set operation. :type disk_encryption_set: ~azure.mgmt.compute.v2019_07_01.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. @@ -124,8 +124,8 @@ async def begin_create_or_update( 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: DiskEncryptionSet, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_07_01.models.DiskEncryptionSet + :return: An instance of AsyncLROPoller that returns either DiskEncryptionSet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_07_01.models.DiskEncryptionSet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -176,10 +176,13 @@ async def _update_initial( **kwargs ) -> "models.DiskEncryptionSet": cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -197,14 +200,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -212,7 +213,6 @@ async def _update_initial( 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('DiskEncryptionSet', pipeline_response) @@ -231,17 +231,17 @@ async def begin_update( disk_encryption_set_name: str, disk_encryption_set: "models.DiskEncryptionSetUpdate", **kwargs - ) -> "models.DiskEncryptionSet": + ) -> 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. + 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. + encryption set operation. :type disk_encryption_set: ~azure.mgmt.compute.v2019_07_01.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. @@ -249,8 +249,8 @@ async def begin_update( 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: DiskEncryptionSet, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_07_01.models.DiskEncryptionSet + :return: An instance of AsyncLROPoller that returns either DiskEncryptionSet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_07_01.models.DiskEncryptionSet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -313,9 +313,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -332,9 +335,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -358,9 +360,12 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -377,8 +382,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -397,14 +402,14 @@ async def begin_delete( resource_group_name: str, disk_encryption_set_name: str, **kwargs - ) -> None: + ) -> 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. + 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. @@ -412,8 +417,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -467,11 +472,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSetList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -484,15 +496,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -531,11 +539,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSetList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -547,15 +562,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_disks_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_disks_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_disks_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_disks_operations.py index 1c3a793e81bc..b0d42c300a10 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_disks_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_disks_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.Disk": cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('Disk', pipeline_response) @@ -106,14 +106,14 @@ async def begin_create_or_update( disk_name: str, disk: "models.Disk", **kwargs - ) -> "models.Disk": + ) -> 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. + 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.v2019_07_01.models.Disk @@ -123,8 +123,8 @@ async def begin_create_or_update( 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: Disk, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_07_01.models.Disk + :return: An instance of AsyncLROPoller that returns either Disk or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_07_01.models.Disk] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -175,10 +175,13 @@ async def _update_initial( **kwargs ) -> "models.Disk": cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -196,14 +199,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -211,7 +212,6 @@ async def _update_initial( 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('Disk', pipeline_response) @@ -230,14 +230,14 @@ async def begin_update( disk_name: str, disk: "models.DiskUpdate", **kwargs - ) -> "models.Disk": + ) -> 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. + 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.v2019_07_01.models.DiskUpdate @@ -247,8 +247,8 @@ async def begin_update( 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: Disk, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_07_01.models.Disk + :return: An instance of AsyncLROPoller that returns either Disk or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_07_01.models.Disk] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -311,9 +311,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -330,9 +333,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -356,7 +358,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -376,7 +380,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -395,14 +398,14 @@ async def begin_delete( resource_group_name: str, disk_name: str, **kwargs - ) -> None: + ) -> 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. + 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. @@ -410,8 +413,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -465,11 +468,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -482,15 +492,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -529,11 +535,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -545,15 +558,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -586,12 +595,15 @@ async def _grant_access_initial( disk_name: str, grant_access_data: "models.GrantAccessData", **kwargs - ) -> "models.AccessUri": - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> 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 = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._grant_access_initial.metadata['url'] # type: ignore @@ -609,14 +621,12 @@ async def _grant_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -640,17 +650,17 @@ async def begin_grant_access( disk_name: str, grant_access_data: "models.GrantAccessData", **kwargs - ) -> "models.AccessUri": + ) -> 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. + 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. + operation. :type grant_access_data: ~azure.mgmt.compute.v2019_07_01.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. @@ -658,8 +668,8 @@ async def begin_grant_access( 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: AccessUri, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_07_01.models.AccessUri + :return: An instance of AsyncLROPoller that returns either AccessUri or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_07_01.models.AccessUri] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -709,7 +719,9 @@ async def _revoke_access_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -729,7 +741,6 @@ async def _revoke_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -748,14 +759,14 @@ async def begin_revoke_access( resource_group_name: str, disk_name: str, **kwargs - ) -> None: + ) -> 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. + 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. @@ -763,8 +774,8 @@ async def begin_revoke_access( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_galleries_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_galleries_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_galleries_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_galleries_operations.py index 2dd0ea48a4f2..59d3c3f204e2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_galleries_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_galleries_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.Gallery": cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery, 'Gallery') 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('Gallery', pipeline_response) @@ -109,13 +109,13 @@ async def begin_create_or_update( gallery_name: str, gallery: "models.Gallery", **kwargs - ) -> "models.Gallery": + ) -> AsyncLROPoller["models.Gallery"]: """Create or update a Shared Image Gallery. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery. The allowed characters are alphabets - and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. + and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. :type gallery_name: str :param gallery: Parameters supplied to the create or update Shared Image Gallery operation. :type gallery: ~azure.mgmt.compute.v2019_07_01.models.Gallery @@ -125,8 +125,8 @@ async def begin_create_or_update( 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: Gallery, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_07_01.models.Gallery + :return: An instance of AsyncLROPoller that returns either Gallery or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_07_01.models.Gallery] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -177,10 +177,13 @@ async def _update_initial( **kwargs ) -> "models.Gallery": cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -198,14 +201,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery, 'GalleryUpdate') 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 @@ -227,13 +228,13 @@ async def begin_update( gallery_name: str, gallery: "models.GalleryUpdate", **kwargs - ) -> "models.Gallery": + ) -> AsyncLROPoller["models.Gallery"]: """Update a Shared Image Gallery. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery. The allowed characters are alphabets - and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. + and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. :type gallery_name: str :param gallery: Parameters supplied to the update Shared Image Gallery operation. :type gallery: ~azure.mgmt.compute.v2019_07_01.models.GalleryUpdate @@ -243,8 +244,8 @@ async def begin_update( 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: Gallery, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_07_01.models.Gallery + :return: An instance of AsyncLROPoller that returns either Gallery or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_07_01.models.Gallery] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -305,9 +306,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -324,9 +328,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -350,9 +353,12 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -369,8 +375,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -389,7 +395,7 @@ async def begin_delete( resource_group_name: str, gallery_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Delete a Shared Image Gallery. :param resource_group_name: The name of the resource group. @@ -402,8 +408,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -457,11 +463,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -474,15 +487,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -521,11 +530,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -537,15 +553,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_gallery_application_versions_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_application_versions_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_gallery_application_versions_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_application_versions_operations.py index 41da1f0e54b0..8be18caf80c5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_gallery_application_versions_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_application_versions_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -53,10 +53,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.GalleryApplicationVersion": cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -76,14 +79,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_application_version, 'GalleryApplicationVersion') 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 @@ -91,7 +92,6 @@ async def _create_or_update_initial( 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('GalleryApplicationVersion', pipeline_response) @@ -115,24 +115,24 @@ async def begin_create_or_update( gallery_application_version_name: str, gallery_application_version: "models.GalleryApplicationVersion", **kwargs - ) -> "models.GalleryApplicationVersion": + ) -> AsyncLROPoller["models.GalleryApplicationVersion"]: """Create or update a gallery Application Version. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. + Definition resides. :type gallery_name: str :param gallery_application_name: The name of the gallery Application Definition in which the - Application Version is to be created. + Application Version is to be created. :type gallery_application_name: str :param gallery_application_version_name: The name of the gallery Application Version to be - created. Needs to follow semantic version name pattern: The allowed characters are digit and - period. Digits must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. + created. Needs to follow semantic version name pattern: The allowed characters are digit and + period. Digits must be within the range of a 32-bit integer. Format: + :code:``.:code:``.:code:``. :type gallery_application_version_name: str :param gallery_application_version: Parameters supplied to the create or update gallery - Application Version operation. + Application Version operation. :type gallery_application_version: ~azure.mgmt.compute.v2019_07_01.models.GalleryApplicationVersion :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. @@ -140,8 +140,8 @@ async def begin_create_or_update( 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: GalleryApplicationVersion, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_07_01.models.GalleryApplicationVersion + :return: An instance of AsyncLROPoller that returns either GalleryApplicationVersion or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_07_01.models.GalleryApplicationVersion] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -196,10 +196,13 @@ async def _update_initial( **kwargs ) -> "models.GalleryApplicationVersion": cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -219,14 +222,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_application_version, 'GalleryApplicationVersionUpdate') 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 @@ -250,24 +251,24 @@ async def begin_update( gallery_application_version_name: str, gallery_application_version: "models.GalleryApplicationVersionUpdate", **kwargs - ) -> "models.GalleryApplicationVersion": + ) -> AsyncLROPoller["models.GalleryApplicationVersion"]: """Update a gallery Application Version. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. + Definition resides. :type gallery_name: str :param gallery_application_name: The name of the gallery Application Definition in which the - Application Version is to be updated. + Application Version is to be updated. :type gallery_application_name: str :param gallery_application_version_name: The name of the gallery Application Version to be - updated. Needs to follow semantic version name pattern: The allowed characters are digit and - period. Digits must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. + updated. Needs to follow semantic version name pattern: The allowed characters are digit and + period. Digits must be within the range of a 32-bit integer. Format: + :code:``.:code:``.:code:``. :type gallery_application_version_name: str :param gallery_application_version: Parameters supplied to the update gallery Application - Version operation. + Version operation. :type gallery_application_version: ~azure.mgmt.compute.v2019_07_01.models.GalleryApplicationVersionUpdate :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. @@ -275,8 +276,8 @@ async def begin_update( 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: GalleryApplicationVersion, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_07_01.models.GalleryApplicationVersion + :return: An instance of AsyncLROPoller that returns either GalleryApplicationVersion or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_07_01.models.GalleryApplicationVersion] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -327,7 +328,7 @@ async def get( gallery_name: str, gallery_application_name: str, gallery_application_version_name: str, - expand: Optional[str] = "ReplicationStatus", + expand: Optional[Union[str, "models.ReplicationStatusTypes"]] = None, **kwargs ) -> "models.GalleryApplicationVersion": """Retrieves information about a gallery Application Version. @@ -344,16 +345,19 @@ async def get( retrieved. :type gallery_application_version_name: str :param expand: The expand expression to apply on the operation. - :type expand: str + :type expand: str or ~azure.mgmt.compute.v2019_07_01.models.ReplicationStatusTypes :keyword callable cls: A custom type or function that will be passed the direct response :return: GalleryApplicationVersion, or the result of cls(response) :rtype: ~azure.mgmt.compute.v2019_07_01.models.GalleryApplicationVersion :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -374,9 +378,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -402,9 +405,12 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -423,8 +429,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -445,19 +451,19 @@ async def begin_delete( gallery_application_name: str, gallery_application_version_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Delete a gallery Application Version. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. + Definition resides. :type gallery_name: str :param gallery_application_name: The name of the gallery Application Definition in which the - Application Version resides. + Application Version resides. :type gallery_application_name: str :param gallery_application_version_name: The name of the gallery Application Version to be - deleted. + deleted. :type gallery_application_version_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. @@ -465,8 +471,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -519,10 +525,10 @@ def list_by_gallery_application( :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. + Definition resides. :type gallery_name: str :param gallery_application_name: The name of the Shared Application Gallery Application - Definition from which the Application Versions are to be listed. + Definition from which the Application Versions are to be listed. :type gallery_application_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GalleryApplicationVersionList or the result of cls(response) @@ -530,11 +536,18 @@ def list_by_gallery_application( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersionList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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_gallery_application.metadata['url'] # type: ignore @@ -549,15 +562,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_gallery_applications_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_applications_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_gallery_applications_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_applications_operations.py index 98c58e135f71..3ddfe762c5d2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_gallery_applications_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_applications_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,10 +52,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.GalleryApplication": cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -74,14 +77,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_application, 'GalleryApplication') 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 @@ -89,7 +90,6 @@ async def _create_or_update_initial( 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('GalleryApplication', pipeline_response) @@ -112,20 +112,20 @@ async def begin_create_or_update( gallery_application_name: str, gallery_application: "models.GalleryApplication", **kwargs - ) -> "models.GalleryApplication": + ) -> AsyncLROPoller["models.GalleryApplication"]: """Create or update a gallery Application Definition. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition is to be created. + Definition is to be created. :type gallery_name: str :param gallery_application_name: The name of the gallery Application Definition to be created - or updated. The allowed characters are alphabets and numbers with dots, dashes, and periods - allowed in the middle. The maximum length is 80 characters. + or updated. The allowed characters are alphabets and numbers with dots, dashes, and periods + allowed in the middle. The maximum length is 80 characters. :type gallery_application_name: str :param gallery_application: Parameters supplied to the create or update gallery Application - operation. + operation. :type gallery_application: ~azure.mgmt.compute.v2019_07_01.models.GalleryApplication :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. @@ -133,8 +133,8 @@ async def begin_create_or_update( 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: GalleryApplication, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_07_01.models.GalleryApplication + :return: An instance of AsyncLROPoller that returns either GalleryApplication or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_07_01.models.GalleryApplication] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -187,10 +187,13 @@ async def _update_initial( **kwargs ) -> "models.GalleryApplication": cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -209,14 +212,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_application, 'GalleryApplicationUpdate') 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 @@ -239,17 +240,17 @@ async def begin_update( gallery_application_name: str, gallery_application: "models.GalleryApplicationUpdate", **kwargs - ) -> "models.GalleryApplication": + ) -> AsyncLROPoller["models.GalleryApplication"]: """Update a gallery Application Definition. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition is to be updated. + Definition is to be updated. :type gallery_name: str :param gallery_application_name: The name of the gallery Application Definition to be updated. - The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the - middle. The maximum length is 80 characters. + The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the + middle. The maximum length is 80 characters. :type gallery_application_name: str :param gallery_application: Parameters supplied to the update gallery Application operation. :type gallery_application: ~azure.mgmt.compute.v2019_07_01.models.GalleryApplicationUpdate @@ -259,8 +260,8 @@ async def begin_update( 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: GalleryApplication, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_07_01.models.GalleryApplication + :return: An instance of AsyncLROPoller that returns either GalleryApplication or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_07_01.models.GalleryApplication] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -327,9 +328,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -347,9 +351,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -374,9 +377,12 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -394,8 +400,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -415,13 +421,13 @@ async def begin_delete( gallery_name: str, gallery_application_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Delete a gallery Application. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition is to be deleted. + Definition is to be deleted. :type gallery_name: str :param gallery_application_name: The name of the gallery Application Definition to be deleted. :type gallery_application_name: str @@ -431,8 +437,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -483,7 +489,7 @@ def list_by_gallery( :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery from which Application - Definitions are to be listed. + Definitions are to be listed. :type gallery_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GalleryApplicationList or the result of cls(response) @@ -491,11 +497,18 @@ def list_by_gallery( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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_gallery.metadata['url'] # type: ignore @@ -509,15 +522,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_gallery_image_versions_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_image_versions_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_gallery_image_versions_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_image_versions_operations.py index 6cca92818f4d..2f2fdab26d88 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_gallery_image_versions_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_image_versions_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -53,10 +53,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.GalleryImageVersion": cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -76,14 +79,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_image_version, 'GalleryImageVersion') 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 @@ -91,7 +92,6 @@ async def _create_or_update_initial( 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('GalleryImageVersion', pipeline_response) @@ -115,24 +115,24 @@ async def begin_create_or_update( gallery_image_version_name: str, gallery_image_version: "models.GalleryImageVersion", **kwargs - ) -> "models.GalleryImageVersion": + ) -> AsyncLROPoller["models.GalleryImageVersion"]: """Create or update a gallery Image Version. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. + resides. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition in which the Image Version - is to be created. + is to be created. :type gallery_image_name: str :param gallery_image_version_name: The name of the gallery Image Version to be created. Needs - to follow semantic version name pattern: The allowed characters are digit and period. Digits - must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. + to follow semantic version name pattern: The allowed characters are digit and period. Digits + must be within the range of a 32-bit integer. Format: + :code:``.:code:``.:code:``. :type gallery_image_version_name: str :param gallery_image_version: Parameters supplied to the create or update gallery Image Version - operation. + operation. :type gallery_image_version: ~azure.mgmt.compute.v2019_07_01.models.GalleryImageVersion :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. @@ -140,8 +140,8 @@ async def begin_create_or_update( 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: GalleryImageVersion, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_07_01.models.GalleryImageVersion + :return: An instance of AsyncLROPoller that returns either GalleryImageVersion or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_07_01.models.GalleryImageVersion] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -196,10 +196,13 @@ async def _update_initial( **kwargs ) -> "models.GalleryImageVersion": cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -219,14 +222,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_image_version, 'GalleryImageVersionUpdate') 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 @@ -250,24 +251,24 @@ async def begin_update( gallery_image_version_name: str, gallery_image_version: "models.GalleryImageVersionUpdate", **kwargs - ) -> "models.GalleryImageVersion": + ) -> AsyncLROPoller["models.GalleryImageVersion"]: """Update a gallery Image Version. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. + resides. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition in which the Image Version - is to be updated. + is to be updated. :type gallery_image_name: str :param gallery_image_version_name: The name of the gallery Image Version to be updated. Needs - to follow semantic version name pattern: The allowed characters are digit and period. Digits - must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. + to follow semantic version name pattern: The allowed characters are digit and period. Digits + must be within the range of a 32-bit integer. Format: + :code:``.:code:``.:code:``. :type gallery_image_version_name: str :param gallery_image_version: Parameters supplied to the update gallery Image Version - operation. + operation. :type gallery_image_version: ~azure.mgmt.compute.v2019_07_01.models.GalleryImageVersionUpdate :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. @@ -275,8 +276,8 @@ async def begin_update( 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: GalleryImageVersion, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_07_01.models.GalleryImageVersion + :return: An instance of AsyncLROPoller that returns either GalleryImageVersion or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_07_01.models.GalleryImageVersion] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -327,7 +328,7 @@ async def get( gallery_name: str, gallery_image_name: str, gallery_image_version_name: str, - expand: Optional[str] = "ReplicationStatus", + expand: Optional[Union[str, "models.ReplicationStatusTypes"]] = None, **kwargs ) -> "models.GalleryImageVersion": """Retrieves information about a gallery Image Version. @@ -343,16 +344,19 @@ async def get( :param gallery_image_version_name: The name of the gallery Image Version to be retrieved. :type gallery_image_version_name: str :param expand: The expand expression to apply on the operation. - :type expand: str + :type expand: str or ~azure.mgmt.compute.v2019_07_01.models.ReplicationStatusTypes :keyword callable cls: A custom type or function that will be passed the direct response :return: GalleryImageVersion, or the result of cls(response) :rtype: ~azure.mgmt.compute.v2019_07_01.models.GalleryImageVersion :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -373,9 +377,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -401,9 +404,12 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -422,8 +428,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -444,16 +450,16 @@ async def begin_delete( gallery_image_name: str, gallery_image_version_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Delete a gallery Image Version. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. + resides. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition in which the Image Version - resides. + resides. :type gallery_image_name: str :param gallery_image_version_name: The name of the gallery Image Version to be deleted. :type gallery_image_version_name: str @@ -463,8 +469,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -517,10 +523,10 @@ def list_by_gallery_image( :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. + resides. :type gallery_name: str :param gallery_image_name: The name of the Shared Image Gallery Image Definition from which the - Image Versions are to be listed. + Image Versions are to be listed. :type gallery_image_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GalleryImageVersionList or the result of cls(response) @@ -528,11 +534,18 @@ def list_by_gallery_image( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersionList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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_gallery_image.metadata['url'] # type: ignore @@ -547,15 +560,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_gallery_images_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_images_operations.py similarity index 90% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_gallery_images_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_images_operations.py index 53a5e3653c1f..ec915659187e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_gallery_images_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_images_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,10 +52,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.GalleryImage": cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -74,14 +77,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_image, 'GalleryImage') 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 @@ -89,7 +90,6 @@ async def _create_or_update_initial( 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('GalleryImage', pipeline_response) @@ -112,17 +112,17 @@ async def begin_create_or_update( gallery_image_name: str, gallery_image: "models.GalleryImage", **kwargs - ) -> "models.GalleryImage": + ) -> AsyncLROPoller["models.GalleryImage"]: """Create or update a gallery Image Definition. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to - be created. + be created. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition to be created or updated. - The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the - middle. The maximum length is 80 characters. + The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the + middle. The maximum length is 80 characters. :type gallery_image_name: str :param gallery_image: Parameters supplied to the create or update gallery image operation. :type gallery_image: ~azure.mgmt.compute.v2019_07_01.models.GalleryImage @@ -132,8 +132,8 @@ async def begin_create_or_update( 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: GalleryImage, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_07_01.models.GalleryImage + :return: An instance of AsyncLROPoller that returns either GalleryImage or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_07_01.models.GalleryImage] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -186,10 +186,13 @@ async def _update_initial( **kwargs ) -> "models.GalleryImage": cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -208,14 +211,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_image, 'GalleryImageUpdate') 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 @@ -238,17 +239,17 @@ async def begin_update( gallery_image_name: str, gallery_image: "models.GalleryImageUpdate", **kwargs - ) -> "models.GalleryImage": + ) -> AsyncLROPoller["models.GalleryImage"]: """Update a gallery Image Definition. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to - be updated. + be updated. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition to be updated. The allowed - characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - maximum length is 80 characters. + characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The + maximum length is 80 characters. :type gallery_image_name: str :param gallery_image: Parameters supplied to the update gallery image operation. :type gallery_image: ~azure.mgmt.compute.v2019_07_01.models.GalleryImageUpdate @@ -258,8 +259,8 @@ async def begin_update( 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: GalleryImage, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_07_01.models.GalleryImage + :return: An instance of AsyncLROPoller that returns either GalleryImage or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_07_01.models.GalleryImage] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -325,9 +326,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -345,9 +349,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -372,9 +375,12 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -392,8 +398,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -413,13 +419,13 @@ async def begin_delete( gallery_name: str, gallery_image_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Delete a gallery image. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to - be deleted. + be deleted. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition to be deleted. :type gallery_image_name: str @@ -429,8 +435,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -481,7 +487,7 @@ def list_by_gallery( :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery from which Image Definitions are to - be listed. + be listed. :type gallery_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GalleryImageList or the result of cls(response) @@ -489,11 +495,18 @@ def list_by_gallery( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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_gallery.metadata['url'] # type: ignore @@ -507,15 +520,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_images_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_images_operations.py similarity index 90% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_images_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_images_operations.py index acd4ab939080..9e38cc38ade9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_images_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_images_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.Image": cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'Image') 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('Image', pipeline_response) @@ -106,7 +106,7 @@ async def begin_create_or_update( image_name: str, parameters: "models.Image", **kwargs - ) -> "models.Image": + ) -> AsyncLROPoller["models.Image"]: """Create or update an image. :param resource_group_name: The name of the resource group. @@ -121,8 +121,8 @@ async def begin_create_or_update( 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: Image, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_07_01.models.Image + :return: An instance of AsyncLROPoller that returns either Image or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_07_01.models.Image] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -173,10 +173,13 @@ async def _update_initial( **kwargs ) -> "models.Image": cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -194,14 +197,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ImageUpdate') 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 @@ -209,7 +210,6 @@ async def _update_initial( 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('Image', pipeline_response) @@ -228,7 +228,7 @@ async def begin_update( image_name: str, parameters: "models.ImageUpdate", **kwargs - ) -> "models.Image": + ) -> AsyncLROPoller["models.Image"]: """Update an image. :param resource_group_name: The name of the resource group. @@ -243,8 +243,8 @@ async def begin_update( 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: Image, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_07_01.models.Image + :return: An instance of AsyncLROPoller that returns either Image or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_07_01.models.Image] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -294,7 +294,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -314,7 +316,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -333,7 +334,7 @@ async def begin_delete( resource_group_name: str, image_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes an Image. :param resource_group_name: The name of the resource group. @@ -346,8 +347,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -407,9 +408,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -428,9 +432,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -462,11 +465,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -479,15 +489,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -519,7 +525,7 @@ def list( **kwargs ) -> AsyncIterable["models.ImageListResult"]: """Gets the list of Images in the subscription. Use nextLink property in the response to get the - next page of Images. Do this till nextLink is null to fetch all the Images. + next page of Images. Do this till nextLink is null to fetch all the Images. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ImageListResult or the result of cls(response) @@ -527,11 +533,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -543,15 +556,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_log_analytics_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_log_analytics_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_log_analytics_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_log_analytics_operations.py index b2bca57ec4ca..b7d86dfd77ef 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_log_analytics_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_log_analytics_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -47,12 +47,15 @@ async def _export_request_rate_by_interval_initial( location: str, parameters: "models.RequestRateByIntervalInput", **kwargs - ) -> "models.LogAnalyticsOperationResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.LogAnalyticsOperationResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._export_request_rate_by_interval_initial.metadata['url'] # type: ignore @@ -69,14 +72,12 @@ async def _export_request_rate_by_interval_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RequestRateByIntervalInput') 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 @@ -99,9 +100,9 @@ async def begin_export_request_rate_by_interval( location: str, parameters: "models.RequestRateByIntervalInput", **kwargs - ) -> "models.LogAnalyticsOperationResult": + ) -> AsyncLROPoller["models.LogAnalyticsOperationResult"]: """Export logs that show Api requests made by this subscription in the given time window to show - throttling activities. + throttling activities. :param location: The location upon which virtual-machine-sizes is queried. :type location: str @@ -113,8 +114,8 @@ async def begin_export_request_rate_by_interval( 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: LogAnalyticsOperationResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_07_01.models.LogAnalyticsOperationResult + :return: An instance of AsyncLROPoller that returns either LogAnalyticsOperationResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_07_01.models.LogAnalyticsOperationResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -161,12 +162,15 @@ async def _export_throttled_requests_initial( location: str, parameters: "models.LogAnalyticsInputBase", **kwargs - ) -> "models.LogAnalyticsOperationResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.LogAnalyticsOperationResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._export_throttled_requests_initial.metadata['url'] # type: ignore @@ -183,14 +187,12 @@ async def _export_throttled_requests_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LogAnalyticsInputBase') 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 @@ -213,9 +215,9 @@ async def begin_export_throttled_requests( location: str, parameters: "models.LogAnalyticsInputBase", **kwargs - ) -> "models.LogAnalyticsOperationResult": + ) -> AsyncLROPoller["models.LogAnalyticsOperationResult"]: """Export logs that show total throttled Api requests for this subscription in the given time - window. + window. :param location: The location upon which virtual-machine-sizes is queried. :type location: str @@ -227,8 +229,8 @@ async def begin_export_throttled_requests( 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: LogAnalyticsOperationResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_07_01.models.LogAnalyticsOperationResult + :return: An instance of AsyncLROPoller that returns either LogAnalyticsOperationResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_07_01.models.LogAnalyticsOperationResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_operations.py similarity index 87% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_operations.py index 30c43c236e09..d32ad75c0fb6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -53,11 +53,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeOperationListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -65,15 +72,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_proximity_placement_groups_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_proximity_placement_groups_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_proximity_placement_groups_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_proximity_placement_groups_operations.py index c72d74199c5a..078c13fe7390 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_proximity_placement_groups_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_proximity_placement_groups_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -62,10 +62,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -83,14 +86,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ProximityPlacementGroup') 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 @@ -98,7 +99,6 @@ async def create_or_update( 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('ProximityPlacementGroup', pipeline_response) @@ -132,10 +132,13 @@ async def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -153,14 +156,12 @@ async def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'UpdateResource') 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 @@ -194,7 +195,9 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -214,7 +217,6 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -250,9 +252,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -271,9 +276,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -302,11 +306,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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_subscription.metadata['url'] # type: ignore @@ -318,15 +329,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -368,11 +375,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -385,15 +399,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_snapshots_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_snapshots_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_snapshots_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_snapshots_operations.py index 85f9f7385896..4ef3aee7ecad 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_snapshots_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_snapshots_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.Snapshot": cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('Snapshot', pipeline_response) @@ -106,14 +106,14 @@ async def begin_create_or_update( snapshot_name: str, snapshot: "models.Snapshot", **kwargs - ) -> "models.Snapshot": + ) -> 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. + 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.v2019_07_01.models.Snapshot @@ -123,8 +123,8 @@ async def begin_create_or_update( 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: Snapshot, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_07_01.models.Snapshot + :return: An instance of AsyncLROPoller that returns either Snapshot or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_07_01.models.Snapshot] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -175,10 +175,13 @@ async def _update_initial( **kwargs ) -> "models.Snapshot": cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -196,14 +199,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -211,7 +212,6 @@ async def _update_initial( 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('Snapshot', pipeline_response) @@ -230,14 +230,14 @@ async def begin_update( snapshot_name: str, snapshot: "models.SnapshotUpdate", **kwargs - ) -> "models.Snapshot": + ) -> 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. + 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.v2019_07_01.models.SnapshotUpdate @@ -247,8 +247,8 @@ async def begin_update( 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: Snapshot, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_07_01.models.Snapshot + :return: An instance of AsyncLROPoller that returns either Snapshot or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_07_01.models.Snapshot] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -311,9 +311,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -330,9 +333,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -356,7 +358,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -376,7 +380,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -395,14 +398,14 @@ async def begin_delete( resource_group_name: str, snapshot_name: str, **kwargs - ) -> None: + ) -> 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. + 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. @@ -410,8 +413,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -465,11 +468,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -482,15 +492,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -529,11 +535,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -545,15 +558,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -586,12 +595,15 @@ async def _grant_access_initial( snapshot_name: str, grant_access_data: "models.GrantAccessData", **kwargs - ) -> "models.AccessUri": - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> 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 = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._grant_access_initial.metadata['url'] # type: ignore @@ -609,14 +621,12 @@ async def _grant_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -640,17 +650,17 @@ async def begin_grant_access( snapshot_name: str, grant_access_data: "models.GrantAccessData", **kwargs - ) -> "models.AccessUri": + ) -> 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. + 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. + operation. :type grant_access_data: ~azure.mgmt.compute.v2019_07_01.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. @@ -658,8 +668,8 @@ async def begin_grant_access( 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: AccessUri, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_07_01.models.AccessUri + :return: An instance of AsyncLROPoller that returns either AccessUri or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_07_01.models.AccessUri] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -709,7 +719,9 @@ async def _revoke_access_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -729,7 +741,6 @@ async def _revoke_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -748,14 +759,14 @@ async def begin_revoke_access( resource_group_name: str, snapshot_name: str, **kwargs - ) -> None: + ) -> 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. + 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. @@ -763,8 +774,8 @@ async def begin_revoke_access( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_usage_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_usage_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_usage_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_usage_operations.py index 421fc686c99d..e7757a44290b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_usage_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_usage_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -47,7 +47,7 @@ def list( **kwargs ) -> AsyncIterable["models.ListUsagesResult"]: """Gets, for the specified location, the current compute resource usage information as well as the - limits for compute resources under the subscription. + limits for compute resources under the subscription. :param location: The location for which resource usage is queried. :type location: str @@ -57,11 +57,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -74,15 +81,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_virtual_machine_extension_images_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_extension_images_operations.py similarity index 92% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_virtual_machine_extension_images_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_extension_images_operations.py index 1272ff0d1aff..5bcb28e31a72 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_virtual_machine_extension_images_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -64,9 +64,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -85,9 +88,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -122,9 +124,12 @@ async def list_types( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.list_types.metadata['url'] # type: ignore @@ -141,9 +146,8 @@ async def list_types( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -190,9 +194,12 @@ async def list_versions( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.list_versions.metadata['url'] # type: ignore @@ -216,9 +223,8 @@ async def list_versions( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_virtual_machine_extensions_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_extensions_operations.py similarity index 92% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_virtual_machine_extensions_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_extensions_operations.py index 8bba64f5fef4..8c0d708f65e9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_virtual_machine_extensions_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_extensions_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachineExtension": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -73,14 +76,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtension') 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 @@ -88,7 +89,6 @@ async def _create_or_update_initial( 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('VirtualMachineExtension', pipeline_response) @@ -108,18 +108,18 @@ async def begin_create_or_update( vm_extension_name: str, extension_parameters: "models.VirtualMachineExtension", **kwargs - ) -> "models.VirtualMachineExtension": + ) -> AsyncLROPoller["models.VirtualMachineExtension"]: """The operation to create or update the extension. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_name: The name of the virtual machine where the extension should be created or - updated. + updated. :type vm_name: str :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Create Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineExtension :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. @@ -127,8 +127,8 @@ async def begin_create_or_update( 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: VirtualMachineExtension, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineExtension + :return: An instance of AsyncLROPoller that returns either VirtualMachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -181,10 +181,13 @@ async def _update_initial( **kwargs ) -> "models.VirtualMachineExtension": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -203,14 +206,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtensionUpdate') 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 @@ -233,7 +234,7 @@ async def begin_update( vm_extension_name: str, extension_parameters: "models.VirtualMachineExtensionUpdate", **kwargs - ) -> "models.VirtualMachineExtension": + ) -> AsyncLROPoller["models.VirtualMachineExtension"]: """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -243,7 +244,7 @@ async def begin_update( :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Update Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineExtensionUpdate :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. @@ -251,8 +252,8 @@ async def begin_update( 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: VirtualMachineExtension, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineExtension + :return: An instance of AsyncLROPoller that returns either VirtualMachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -304,7 +305,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -325,7 +328,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -345,7 +347,7 @@ async def begin_delete( vm_name: str, vm_extension_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -360,8 +362,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -425,9 +427,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -447,9 +452,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -487,9 +491,12 @@ async def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -508,9 +515,8 @@ async def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_virtual_machine_images_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_images_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_virtual_machine_images_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_images_operations.py index 229347568b6d..518092982372 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_virtual_machine_images_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_images_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -67,9 +67,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -89,9 +92,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -142,9 +144,12 @@ async def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -169,9 +174,8 @@ async def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -206,9 +210,12 @@ async def list_offers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.list_offers.metadata['url'] # type: ignore @@ -225,9 +232,8 @@ async def list_offers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -259,9 +265,12 @@ async def list_publishers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.list_publishers.metadata['url'] # type: ignore @@ -277,9 +286,8 @@ async def list_publishers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -317,9 +325,12 @@ async def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.list_skus.metadata['url'] # type: ignore @@ -337,9 +348,8 @@ async def list_skus( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_virtual_machine_run_commands_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_run_commands_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_virtual_machine_run_commands_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_run_commands_operations.py index cc1170440109..d9f192b9564f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_virtual_machine_run_commands_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,11 +56,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json, text/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 @@ -73,15 +80,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -126,9 +129,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandDocument"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json, text/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -145,9 +151,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_virtual_machine_scale_set_extensions_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_virtual_machine_scale_set_extensions_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index c045ace278a5..2bcf8b4a69df 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_virtual_machine_scale_set_extensions_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,10 +52,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachineScaleSetExtension": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -74,14 +77,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineScaleSetExtension') 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 @@ -89,7 +90,6 @@ async def _create_or_update_initial( 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('VirtualMachineScaleSetExtension', pipeline_response) @@ -109,18 +109,18 @@ async def begin_create_or_update( vmss_extension_name: str, extension_parameters: "models.VirtualMachineScaleSetExtension", **kwargs - ) -> "models.VirtualMachineScaleSetExtension": + ) -> AsyncLROPoller["models.VirtualMachineScaleSetExtension"]: """The operation to create or update an extension. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_scale_set_name: The name of the VM scale set where the extension should be create or - updated. + updated. :type vm_scale_set_name: str :param vmss_extension_name: The name of the VM scale set extension. :type vmss_extension_name: str :param extension_parameters: Parameters supplied to the Create VM scale set Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSetExtension :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. @@ -128,8 +128,8 @@ async def begin_create_or_update( 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: VirtualMachineScaleSetExtension, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSetExtension + :return: An instance of AsyncLROPoller that returns either VirtualMachineScaleSetExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSetExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -182,10 +182,13 @@ async def _update_initial( **kwargs ) -> "models.VirtualMachineScaleSetExtension": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -204,14 +207,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineScaleSetExtensionUpdate') 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 @@ -219,7 +220,6 @@ async def _update_initial( 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('VirtualMachineScaleSetExtension', pipeline_response) @@ -239,7 +239,7 @@ async def begin_update( vmss_extension_name: str, extension_parameters: "models.VirtualMachineScaleSetExtensionUpdate", **kwargs - ) -> "models.VirtualMachineScaleSetExtension": + ) -> AsyncLROPoller["models.VirtualMachineScaleSetExtension"]: """The operation to update an extension. :param resource_group_name: The name of the resource group. @@ -249,7 +249,7 @@ async def begin_update( :param vmss_extension_name: The name of the VM scale set extension. :type vmss_extension_name: str :param extension_parameters: Parameters supplied to the Update VM scale set Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSetExtensionUpdate :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. @@ -257,8 +257,8 @@ async def begin_update( 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: VirtualMachineScaleSetExtension, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSetExtension + :return: An instance of AsyncLROPoller that returns either VirtualMachineScaleSetExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSetExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -310,7 +310,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -331,7 +333,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -351,7 +352,7 @@ async def begin_delete( vm_scale_set_name: str, vmss_extension_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -366,8 +367,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -431,9 +432,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -453,9 +457,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -490,11 +493,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtensionListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -508,15 +518,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_virtual_machine_scale_set_rolling_upgrades_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_virtual_machine_scale_set_rolling_upgrades_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index cb140d82a684..b5031277ce71 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_virtual_machine_scale_set_rolling_upgrades_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -49,7 +49,9 @@ async def _cancel_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -69,7 +71,6 @@ async def _cancel_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -88,7 +89,7 @@ async def begin_cancel( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Cancels the current virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -101,8 +102,8 @@ async def begin_cancel( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -148,7 +149,9 @@ async def _start_os_upgrade_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -168,7 +171,6 @@ async def _start_os_upgrade_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -187,10 +189,10 @@ async def begin_start_os_upgrade( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts a rolling upgrade to move all virtual machine scale set instances to the latest - available Platform Image OS version. Instances which are already running the latest available - OS version are not affected. + available Platform Image OS version. Instances which are already running the latest available + OS version are not affected. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -202,8 +204,8 @@ async def begin_start_os_upgrade( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -249,7 +251,9 @@ async def _start_extension_upgrade_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -269,7 +273,6 @@ async def _start_extension_upgrade_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -288,10 +291,10 @@ async def begin_start_extension_upgrade( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to - the latest available extension version. Instances which are already running the latest - extension versions are not affected. + the latest available extension version. Instances which are already running the latest + extension versions are not affected. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -303,8 +306,8 @@ async def begin_start_extension_upgrade( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -361,9 +364,12 @@ async def get_latest( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RollingUpgradeStatusInfo"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get_latest.metadata['url'] # type: ignore @@ -380,9 +386,8 @@ async def get_latest( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_virtual_machine_scale_set_vm_extensions_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py similarity index 92% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_virtual_machine_scale_set_vm_extensions_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py index 3a0af617783c..81e5b66da904 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_virtual_machine_scale_set_vm_extensions_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,10 +52,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachineExtension": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -75,14 +78,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtension') 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 @@ -90,7 +91,6 @@ async def _create_or_update_initial( 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('VirtualMachineExtension', pipeline_response) @@ -111,7 +111,7 @@ async def begin_create_or_update( vm_extension_name: str, extension_parameters: "models.VirtualMachineExtension", **kwargs - ) -> "models.VirtualMachineExtension": + ) -> AsyncLROPoller["models.VirtualMachineExtension"]: """The operation to create or update the VMSS VM extension. :param resource_group_name: The name of the resource group. @@ -123,7 +123,7 @@ async def begin_create_or_update( :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Create Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineExtension :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. @@ -131,8 +131,8 @@ async def begin_create_or_update( 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: VirtualMachineExtension, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineExtension + :return: An instance of AsyncLROPoller that returns either VirtualMachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -187,10 +187,13 @@ async def _update_initial( **kwargs ) -> "models.VirtualMachineExtension": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -210,14 +213,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtensionUpdate') 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 @@ -241,7 +242,7 @@ async def begin_update( vm_extension_name: str, extension_parameters: "models.VirtualMachineExtensionUpdate", **kwargs - ) -> "models.VirtualMachineExtension": + ) -> AsyncLROPoller["models.VirtualMachineExtension"]: """The operation to update the VMSS VM extension. :param resource_group_name: The name of the resource group. @@ -253,7 +254,7 @@ async def begin_update( :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Update Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineExtensionUpdate :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. @@ -261,8 +262,8 @@ async def begin_update( 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: VirtualMachineExtension, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineExtension + :return: An instance of AsyncLROPoller that returns either VirtualMachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -316,9 +317,12 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -337,8 +341,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -359,7 +363,7 @@ async def begin_delete( instance_id: str, vm_extension_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to delete the VMSS VM extension. :param resource_group_name: The name of the resource group. @@ -376,8 +380,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -445,9 +449,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -468,9 +475,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -511,9 +517,12 @@ async def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -533,9 +542,8 @@ async def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_virtual_machine_scale_set_vms_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_vms_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_virtual_machine_scale_set_vms_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index 63f93e736e23..49a41921e880 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_virtual_machine_scale_set_vms_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,7 +52,9 @@ async def _reimage_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") @@ -75,7 +77,6 @@ async def _reimage_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_scale_set_vm_reimage_input is not None: body_content = self._serialize.body(vm_scale_set_vm_reimage_input, 'VirtualMachineReimageParameters') @@ -83,7 +84,6 @@ async def _reimage_initial( body_content = None 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 @@ -103,7 +103,7 @@ async def begin_reimage( instance_id: str, vm_scale_set_vm_reimage_input: Optional["models.VirtualMachineReimageParameters"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -120,8 +120,8 @@ async def begin_reimage( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -170,7 +170,9 @@ async def _reimage_all_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -191,7 +193,6 @@ async def _reimage_all_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -211,9 +212,9 @@ async def begin_reimage_all( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. - This operation is only supported for managed disks. + This operation is only supported for managed disks. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -227,8 +228,8 @@ async def begin_reimage_all( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -276,7 +277,9 @@ async def _deallocate_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -297,7 +300,6 @@ async def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -317,10 +319,10 @@ async def begin_deallocate( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and - releases the compute resources it uses. You are not billed for the compute resources of this - virtual machine once it is deallocated. + releases the compute resources it uses. You are not billed for the compute resources of this + virtual machine once it is deallocated. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -334,8 +336,8 @@ async def begin_deallocate( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -384,10 +386,13 @@ async def _update_initial( **kwargs ) -> "models.VirtualMachineScaleSetVM": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -406,14 +411,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSetVM') 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 @@ -421,7 +424,6 @@ async def _update_initial( 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('VirtualMachineScaleSetVM', pipeline_response) @@ -441,13 +443,13 @@ async def begin_update( instance_id: str, parameters: "models.VirtualMachineScaleSetVM", **kwargs - ) -> "models.VirtualMachineScaleSetVM": + ) -> AsyncLROPoller["models.VirtualMachineScaleSetVM"]: """Updates a virtual machine of a VM scale set. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_scale_set_name: The name of the VM scale set where the extension should be create or - updated. + updated. :type vm_scale_set_name: str :param instance_id: The instance ID of the virtual machine. :type instance_id: str @@ -459,8 +461,8 @@ async def begin_update( 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: VirtualMachineScaleSetVM, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSetVM + :return: An instance of AsyncLROPoller that returns either VirtualMachineScaleSetVM or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSetVM] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -512,7 +514,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -533,7 +537,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -553,7 +556,7 @@ async def begin_delete( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -568,8 +571,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -633,9 +636,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -655,9 +661,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -695,9 +700,12 @@ async def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -715,9 +723,8 @@ async def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -749,11 +756,14 @@ def list( :type resource_group_name: str :param virtual_machine_scale_set_name: The name of the VM scale set. :type virtual_machine_scale_set_name: str - :param filter: The filter to apply to the operation. + :param filter: The filter to apply to the operation. Allowed values are + 'startswith(instanceView/statuses/code, 'PowerState') eq true', 'properties/latestModelApplied + eq true', 'properties/latestModelApplied eq false'. :type filter: str - :param select: The list parameters. + :param select: The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. :type select: str - :param expand: The expand expression to apply to the operation. + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetVMListResult or the result of cls(response) @@ -761,11 +771,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -785,15 +802,11 @@ def prepare_request(next_link=None): query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -829,7 +842,9 @@ async def _power_off_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -852,7 +867,6 @@ async def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -873,10 +887,10 @@ async def begin_power_off( instance_id: str, skip_shutdown: Optional[bool] = False, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached - and you are getting charged for the resources. Instead, use deallocate to release resources and - avoid charges. + and you are getting charged for the resources. Instead, use deallocate to release resources and + avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -885,8 +899,8 @@ async def begin_power_off( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param skip_shutdown: The parameter to request non-graceful VM shutdown. True value for this - flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this - flag is false if not specified. + flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this + flag is false if not specified. :type skip_shutdown: 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. @@ -894,8 +908,8 @@ async def begin_power_off( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -944,7 +958,9 @@ async def _restart_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -965,7 +981,6 @@ async def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -985,7 +1000,7 @@ async def begin_restart( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Restarts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1000,8 +1015,8 @@ async def begin_restart( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1049,7 +1064,9 @@ async def _start_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -1070,7 +1087,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1090,7 +1106,7 @@ async def begin_start( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1105,8 +1121,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1154,7 +1170,9 @@ async def _redeploy_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -1175,7 +1193,6 @@ async def _redeploy_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1195,9 +1212,9 @@ async def begin_redeploy( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and - powers it back on. + powers it back on. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1211,8 +1228,8 @@ async def begin_redeploy( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1260,7 +1277,9 @@ async def _perform_maintenance_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -1281,7 +1300,6 @@ async def _perform_maintenance_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1301,7 +1319,7 @@ async def begin_perform_maintenance( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Performs maintenance on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1316,8 +1334,8 @@ async def begin_perform_maintenance( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1364,12 +1382,15 @@ async def _run_command_initial( instance_id: str, parameters: "models.RunCommandInput", **kwargs - ) -> "models.RunCommandResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.RunCommandResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" # Construct URL url = self._run_command_initial.metadata['url'] # type: ignore @@ -1388,14 +1409,12 @@ async def _run_command_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RunCommandInput') 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 @@ -1420,7 +1439,7 @@ async def begin_run_command( instance_id: str, parameters: "models.RunCommandInput", **kwargs - ) -> "models.RunCommandResult": + ) -> AsyncLROPoller["models.RunCommandResult"]: """Run command on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1437,8 +1456,8 @@ async def begin_run_command( 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: RunCommandResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_07_01.models.RunCommandResult + :return: An instance of AsyncLROPoller that returns either RunCommandResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_07_01.models.RunCommandResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_virtual_machine_scale_sets_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_sets_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_virtual_machine_scale_sets_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_sets_operations.py index 1adddae4a2b9..d3eab805ba8e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_virtual_machine_scale_sets_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachineScaleSet": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSet') 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('VirtualMachineScaleSet', pipeline_response) @@ -106,7 +106,7 @@ async def begin_create_or_update( vm_scale_set_name: str, parameters: "models.VirtualMachineScaleSet", **kwargs - ) -> "models.VirtualMachineScaleSet": + ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -121,8 +121,8 @@ async def begin_create_or_update( 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: VirtualMachineScaleSet, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSet + :return: An instance of AsyncLROPoller that returns either VirtualMachineScaleSet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -173,10 +173,13 @@ async def _update_initial( **kwargs ) -> "models.VirtualMachineScaleSet": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -194,14 +197,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSetUpdate') 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 @@ -223,7 +224,7 @@ async def begin_update( vm_scale_set_name: str, parameters: "models.VirtualMachineScaleSetUpdate", **kwargs - ) -> "models.VirtualMachineScaleSet": + ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: """Update a VM scale set. :param resource_group_name: The name of the resource group. @@ -238,8 +239,8 @@ async def begin_update( 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: VirtualMachineScaleSet, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSet + :return: An instance of AsyncLROPoller that returns either VirtualMachineScaleSet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -289,7 +290,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -309,7 +312,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -328,7 +330,7 @@ async def begin_delete( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VM scale set. :param resource_group_name: The name of the resource group. @@ -341,8 +343,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -399,9 +401,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -418,9 +423,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -445,7 +449,9 @@ async def _deallocate_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") @@ -467,7 +473,6 @@ async def _deallocate_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -475,7 +480,6 @@ async def _deallocate_initial( body_content = None 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 @@ -494,10 +498,10 @@ async def begin_deallocate( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and - releases the compute resources. You are not billed for the compute resources that this virtual - machine scale set deallocates. + releases the compute resources. You are not billed for the compute resources that this virtual + machine scale set deallocates. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -511,8 +515,8 @@ async def begin_deallocate( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -560,7 +564,9 @@ async def _delete_instances_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") @@ -582,12 +588,10 @@ async def _delete_instances_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -606,7 +610,7 @@ async def begin_delete_instances( vm_scale_set_name: str, vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -621,8 +625,8 @@ async def begin_delete_instances( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -680,9 +684,12 @@ async def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -699,9 +706,8 @@ async def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -733,11 +739,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -750,15 +763,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -790,8 +799,8 @@ def list_all( **kwargs ) -> AsyncIterable["models.VirtualMachineScaleSetListWithLinkResult"]: """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource - group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this - till nextLink is null to fetch all the VM Scale Sets. + group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this + till nextLink is null to fetch all the VM Scale Sets. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetListWithLinkResult or the result of cls(response) @@ -799,11 +808,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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_all.metadata['url'] # type: ignore @@ -815,15 +831,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -857,7 +869,7 @@ def list_skus( **kwargs ) -> AsyncIterable["models.VirtualMachineScaleSetListSkusResult"]: """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM - instances allowed for each SKU. + instances allowed for each SKU. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -869,11 +881,18 @@ def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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_skus.metadata['url'] # type: ignore @@ -887,15 +906,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -940,11 +955,18 @@ def get_os_upgrade_history( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListOSUpgradeHistory"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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.get_os_upgrade_history.metadata['url'] # type: ignore @@ -958,15 +980,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1002,7 +1020,9 @@ async def _power_off_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") @@ -1026,7 +1046,6 @@ async def _power_off_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1034,7 +1053,6 @@ async def _power_off_initial( body_content = None 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 @@ -1054,18 +1072,18 @@ async def begin_power_off( skip_shutdown: Optional[bool] = False, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still - attached and you are getting charged for the resources. Instead, use deallocate to release - resources and avoid charges. + attached and you are getting charged for the resources. Instead, use deallocate to release + resources and avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_scale_set_name: The name of the VM scale set. :type vm_scale_set_name: str :param skip_shutdown: The parameter to request non-graceful VM shutdown. True value for this - flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this - flag is false if not specified. + flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this + flag is false if not specified. :type skip_shutdown: bool :param vm_instance_i_ds: A list of virtual machine instance IDs from the VM scale set. :type vm_instance_i_ds: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSetVMInstanceIDs @@ -1075,8 +1093,8 @@ async def begin_power_off( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1125,7 +1143,9 @@ async def _restart_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") @@ -1147,7 +1167,6 @@ async def _restart_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1155,7 +1174,6 @@ async def _restart_initial( body_content = None 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 @@ -1174,7 +1192,7 @@ async def begin_restart( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Restarts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1189,8 +1207,8 @@ async def begin_restart( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1238,7 +1256,9 @@ async def _start_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") @@ -1260,7 +1280,6 @@ async def _start_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1268,7 +1287,6 @@ async def _start_initial( body_content = None 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 @@ -1287,7 +1305,7 @@ async def begin_start( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1302,8 +1320,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1351,7 +1369,9 @@ async def _redeploy_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") @@ -1373,7 +1393,6 @@ async def _redeploy_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1381,7 +1400,6 @@ async def _redeploy_initial( body_content = None 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 @@ -1400,9 +1418,9 @@ async def begin_redeploy( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, - and powers them back on. + and powers them back on. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1416,8 +1434,8 @@ async def begin_redeploy( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1465,7 +1483,9 @@ async def _perform_maintenance_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") @@ -1487,7 +1507,6 @@ async def _perform_maintenance_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1495,7 +1514,6 @@ async def _perform_maintenance_initial( body_content = None 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 @@ -1514,11 +1532,11 @@ async def begin_perform_maintenance( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances - which are not eligible for perform maintenance will be failed. Please refer to best practices - for more details: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual- - machine-scale-sets-maintenance-notifications. + which are not eligible for perform maintenance will be failed. Please refer to best practices + for more details: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual- + machine-scale-sets-maintenance-notifications. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1532,8 +1550,8 @@ async def begin_perform_maintenance( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1581,7 +1599,9 @@ async def _update_instances_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") @@ -1603,12 +1623,10 @@ async def _update_instances_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -1627,7 +1645,7 @@ async def begin_update_instances( vm_scale_set_name: str, vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. :param resource_group_name: The name of the resource group. @@ -1642,8 +1660,8 @@ async def begin_update_instances( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1691,7 +1709,9 @@ async def _reimage_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") @@ -1713,7 +1733,6 @@ async def _reimage_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_scale_set_reimage_input is not None: body_content = self._serialize.body(vm_scale_set_reimage_input, 'VirtualMachineScaleSetReimageParameters') @@ -1721,7 +1740,6 @@ async def _reimage_initial( body_content = None 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 @@ -1740,10 +1758,10 @@ async def begin_reimage( vm_scale_set_name: str, vm_scale_set_reimage_input: Optional["models.VirtualMachineScaleSetReimageParameters"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which - don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual - machine is reset to initial state. + don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual + machine is reset to initial state. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1757,8 +1775,8 @@ async def begin_reimage( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1806,7 +1824,9 @@ async def _reimage_all_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") @@ -1828,7 +1848,6 @@ async def _reimage_all_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1836,7 +1855,6 @@ async def _reimage_all_initial( body_content = None 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 @@ -1855,9 +1873,9 @@ async def begin_reimage_all( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This - operation is only supported for managed disks. + operation is only supported for managed disks. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1871,8 +1889,8 @@ async def begin_reimage_all( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1935,9 +1953,12 @@ async def force_recovery_service_fabric_platform_update_domain_walk( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RecoveryWalkResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.force_recovery_service_fabric_platform_update_domain_walk.metadata['url'] # type: ignore @@ -1955,9 +1976,8 @@ async def force_recovery_service_fabric_platform_update_domain_walk( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1995,8 +2015,11 @@ async def convert_to_single_placement_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL @@ -2010,17 +2033,16 @@ async def convert_to_single_placement_group( # 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') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VMScaleSetConvertToSinglePlacementGroupInput') 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_virtual_machine_sizes_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_sizes_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_virtual_machine_sizes_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_sizes_operations.py index 5e5ac0531f84..19abb5da295c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_virtual_machine_sizes_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_sizes_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -47,7 +47,7 @@ def list( **kwargs ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: """This API is deprecated. Use `Resources Skus `_. + us/rest/api/compute/resourceskus/list>`_. :param location: The location upon which virtual-machine-sizes is queried. :type location: str @@ -57,11 +57,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -74,15 +81,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_virtual_machines_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machines_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_virtual_machines_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machines_operations.py index 55b45c11a078..1d40e12f2a26 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/_virtual_machines_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machines_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -58,11 +58,18 @@ def list_by_location( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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_location.metadata['url'] # type: ignore @@ -75,15 +82,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -116,12 +119,15 @@ async def _capture_initial( vm_name: str, parameters: "models.VirtualMachineCaptureParameters", **kwargs - ) -> "models.VirtualMachineCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.VirtualMachineCaptureResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._capture_initial.metadata['url'] # type: ignore @@ -139,14 +145,12 @@ async def _capture_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineCaptureParameters') 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 @@ -170,9 +174,9 @@ async def begin_capture( vm_name: str, parameters: "models.VirtualMachineCaptureParameters", **kwargs - ) -> "models.VirtualMachineCaptureResult": + ) -> AsyncLROPoller["models.VirtualMachineCaptureResult"]: """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used - to create similar VMs. + to create similar VMs. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -186,8 +190,8 @@ async def begin_capture( 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: VirtualMachineCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineCaptureResult + :return: An instance of AsyncLROPoller that returns either VirtualMachineCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineCaptureResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -238,10 +242,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachine": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -259,14 +266,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachine') 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 @@ -274,7 +279,6 @@ async def _create_or_update_initial( 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('VirtualMachine', pipeline_response) @@ -293,9 +297,9 @@ async def begin_create_or_update( vm_name: str, parameters: "models.VirtualMachine", **kwargs - ) -> "models.VirtualMachine": + ) -> AsyncLROPoller["models.VirtualMachine"]: """The operation to create or update a virtual machine. Please note some properties can be set - only during virtual machine creation. + only during virtual machine creation. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -309,8 +313,8 @@ async def begin_create_or_update( 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: VirtualMachine, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachine + :return: An instance of AsyncLROPoller that returns either VirtualMachine or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_07_01.models.VirtualMachine] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -361,10 +365,13 @@ async def _update_initial( **kwargs ) -> "models.VirtualMachine": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -382,14 +389,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineUpdate') 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 @@ -397,7 +402,6 @@ async def _update_initial( 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('VirtualMachine', pipeline_response) @@ -416,7 +420,7 @@ async def begin_update( vm_name: str, parameters: "models.VirtualMachineUpdate", **kwargs - ) -> "models.VirtualMachine": + ) -> AsyncLROPoller["models.VirtualMachine"]: """The operation to update a virtual machine. :param resource_group_name: The name of the resource group. @@ -431,8 +435,8 @@ async def begin_update( 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: VirtualMachine, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachine + :return: An instance of AsyncLROPoller that returns either VirtualMachine or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_07_01.models.VirtualMachine] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -482,7 +486,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -502,7 +508,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -521,7 +526,7 @@ async def begin_delete( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to delete a virtual machine. :param resource_group_name: The name of the resource group. @@ -534,8 +539,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -595,9 +600,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -616,9 +624,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -653,9 +660,12 @@ async def instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.instance_view.metadata['url'] # type: ignore @@ -672,9 +682,8 @@ async def instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -698,7 +707,9 @@ async def _convert_to_managed_disks_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -718,7 +729,6 @@ async def _convert_to_managed_disks_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -737,9 +747,9 @@ async def begin_convert_to_managed_disks( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop- - deallocated before invoking this operation. + deallocated before invoking this operation. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -751,8 +761,8 @@ async def begin_convert_to_managed_disks( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -798,7 +808,9 @@ async def _deallocate_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -818,7 +830,6 @@ async def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -837,9 +848,9 @@ async def begin_deallocate( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Shuts down the virtual machine and releases the compute resources. You are not billed for the - compute resources that this virtual machine uses. + compute resources that this virtual machine uses. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -851,8 +862,8 @@ async def begin_deallocate( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -914,7 +925,9 @@ async def generalize( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -934,7 +947,6 @@ async def generalize( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -954,7 +966,7 @@ def list( **kwargs ) -> AsyncIterable["models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified resource group. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -964,11 +976,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -981,15 +1000,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1022,10 +1037,10 @@ def list_all( **kwargs ) -> AsyncIterable["models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified subscription. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :param status_only: statusOnly=true enables fetching run time status of all Virtual Machines in - the subscription. + the subscription. :type status_only: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineListResult or the result of cls(response) @@ -1033,11 +1048,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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_all.metadata['url'] # type: ignore @@ -1051,15 +1073,11 @@ def prepare_request(next_link=None): if status_only is not None: query_parameters['statusOnly'] = self._serialize.query("status_only", status_only, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1093,7 +1111,7 @@ def list_available_sizes( **kwargs ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes to which the specified virtual machine can be - resized. + resized. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1105,11 +1123,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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_available_sizes.metadata['url'] # type: ignore @@ -1123,15 +1148,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1166,7 +1187,9 @@ async def _power_off_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -1188,7 +1211,6 @@ async def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1208,17 +1230,17 @@ async def begin_power_off( vm_name: str, skip_shutdown: Optional[bool] = False, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with - the same provisioned resources. You are still charged for this virtual machine. + the same provisioned resources. You are still charged for this virtual machine. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_name: The name of the virtual machine. :type vm_name: str :param skip_shutdown: The parameter to request non-graceful VM shutdown. True value for this - flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this - flag is false if not specified. + flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this + flag is false if not specified. :type skip_shutdown: 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. @@ -1226,8 +1248,8 @@ async def begin_power_off( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1274,9 +1296,12 @@ async def _reapply_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self._reapply_initial.metadata['url'] # type: ignore @@ -1293,8 +1318,8 @@ async def _reapply_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1313,7 +1338,7 @@ async def begin_reapply( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to reapply a virtual machine's state. :param resource_group_name: The name of the resource group. @@ -1326,8 +1351,8 @@ async def begin_reapply( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1373,7 +1398,9 @@ async def _restart_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -1393,7 +1420,6 @@ async def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1412,7 +1438,7 @@ async def begin_restart( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to restart a virtual machine. :param resource_group_name: The name of the resource group. @@ -1425,8 +1451,8 @@ async def begin_restart( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1472,7 +1498,9 @@ async def _start_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -1492,7 +1520,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1511,7 +1538,7 @@ async def begin_start( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to start a virtual machine. :param resource_group_name: The name of the resource group. @@ -1524,8 +1551,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1571,7 +1598,9 @@ async def _redeploy_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -1591,7 +1620,6 @@ async def _redeploy_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1610,7 +1638,7 @@ async def begin_redeploy( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Shuts down the virtual machine, moves it to a new node, and powers it back on. :param resource_group_name: The name of the resource group. @@ -1623,8 +1651,8 @@ async def begin_redeploy( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1671,7 +1699,9 @@ async def _reimage_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") @@ -1693,7 +1723,6 @@ async def _reimage_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: body_content = self._serialize.body(parameters, 'VirtualMachineReimageParameters') @@ -1701,7 +1730,6 @@ async def _reimage_initial( body_content = None 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 @@ -1720,7 +1748,7 @@ async def begin_reimage( vm_name: str, parameters: Optional["models.VirtualMachineReimageParameters"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Reimages the virtual machine which has an ephemeral OS disk back to its initial state. :param resource_group_name: The name of the resource group. @@ -1735,8 +1763,8 @@ async def begin_reimage( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1783,7 +1811,9 @@ async def _perform_maintenance_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -1803,7 +1833,6 @@ async def _perform_maintenance_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1822,7 +1851,7 @@ async def begin_perform_maintenance( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to perform maintenance on a virtual machine. :param resource_group_name: The name of the resource group. @@ -1835,8 +1864,8 @@ async def begin_perform_maintenance( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1881,12 +1910,15 @@ async def _run_command_initial( vm_name: str, parameters: "models.RunCommandInput", **kwargs - ) -> "models.RunCommandResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.RunCommandResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" # Construct URL url = self._run_command_initial.metadata['url'] # type: ignore @@ -1904,14 +1936,12 @@ async def _run_command_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RunCommandInput') 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 @@ -1935,7 +1965,7 @@ async def begin_run_command( vm_name: str, parameters: "models.RunCommandInput", **kwargs - ) -> "models.RunCommandResult": + ) -> AsyncLROPoller["models.RunCommandResult"]: """Run command on the VM. :param resource_group_name: The name of the resource group. @@ -1950,8 +1980,8 @@ async def begin_run_command( 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: RunCommandResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_07_01.models.RunCommandResult + :return: An instance of AsyncLROPoller that returns either RunCommandResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_07_01.models.RunCommandResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/__init__.py deleted file mode 100644 index fc077a10d8a1..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations_async/__init__.py +++ /dev/null @@ -1,65 +0,0 @@ -# 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 ._operations_async import Operations -from ._availability_sets_operations_async import AvailabilitySetsOperations -from ._proximity_placement_groups_operations_async import ProximityPlacementGroupsOperations -from ._dedicated_host_groups_operations_async import DedicatedHostGroupsOperations -from ._dedicated_hosts_operations_async import DedicatedHostsOperations -from ._virtual_machine_extension_images_operations_async import VirtualMachineExtensionImagesOperations -from ._virtual_machine_extensions_operations_async import VirtualMachineExtensionsOperations -from ._virtual_machine_images_operations_async import VirtualMachineImagesOperations -from ._usage_operations_async import UsageOperations -from ._virtual_machines_operations_async import VirtualMachinesOperations -from ._virtual_machine_sizes_operations_async import VirtualMachineSizesOperations -from ._images_operations_async import ImagesOperations -from ._virtual_machine_scale_sets_operations_async import VirtualMachineScaleSetsOperations -from ._virtual_machine_scale_set_extensions_operations_async import VirtualMachineScaleSetExtensionsOperations -from ._virtual_machine_scale_set_rolling_upgrades_operations_async import VirtualMachineScaleSetRollingUpgradesOperations -from ._virtual_machine_scale_set_vm_extensions_operations_async import VirtualMachineScaleSetVMExtensionsOperations -from ._virtual_machine_scale_set_vms_operations_async import VirtualMachineScaleSetVMsOperations -from ._log_analytics_operations_async import LogAnalyticsOperations -from ._disks_operations_async import DisksOperations -from ._snapshots_operations_async import SnapshotsOperations -from ._disk_encryption_sets_operations_async import DiskEncryptionSetsOperations -from ._galleries_operations_async import GalleriesOperations -from ._gallery_images_operations_async import GalleryImagesOperations -from ._gallery_image_versions_operations_async import GalleryImageVersionsOperations -from ._gallery_applications_operations_async import GalleryApplicationsOperations -from ._gallery_application_versions_operations_async import GalleryApplicationVersionsOperations -from ._virtual_machine_run_commands_operations_async import VirtualMachineRunCommandsOperations - -__all__ = [ - 'Operations', - 'AvailabilitySetsOperations', - 'ProximityPlacementGroupsOperations', - 'DedicatedHostGroupsOperations', - 'DedicatedHostsOperations', - 'VirtualMachineExtensionImagesOperations', - 'VirtualMachineExtensionsOperations', - 'VirtualMachineImagesOperations', - 'UsageOperations', - 'VirtualMachinesOperations', - 'VirtualMachineSizesOperations', - 'ImagesOperations', - 'VirtualMachineScaleSetsOperations', - 'VirtualMachineScaleSetExtensionsOperations', - 'VirtualMachineScaleSetRollingUpgradesOperations', - 'VirtualMachineScaleSetVMExtensionsOperations', - 'VirtualMachineScaleSetVMsOperations', - 'LogAnalyticsOperations', - 'DisksOperations', - 'SnapshotsOperations', - 'DiskEncryptionSetsOperations', - 'GalleriesOperations', - 'GalleryImagesOperations', - 'GalleryImageVersionsOperations', - 'GalleryApplicationsOperations', - 'GalleryApplicationVersionsOperations', - 'VirtualMachineRunCommandsOperations', -] 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 7d1aaaf314b5..8ecfb858cf4d 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 @@ -471,8 +471,10 @@ AvailabilitySetSkuTypes, CachingTypes, DedicatedHostLicenseTypes, + DiffDiskOptions, DiskCreateOption, DiskCreateOptionTypes, + DiskEncryptionSetIdentityType, DiskState, DiskStorageAccountTypes, EncryptionType, @@ -492,6 +494,7 @@ ProtocolTypes, ProximityPlacementGroupType, ReplicationState, + ReplicationStatusTypes, ResourceIdentityType, RollingUpgradeActionType, RollingUpgradeStatusCode, @@ -744,8 +747,10 @@ 'AvailabilitySetSkuTypes', 'CachingTypes', 'DedicatedHostLicenseTypes', + 'DiffDiskOptions', 'DiskCreateOption', 'DiskCreateOptionTypes', + 'DiskEncryptionSetIdentityType', 'DiskState', 'DiskStorageAccountTypes', 'EncryptionType', @@ -765,6 +770,7 @@ 'ProtocolTypes', 'ProximityPlacementGroupType', 'ReplicationState', + 'ReplicationStatusTypes', 'ResourceIdentityType', 'RollingUpgradeActionType', 'RollingUpgradeStatusCode', 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 6421f662a265..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 @@ -6,66 +6,90 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum +from enum import Enum, EnumMeta +from six import with_metaclass -class AccessLevel(str, Enum): +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) - none = "None" - read = "Read" - write = "Write" + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) -class AggregatedReplicationState(str, Enum): + +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. """ - unknown = "Unknown" - in_progress = "InProgress" - completed = "Completed" - failed = "Failed" + UNKNOWN = "Unknown" + IN_PROGRESS = "InProgress" + COMPLETED = "Completed" + FAILED = "Failed" -class AvailabilitySetSkuTypes(str, Enum): +class AvailabilitySetSkuTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the sku of an Availability Set. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual machines with unmanaged disks. Default value is 'Classic'. """ - classic = "Classic" - aligned = "Aligned" + CLASSIC = "Classic" + ALIGNED = "Aligned" -class CachingTypes(str, Enum): +class CachingTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the caching requirements. :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **None** :code:`
`:code:`
` **ReadOnly** :code:`
`:code:`
` **ReadWrite** :code:`
`:code:`
` Default: **None for Standard storage. ReadOnly for Premium storage** """ - none = "None" - read_only = "ReadOnly" - read_write = "ReadWrite" + NONE = "None" + READ_ONLY = "ReadOnly" + READ_WRITE = "ReadWrite" -class DedicatedHostLicenseTypes(str, Enum): +class DedicatedHostLicenseTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the software license type that will be applied to the VMs deployed on the dedicated host. :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **None** :code:`
`:code:`
` **Windows_Server_Hybrid** :code:`
`:code:`
` **Windows_Server_Perpetual** :code:`
`:code:`
` Default: **None** """ - none = "None" - windows_server_hybrid = "Windows_Server_Hybrid" - windows_server_perpetual = "Windows_Server_Perpetual" + NONE = "None" + WINDOWS_SERVER_HYBRID = "Windows_Server_Hybrid" + WINDOWS_SERVER_PERPETUAL = "Windows_Server_Perpetual" + +class DiffDiskOptions(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the ephemeral disk option for operating system disk. + """ + + LOCAL = "Local" -class DiskCreateOption(str, Enum): +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. - 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. + 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. + 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 DiskCreateOptionTypes(str, Enum): +class DiskCreateOptionTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies how the virtual machine should be created.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` **Attach** \u2013 This value is used when you are using a specialized disk to create the virtual machine.:code:`
`:code:`
` **FromImage** \u2013 @@ -74,237 +98,247 @@ class DiskCreateOptionTypes(str, Enum): marketplace image, you also use the plan element previously described. """ - from_image = "FromImage" - empty = "Empty" - attach = "Attach" + FROM_IMAGE = "FromImage" + EMPTY = "Empty" + ATTACH = "Attach" -class DiskState(str, Enum): +class DiskEncryptionSetIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is supported. + """ + + SYSTEM_ASSIGNED = "SystemAssigned" + +class DiskState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The 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. + 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(str, Enum): +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. + 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(str, Enum): +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 with XStore managed key at rest. It is the default encryption type. - encryption_at_rest_with_customer_key = "EncryptionAtRestWithCustomerKey" #: Disk is encrypted with Customer managed key at rest. + ENCRYPTION_AT_REST_WITH_PLATFORM_KEY = "EncryptionAtRestWithPlatformKey" #: Disk is encrypted with XStore managed key at rest. It is the default encryption type. + ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY = "EncryptionAtRestWithCustomerKey" #: Disk is encrypted with Customer managed key at rest. -class GalleryApplicationVersionPropertiesProvisioningState(str, Enum): +class GalleryApplicationVersionPropertiesProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The provisioning state, which only appears in the response. """ - creating = "Creating" - updating = "Updating" - failed = "Failed" - succeeded = "Succeeded" - deleting = "Deleting" - migrating = "Migrating" + CREATING = "Creating" + UPDATING = "Updating" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + DELETING = "Deleting" + MIGRATING = "Migrating" -class GalleryImagePropertiesProvisioningState(str, Enum): +class GalleryImagePropertiesProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The provisioning state, which only appears in the response. """ - creating = "Creating" - updating = "Updating" - failed = "Failed" - succeeded = "Succeeded" - deleting = "Deleting" - migrating = "Migrating" + CREATING = "Creating" + UPDATING = "Updating" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + DELETING = "Deleting" + MIGRATING = "Migrating" -class GalleryImageVersionPropertiesProvisioningState(str, Enum): +class GalleryImageVersionPropertiesProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The provisioning state, which only appears in the response. """ - creating = "Creating" - updating = "Updating" - failed = "Failed" - succeeded = "Succeeded" - deleting = "Deleting" - migrating = "Migrating" + CREATING = "Creating" + UPDATING = "Updating" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + DELETING = "Deleting" + MIGRATING = "Migrating" -class GalleryPropertiesProvisioningState(str, Enum): +class GalleryPropertiesProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The provisioning state, which only appears in the response. """ - creating = "Creating" - updating = "Updating" - failed = "Failed" - succeeded = "Succeeded" - deleting = "Deleting" - migrating = "Migrating" + CREATING = "Creating" + UPDATING = "Updating" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + DELETING = "Deleting" + MIGRATING = "Migrating" -class HostCaching(str, Enum): +class HostCaching(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' """ - none = "None" - read_only = "ReadOnly" - read_write = "ReadWrite" + NONE = "None" + READ_ONLY = "ReadOnly" + READ_WRITE = "ReadWrite" -class HyperVGeneration(str, Enum): +class HyperVGeneration(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The hypervisor generation of the Virtual Machine. Applicable to OS disks only. """ - v1 = "V1" - v2 = "V2" + V1 = "V1" + V2 = "V2" -class HyperVGenerationType(str, Enum): +class HyperVGenerationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the HyperVGeneration Type associated with a resource """ - v1 = "V1" - v2 = "V2" + V1 = "V1" + V2 = "V2" -class HyperVGenerationTypes(str, Enum): +class HyperVGenerationTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the HyperVGeneration Type """ - v1 = "V1" - v2 = "V2" + V1 = "V1" + V2 = "V2" -class IntervalInMins(str, Enum): +class IntervalInMins(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Interval value in minutes used to create LogAnalytics call rate logs. """ - three_mins = "ThreeMins" - five_mins = "FiveMins" - thirty_mins = "ThirtyMins" - sixty_mins = "SixtyMins" + THREE_MINS = "ThreeMins" + FIVE_MINS = "FiveMins" + THIRTY_MINS = "ThirtyMins" + SIXTY_MINS = "SixtyMins" -class IPVersion(str, Enum): +class IPVersion(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. """ - i_pv4 = "IPv4" - i_pv6 = "IPv6" + I_PV4 = "IPv4" + I_PV6 = "IPv6" -class MaintenanceOperationResultCodeTypes(str, Enum): +class MaintenanceOperationResultCodeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The Last Maintenance Operation Result Code. """ - none = "None" - retry_later = "RetryLater" - maintenance_aborted = "MaintenanceAborted" - maintenance_completed = "MaintenanceCompleted" + NONE = "None" + RETRY_LATER = "RetryLater" + MAINTENANCE_ABORTED = "MaintenanceAborted" + MAINTENANCE_COMPLETED = "MaintenanceCompleted" -class OperatingSystemStateTypes(str, Enum): +class OperatingSystemStateTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The OS State. """ - generalized = "Generalized" #: Generalized image. Needs to be provisioned during deployment time. - specialized = "Specialized" #: Specialized image. Contains already provisioned OS Disk. + GENERALIZED = "Generalized" #: Generalized image. Needs to be provisioned during deployment time. + SPECIALIZED = "Specialized" #: Specialized image. Contains already provisioned OS Disk. -class OperatingSystemTypes(str, Enum): - """The Operating System type. +class OperatingSystemTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The operating system of the osDiskImage. """ - windows = "Windows" - linux = "Linux" + WINDOWS = "Windows" + LINUX = "Linux" -class ProtocolTypes(str, Enum): +class ProtocolTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the protocol of WinRM listener. :code:`
`:code:`
` Possible values are: :code:`
`\ **http** :code:`
`:code:`
` **https** """ - http = "Http" - https = "Https" + HTTP = "Http" + HTTPS = "Https" -class ProximityPlacementGroupType(str, Enum): +class ProximityPlacementGroupType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the type of the proximity placement group. :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **Standard** : Co-locate resources within an Azure region or Availability Zone. :code:`
`:code:`
` **Ultra** : For future use. """ - standard = "Standard" - ultra = "Ultra" + STANDARD = "Standard" + ULTRA = "Ultra" -class ReplicationState(str, Enum): +class ReplicationState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """This is the regional replication state. """ - unknown = "Unknown" - replicating = "Replicating" - completed = "Completed" - failed = "Failed" + UNKNOWN = "Unknown" + REPLICATING = "Replicating" + COMPLETED = "Completed" + FAILED = "Failed" + +class ReplicationStatusTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + REPLICATION_STATUS = "ReplicationStatus" -class ResourceIdentityType(str, Enum): +class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The type of identity used for the virtual machine. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine. """ - system_assigned = "SystemAssigned" - user_assigned = "UserAssigned" - system_assigned_user_assigned = "SystemAssigned, UserAssigned" - none = "None" + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned, UserAssigned" + NONE = "None" -class RollingUpgradeActionType(str, Enum): +class RollingUpgradeActionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The last action performed on the rolling upgrade. """ - start = "Start" - cancel = "Cancel" + START = "Start" + CANCEL = "Cancel" -class RollingUpgradeStatusCode(str, Enum): +class RollingUpgradeStatusCode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Code indicating the current status of the upgrade. """ - rolling_forward = "RollingForward" - cancelled = "Cancelled" - completed = "Completed" - faulted = "Faulted" + ROLLING_FORWARD = "RollingForward" + CANCELLED = "Cancelled" + COMPLETED = "Completed" + FAULTED = "Faulted" -class SettingNames(str, Enum): +class SettingNames(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon. """ - auto_logon = "AutoLogon" - first_logon_commands = "FirstLogonCommands" + AUTO_LOGON = "AutoLogon" + FIRST_LOGON_COMMANDS = "FirstLogonCommands" -class SnapshotStorageAccountTypes(str, Enum): +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. + 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 StatusLevelTypes(str, Enum): +class StatusLevelTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The level code. """ - info = "Info" - warning = "Warning" - error = "Error" + INFO = "Info" + WARNING = "Warning" + ERROR = "Error" -class StorageAccountType(str, Enum): +class StorageAccountType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the storage account type to be used to store the image. This property is not updatable. """ - standard_lrs = "Standard_LRS" - standard_zrs = "Standard_ZRS" + STANDARD_LRS = "Standard_LRS" + STANDARD_ZRS = "Standard_ZRS" -class StorageAccountTypes(str, Enum): +class StorageAccountTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the storage account type for the managed disk. Managed OS disk storage account type can only be set when you create the scale set. NOTE: UltraSSD_LRS can only be used with data disks. It cannot be used with OS Disk. Standard_LRS uses Standard HDD. StandardSSD_LRS uses @@ -314,12 +348,12 @@ class StorageAccountTypes(str, Enum): https://docs.microsoft.com/en-us/azure/virtual-machines/linux/disks-types """ - standard_lrs = "Standard_LRS" - premium_lrs = "Premium_LRS" - standard_ssd_lrs = "StandardSSD_LRS" - ultra_ssd_lrs = "UltraSSD_LRS" + STANDARD_LRS = "Standard_LRS" + PREMIUM_LRS = "Premium_LRS" + STANDARD_SSD_LRS = "StandardSSD_LRS" + ULTRA_SSD_LRS = "UltraSSD_LRS" -class UpgradeMode(str, Enum): +class UpgradeMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the mode of an upgrade to virtual machines in the scale set.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` **Manual** - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade @@ -327,58 +361,58 @@ class UpgradeMode(str, Enum): automatically updated at the same time. """ - automatic = "Automatic" - manual = "Manual" - rolling = "Rolling" + AUTOMATIC = "Automatic" + MANUAL = "Manual" + ROLLING = "Rolling" -class UpgradeOperationInvoker(str, Enum): +class UpgradeOperationInvoker(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Invoker of the Upgrade Operation """ - unknown = "Unknown" - user = "User" - platform = "Platform" + UNKNOWN = "Unknown" + USER = "User" + PLATFORM = "Platform" -class UpgradeState(str, Enum): +class UpgradeState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Code indicating the current status of the upgrade. """ - rolling_forward = "RollingForward" - cancelled = "Cancelled" - completed = "Completed" - faulted = "Faulted" + ROLLING_FORWARD = "RollingForward" + CANCELLED = "Cancelled" + COMPLETED = "Completed" + FAULTED = "Faulted" -class VirtualMachineEvictionPolicyTypes(str, Enum): +class VirtualMachineEvictionPolicyTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the eviction policy for the Azure Spot VM/VMSS """ - deallocate = "Deallocate" - delete = "Delete" + DEALLOCATE = "Deallocate" + DELETE = "Delete" -class VirtualMachinePriorityTypes(str, Enum): +class VirtualMachinePriorityTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the priority for a standalone virtual machine or the virtual machines in the scale set. :code:`
`:code:`
` 'Low' enum will be deprecated in the future, please use 'Spot' as the enum to deploy Azure Spot VM/VMSS. """ - regular = "Regular" - low = "Low" - spot = "Spot" + REGULAR = "Regular" + LOW = "Low" + SPOT = "Spot" -class VirtualMachineScaleSetScaleInRules(str, Enum): +class VirtualMachineScaleSetScaleInRules(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - default = "Default" - oldest_vm = "OldestVM" - newest_vm = "NewestVM" + DEFAULT = "Default" + OLDEST_VM = "OldestVM" + NEWEST_VM = "NewestVM" -class VirtualMachineScaleSetSkuScaleType(str, Enum): +class VirtualMachineScaleSetSkuScaleType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The scale type applicable to the sku. """ - automatic = "Automatic" - none = "None" + AUTOMATIC = "Automatic" + NONE = "None" -class VirtualMachineSizeTypes(str, Enum): +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 `_. @@ -392,169 +426,169 @@ class VirtualMachineSizeTypes(str, Enum): `_ """ - basic_a0 = "Basic_A0" - basic_a1 = "Basic_A1" - basic_a2 = "Basic_A2" - basic_a3 = "Basic_A3" - basic_a4 = "Basic_A4" - standard_a0 = "Standard_A0" - standard_a1 = "Standard_A1" - standard_a2 = "Standard_A2" - standard_a3 = "Standard_A3" - standard_a4 = "Standard_A4" - standard_a5 = "Standard_A5" - standard_a6 = "Standard_A6" - standard_a7 = "Standard_A7" - standard_a8 = "Standard_A8" - standard_a9 = "Standard_A9" - standard_a10 = "Standard_A10" - standard_a11 = "Standard_A11" - standard_a1_v2 = "Standard_A1_v2" - standard_a2_v2 = "Standard_A2_v2" - standard_a4_v2 = "Standard_A4_v2" - standard_a8_v2 = "Standard_A8_v2" - standard_a2_m_v2 = "Standard_A2m_v2" - standard_a4_m_v2 = "Standard_A4m_v2" - standard_a8_m_v2 = "Standard_A8m_v2" - standard_b1_s = "Standard_B1s" - standard_b1_ms = "Standard_B1ms" - standard_b2_s = "Standard_B2s" - standard_b2_ms = "Standard_B2ms" - standard_b4_ms = "Standard_B4ms" - standard_b8_ms = "Standard_B8ms" - standard_d1 = "Standard_D1" - standard_d2 = "Standard_D2" - standard_d3 = "Standard_D3" - standard_d4 = "Standard_D4" - standard_d11 = "Standard_D11" - standard_d12 = "Standard_D12" - standard_d13 = "Standard_D13" - standard_d14 = "Standard_D14" - standard_d1_v2 = "Standard_D1_v2" - standard_d2_v2 = "Standard_D2_v2" - standard_d3_v2 = "Standard_D3_v2" - standard_d4_v2 = "Standard_D4_v2" - standard_d5_v2 = "Standard_D5_v2" - standard_d2_v3 = "Standard_D2_v3" - standard_d4_v3 = "Standard_D4_v3" - standard_d8_v3 = "Standard_D8_v3" - standard_d16_v3 = "Standard_D16_v3" - standard_d32_v3 = "Standard_D32_v3" - standard_d64_v3 = "Standard_D64_v3" - standard_d2_s_v3 = "Standard_D2s_v3" - standard_d4_s_v3 = "Standard_D4s_v3" - standard_d8_s_v3 = "Standard_D8s_v3" - standard_d16_s_v3 = "Standard_D16s_v3" - standard_d32_s_v3 = "Standard_D32s_v3" - standard_d64_s_v3 = "Standard_D64s_v3" - standard_d11_v2 = "Standard_D11_v2" - standard_d12_v2 = "Standard_D12_v2" - standard_d13_v2 = "Standard_D13_v2" - standard_d14_v2 = "Standard_D14_v2" - standard_d15_v2 = "Standard_D15_v2" - standard_ds1 = "Standard_DS1" - standard_ds2 = "Standard_DS2" - standard_ds3 = "Standard_DS3" - standard_ds4 = "Standard_DS4" - standard_ds11 = "Standard_DS11" - standard_ds12 = "Standard_DS12" - standard_ds13 = "Standard_DS13" - standard_ds14 = "Standard_DS14" - standard_ds1_v2 = "Standard_DS1_v2" - standard_ds2_v2 = "Standard_DS2_v2" - standard_ds3_v2 = "Standard_DS3_v2" - standard_ds4_v2 = "Standard_DS4_v2" - standard_ds5_v2 = "Standard_DS5_v2" - standard_ds11_v2 = "Standard_DS11_v2" - standard_ds12_v2 = "Standard_DS12_v2" - standard_ds13_v2 = "Standard_DS13_v2" - standard_ds14_v2 = "Standard_DS14_v2" - standard_ds15_v2 = "Standard_DS15_v2" - standard_ds13_4_v2 = "Standard_DS13-4_v2" - standard_ds13_2_v2 = "Standard_DS13-2_v2" - standard_ds14_8_v2 = "Standard_DS14-8_v2" - standard_ds14_4_v2 = "Standard_DS14-4_v2" - standard_e2_v3 = "Standard_E2_v3" - standard_e4_v3 = "Standard_E4_v3" - standard_e8_v3 = "Standard_E8_v3" - standard_e16_v3 = "Standard_E16_v3" - standard_e32_v3 = "Standard_E32_v3" - standard_e64_v3 = "Standard_E64_v3" - standard_e2_s_v3 = "Standard_E2s_v3" - standard_e4_s_v3 = "Standard_E4s_v3" - standard_e8_s_v3 = "Standard_E8s_v3" - standard_e16_s_v3 = "Standard_E16s_v3" - standard_e32_s_v3 = "Standard_E32s_v3" - standard_e64_s_v3 = "Standard_E64s_v3" - standard_e32_16_v3 = "Standard_E32-16_v3" - standard_e32_8_s_v3 = "Standard_E32-8s_v3" - standard_e64_32_s_v3 = "Standard_E64-32s_v3" - standard_e64_16_s_v3 = "Standard_E64-16s_v3" - standard_f1 = "Standard_F1" - standard_f2 = "Standard_F2" - standard_f4 = "Standard_F4" - standard_f8 = "Standard_F8" - standard_f16 = "Standard_F16" - standard_f1_s = "Standard_F1s" - standard_f2_s = "Standard_F2s" - standard_f4_s = "Standard_F4s" - standard_f8_s = "Standard_F8s" - standard_f16_s = "Standard_F16s" - standard_f2_s_v2 = "Standard_F2s_v2" - standard_f4_s_v2 = "Standard_F4s_v2" - standard_f8_s_v2 = "Standard_F8s_v2" - standard_f16_s_v2 = "Standard_F16s_v2" - standard_f32_s_v2 = "Standard_F32s_v2" - standard_f64_s_v2 = "Standard_F64s_v2" - standard_f72_s_v2 = "Standard_F72s_v2" - standard_g1 = "Standard_G1" - standard_g2 = "Standard_G2" - standard_g3 = "Standard_G3" - standard_g4 = "Standard_G4" - standard_g5 = "Standard_G5" - standard_gs1 = "Standard_GS1" - standard_gs2 = "Standard_GS2" - standard_gs3 = "Standard_GS3" - standard_gs4 = "Standard_GS4" - standard_gs5 = "Standard_GS5" - standard_gs4_8 = "Standard_GS4-8" - standard_gs4_4 = "Standard_GS4-4" - standard_gs5_16 = "Standard_GS5-16" - standard_gs5_8 = "Standard_GS5-8" - standard_h8 = "Standard_H8" - standard_h16 = "Standard_H16" - standard_h8_m = "Standard_H8m" - standard_h16_m = "Standard_H16m" - standard_h16_r = "Standard_H16r" - standard_h16_mr = "Standard_H16mr" - standard_l4_s = "Standard_L4s" - standard_l8_s = "Standard_L8s" - standard_l16_s = "Standard_L16s" - standard_l32_s = "Standard_L32s" - standard_m64_s = "Standard_M64s" - standard_m64_ms = "Standard_M64ms" - standard_m128_s = "Standard_M128s" - standard_m128_ms = "Standard_M128ms" - standard_m64_32_ms = "Standard_M64-32ms" - standard_m64_16_ms = "Standard_M64-16ms" - standard_m128_64_ms = "Standard_M128-64ms" - standard_m128_32_ms = "Standard_M128-32ms" - standard_nc6 = "Standard_NC6" - standard_nc12 = "Standard_NC12" - standard_nc24 = "Standard_NC24" - standard_nc24_r = "Standard_NC24r" - standard_nc6_s_v2 = "Standard_NC6s_v2" - standard_nc12_s_v2 = "Standard_NC12s_v2" - standard_nc24_s_v2 = "Standard_NC24s_v2" - standard_nc24_rs_v2 = "Standard_NC24rs_v2" - standard_nc6_s_v3 = "Standard_NC6s_v3" - standard_nc12_s_v3 = "Standard_NC12s_v3" - standard_nc24_s_v3 = "Standard_NC24s_v3" - standard_nc24_rs_v3 = "Standard_NC24rs_v3" - standard_nd6_s = "Standard_ND6s" - standard_nd12_s = "Standard_ND12s" - standard_nd24_s = "Standard_ND24s" - standard_nd24_rs = "Standard_ND24rs" - standard_nv6 = "Standard_NV6" - standard_nv12 = "Standard_NV12" - standard_nv24 = "Standard_NV24" + BASIC_A0 = "Basic_A0" + BASIC_A1 = "Basic_A1" + BASIC_A2 = "Basic_A2" + BASIC_A3 = "Basic_A3" + BASIC_A4 = "Basic_A4" + STANDARD_A0 = "Standard_A0" + STANDARD_A1 = "Standard_A1" + STANDARD_A2 = "Standard_A2" + STANDARD_A3 = "Standard_A3" + STANDARD_A4 = "Standard_A4" + STANDARD_A5 = "Standard_A5" + STANDARD_A6 = "Standard_A6" + STANDARD_A7 = "Standard_A7" + STANDARD_A8 = "Standard_A8" + STANDARD_A9 = "Standard_A9" + STANDARD_A10 = "Standard_A10" + STANDARD_A11 = "Standard_A11" + STANDARD_A1_V2 = "Standard_A1_v2" + STANDARD_A2_V2 = "Standard_A2_v2" + STANDARD_A4_V2 = "Standard_A4_v2" + STANDARD_A8_V2 = "Standard_A8_v2" + STANDARD_A2_M_V2 = "Standard_A2m_v2" + STANDARD_A4_M_V2 = "Standard_A4m_v2" + STANDARD_A8_M_V2 = "Standard_A8m_v2" + STANDARD_B1_S = "Standard_B1s" + STANDARD_B1_MS = "Standard_B1ms" + STANDARD_B2_S = "Standard_B2s" + STANDARD_B2_MS = "Standard_B2ms" + STANDARD_B4_MS = "Standard_B4ms" + STANDARD_B8_MS = "Standard_B8ms" + STANDARD_D1 = "Standard_D1" + STANDARD_D2 = "Standard_D2" + STANDARD_D3 = "Standard_D3" + STANDARD_D4 = "Standard_D4" + STANDARD_D11 = "Standard_D11" + STANDARD_D12 = "Standard_D12" + STANDARD_D13 = "Standard_D13" + STANDARD_D14 = "Standard_D14" + STANDARD_D1_V2 = "Standard_D1_v2" + STANDARD_D2_V2 = "Standard_D2_v2" + STANDARD_D3_V2 = "Standard_D3_v2" + STANDARD_D4_V2 = "Standard_D4_v2" + STANDARD_D5_V2 = "Standard_D5_v2" + STANDARD_D2_V3 = "Standard_D2_v3" + STANDARD_D4_V3 = "Standard_D4_v3" + STANDARD_D8_V3 = "Standard_D8_v3" + STANDARD_D16_V3 = "Standard_D16_v3" + STANDARD_D32_V3 = "Standard_D32_v3" + STANDARD_D64_V3 = "Standard_D64_v3" + STANDARD_D2_S_V3 = "Standard_D2s_v3" + STANDARD_D4_S_V3 = "Standard_D4s_v3" + STANDARD_D8_S_V3 = "Standard_D8s_v3" + STANDARD_D16_S_V3 = "Standard_D16s_v3" + STANDARD_D32_S_V3 = "Standard_D32s_v3" + STANDARD_D64_S_V3 = "Standard_D64s_v3" + STANDARD_D11_V2 = "Standard_D11_v2" + STANDARD_D12_V2 = "Standard_D12_v2" + STANDARD_D13_V2 = "Standard_D13_v2" + STANDARD_D14_V2 = "Standard_D14_v2" + STANDARD_D15_V2 = "Standard_D15_v2" + STANDARD_DS1 = "Standard_DS1" + STANDARD_DS2 = "Standard_DS2" + STANDARD_DS3 = "Standard_DS3" + STANDARD_DS4 = "Standard_DS4" + STANDARD_DS11 = "Standard_DS11" + STANDARD_DS12 = "Standard_DS12" + STANDARD_DS13 = "Standard_DS13" + STANDARD_DS14 = "Standard_DS14" + STANDARD_DS1_V2 = "Standard_DS1_v2" + STANDARD_DS2_V2 = "Standard_DS2_v2" + STANDARD_DS3_V2 = "Standard_DS3_v2" + STANDARD_DS4_V2 = "Standard_DS4_v2" + STANDARD_DS5_V2 = "Standard_DS5_v2" + STANDARD_DS11_V2 = "Standard_DS11_v2" + STANDARD_DS12_V2 = "Standard_DS12_v2" + STANDARD_DS13_V2 = "Standard_DS13_v2" + STANDARD_DS14_V2 = "Standard_DS14_v2" + STANDARD_DS15_V2 = "Standard_DS15_v2" + STANDARD_DS13_4_V2 = "Standard_DS13-4_v2" + STANDARD_DS13_2_V2 = "Standard_DS13-2_v2" + STANDARD_DS14_8_V2 = "Standard_DS14-8_v2" + STANDARD_DS14_4_V2 = "Standard_DS14-4_v2" + STANDARD_E2_V3 = "Standard_E2_v3" + STANDARD_E4_V3 = "Standard_E4_v3" + STANDARD_E8_V3 = "Standard_E8_v3" + STANDARD_E16_V3 = "Standard_E16_v3" + STANDARD_E32_V3 = "Standard_E32_v3" + STANDARD_E64_V3 = "Standard_E64_v3" + STANDARD_E2_S_V3 = "Standard_E2s_v3" + STANDARD_E4_S_V3 = "Standard_E4s_v3" + STANDARD_E8_S_V3 = "Standard_E8s_v3" + STANDARD_E16_S_V3 = "Standard_E16s_v3" + STANDARD_E32_S_V3 = "Standard_E32s_v3" + STANDARD_E64_S_V3 = "Standard_E64s_v3" + STANDARD_E32_16_V3 = "Standard_E32-16_v3" + STANDARD_E32_8_S_V3 = "Standard_E32-8s_v3" + STANDARD_E64_32_S_V3 = "Standard_E64-32s_v3" + STANDARD_E64_16_S_V3 = "Standard_E64-16s_v3" + STANDARD_F1 = "Standard_F1" + STANDARD_F2 = "Standard_F2" + STANDARD_F4 = "Standard_F4" + STANDARD_F8 = "Standard_F8" + STANDARD_F16 = "Standard_F16" + STANDARD_F1_S = "Standard_F1s" + STANDARD_F2_S = "Standard_F2s" + STANDARD_F4_S = "Standard_F4s" + STANDARD_F8_S = "Standard_F8s" + STANDARD_F16_S = "Standard_F16s" + STANDARD_F2_S_V2 = "Standard_F2s_v2" + STANDARD_F4_S_V2 = "Standard_F4s_v2" + STANDARD_F8_S_V2 = "Standard_F8s_v2" + STANDARD_F16_S_V2 = "Standard_F16s_v2" + STANDARD_F32_S_V2 = "Standard_F32s_v2" + STANDARD_F64_S_V2 = "Standard_F64s_v2" + STANDARD_F72_S_V2 = "Standard_F72s_v2" + STANDARD_G1 = "Standard_G1" + STANDARD_G2 = "Standard_G2" + STANDARD_G3 = "Standard_G3" + STANDARD_G4 = "Standard_G4" + STANDARD_G5 = "Standard_G5" + STANDARD_GS1 = "Standard_GS1" + STANDARD_GS2 = "Standard_GS2" + STANDARD_GS3 = "Standard_GS3" + STANDARD_GS4 = "Standard_GS4" + STANDARD_GS5 = "Standard_GS5" + STANDARD_GS4_8 = "Standard_GS4-8" + STANDARD_GS4_4 = "Standard_GS4-4" + STANDARD_GS5_16 = "Standard_GS5-16" + STANDARD_GS5_8 = "Standard_GS5-8" + STANDARD_H8 = "Standard_H8" + STANDARD_H16 = "Standard_H16" + STANDARD_H8_M = "Standard_H8m" + STANDARD_H16_M = "Standard_H16m" + STANDARD_H16_R = "Standard_H16r" + STANDARD_H16_MR = "Standard_H16mr" + STANDARD_L4_S = "Standard_L4s" + STANDARD_L8_S = "Standard_L8s" + STANDARD_L16_S = "Standard_L16s" + STANDARD_L32_S = "Standard_L32s" + STANDARD_M64_S = "Standard_M64s" + STANDARD_M64_MS = "Standard_M64ms" + STANDARD_M128_S = "Standard_M128s" + STANDARD_M128_MS = "Standard_M128ms" + STANDARD_M64_32_MS = "Standard_M64-32ms" + STANDARD_M64_16_MS = "Standard_M64-16ms" + STANDARD_M128_64_MS = "Standard_M128-64ms" + STANDARD_M128_32_MS = "Standard_M128-32ms" + STANDARD_NC6 = "Standard_NC6" + STANDARD_NC12 = "Standard_NC12" + STANDARD_NC24 = "Standard_NC24" + STANDARD_NC24_R = "Standard_NC24r" + STANDARD_NC6_S_V2 = "Standard_NC6s_v2" + STANDARD_NC12_S_V2 = "Standard_NC12s_v2" + STANDARD_NC24_S_V2 = "Standard_NC24s_v2" + STANDARD_NC24_RS_V2 = "Standard_NC24rs_v2" + STANDARD_NC6_S_V3 = "Standard_NC6s_v3" + STANDARD_NC12_S_V3 = "Standard_NC12s_v3" + STANDARD_NC24_S_V3 = "Standard_NC24s_v3" + STANDARD_NC24_RS_V3 = "Standard_NC24rs_v3" + STANDARD_ND6_S = "Standard_ND6s" + STANDARD_ND12_S = "Standard_ND12s" + STANDARD_ND24_S = "Standard_ND24s" + STANDARD_ND24_RS = "Standard_ND24rs" + STANDARD_NV6 = "Standard_NV6" + STANDARD_NV12 = "Standard_NV12" + STANDARD_NV24 = "Standard_NV24" 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 dd7240eab311..584b6625cf2c 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 @@ -1305,28 +1305,21 @@ def __init__( class DiffDiskSettings(msrest.serialization.Model): """Describes the parameters of ephemeral disk settings that can be specified for operating system disk. :code:`
`:code:`
` NOTE: The ephemeral disk settings can only be specified for managed disk. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar option: Specifies the ephemeral disk settings for operating system disk. Default value: - "Local". - :vartype option: str + :param option: Specifies the ephemeral disk settings for operating system disk. Possible values + include: "Local". + :type option: str or ~azure.mgmt.compute.v2019_07_01.models.DiffDiskOptions """ - _validation = { - 'option': {'constant': True}, - } - _attribute_map = { 'option': {'key': 'option', 'type': 'str'}, } - option = "Local" - def __init__( self, **kwargs ): super(DiffDiskSettings, self).__init__(**kwargs) + self.option = kwargs.get('option', None) class Disallowed(msrest.serialization.Model): @@ -1834,9 +1827,9 @@ class EncryptionSetIdentity(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar type: The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is - supported. Default value: "SystemAssigned". - :vartype type: str + :param type: The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is + supported. Possible values include: "SystemAssigned". + :type type: str or ~azure.mgmt.compute.v2019_07_01.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. @@ -1848,7 +1841,6 @@ class EncryptionSetIdentity(msrest.serialization.Model): """ _validation = { - 'type': {'constant': True}, 'principal_id': {'readonly': True}, 'tenant_id': {'readonly': True}, } @@ -1859,13 +1851,12 @@ class EncryptionSetIdentity(msrest.serialization.Model): 'tenant_id': {'key': 'tenantId', 'type': 'str'}, } - type = "SystemAssigned" - def __init__( self, **kwargs ): super(EncryptionSetIdentity, self).__init__(**kwargs) + self.type = kwargs.get('type', None) self.principal_id = None self.tenant_id = None 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 670eb5b6b05c..d0dee155848a 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 @@ -1418,28 +1418,23 @@ def __init__( class DiffDiskSettings(msrest.serialization.Model): """Describes the parameters of ephemeral disk settings that can be specified for operating system disk. :code:`
`:code:`
` NOTE: The ephemeral disk settings can only be specified for managed disk. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar option: Specifies the ephemeral disk settings for operating system disk. Default value: - "Local". - :vartype option: str + :param option: Specifies the ephemeral disk settings for operating system disk. Possible values + include: "Local". + :type option: str or ~azure.mgmt.compute.v2019_07_01.models.DiffDiskOptions """ - _validation = { - 'option': {'constant': True}, - } - _attribute_map = { 'option': {'key': 'option', 'type': 'str'}, } - option = "Local" - def __init__( self, + *, + option: Optional[Union[str, "DiffDiskOptions"]] = None, **kwargs ): super(DiffDiskSettings, self).__init__(**kwargs) + self.option = option class Disallowed(msrest.serialization.Model): @@ -2002,9 +1997,9 @@ class EncryptionSetIdentity(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar type: The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is - supported. Default value: "SystemAssigned". - :vartype type: str + :param type: The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is + supported. Possible values include: "SystemAssigned". + :type type: str or ~azure.mgmt.compute.v2019_07_01.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. @@ -2016,7 +2011,6 @@ class EncryptionSetIdentity(msrest.serialization.Model): """ _validation = { - 'type': {'constant': True}, 'principal_id': {'readonly': True}, 'tenant_id': {'readonly': True}, } @@ -2027,13 +2021,14 @@ class EncryptionSetIdentity(msrest.serialization.Model): 'tenant_id': {'key': 'tenantId', 'type': 'str'}, } - type = "SystemAssigned" - 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_availability_sets_operations.py index 960d74c455be..a0ed9710019e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_availability_sets_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -67,10 +67,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -88,14 +91,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailabilitySet') 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 @@ -133,10 +134,13 @@ def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -154,14 +158,12 @@ def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailabilitySetUpdate') 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 @@ -196,7 +198,9 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -216,7 +220,6 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,9 +252,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -268,9 +274,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -295,7 +300,8 @@ def list_by_subscription( # type: (...) -> Iterable["models.AvailabilitySetListResult"] """Lists all availability sets in a subscription. - :param expand: The expand expression to apply to the operation. + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AvailabilitySetListResult or the result of cls(response) @@ -303,11 +309,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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_subscription.metadata['url'] # type: ignore @@ -321,15 +334,11 @@ def prepare_request(next_link=None): if expand is not None: query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -372,11 +381,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -389,15 +405,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -432,7 +444,7 @@ def list_available_sizes( ): # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes that can be used to create a new virtual machine in - an existing availability set. + an existing availability set. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -444,11 +456,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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_available_sizes.metadata['url'] # type: ignore @@ -462,15 +481,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_dedicated_host_groups_operations.py index c92a9fd45625..56e76a23bb3c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_dedicated_host_groups_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -69,10 +69,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -90,14 +93,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DedicatedHostGroup') 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 @@ -105,7 +106,6 @@ def create_or_update( 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('DedicatedHostGroup', pipeline_response) @@ -140,10 +140,13 @@ def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -161,14 +164,12 @@ def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DedicatedHostGroupUpdate') 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 @@ -203,7 +204,9 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -223,7 +226,6 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,9 +258,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -275,9 +280,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -301,7 +305,7 @@ def list_by_resource_group( ): # type: (...) -> Iterable["models.DedicatedHostGroupListResult"] """Lists all of the dedicated host groups in the specified resource group. Use the nextLink - property in the response to get the next page of dedicated host groups. + property in the response to get the next page of dedicated host groups. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -311,11 +315,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -328,15 +339,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -369,7 +376,7 @@ def list_by_subscription( ): # type: (...) -> Iterable["models.DedicatedHostGroupListResult"] """Lists all of the dedicated host groups in the subscription. Use the nextLink property in the - response to get the next page of dedicated host groups. + response to get the next page of dedicated host groups. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DedicatedHostGroupListResult or the result of cls(response) @@ -377,11 +384,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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_subscription.metadata['url'] # type: ignore @@ -393,15 +407,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_dedicated_hosts_operations.py index 363186e8001a..104ef2bd87dd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_dedicated_hosts_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -57,10 +57,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.DedicatedHost" cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -79,14 +82,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DedicatedHost') 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 @@ -94,7 +95,6 @@ def _create_or_update_initial( 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('DedicatedHost', pipeline_response) @@ -115,7 +115,7 @@ def begin_create_or_update( parameters, # type: "models.DedicatedHost" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DedicatedHost"] """Create or update a dedicated host . :param resource_group_name: The name of the resource group. @@ -187,10 +187,13 @@ def _update_initial( ): # type: (...) -> "models.DedicatedHost" cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -209,14 +212,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DedicatedHostUpdate') 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 @@ -240,7 +241,7 @@ def begin_update( parameters, # type: "models.DedicatedHostUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DedicatedHost"] """Update an dedicated host . :param resource_group_name: The name of the resource group. @@ -311,7 +312,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -332,7 +335,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -353,7 +355,7 @@ def begin_delete( host_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Delete a dedicated host. :param resource_group_name: The name of the resource group. @@ -434,9 +436,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -456,9 +461,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -483,7 +487,7 @@ def list_by_host_group( ): # type: (...) -> Iterable["models.DedicatedHostListResult"] """Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink - property in the response to get the next page of dedicated hosts. + property in the response to get the next page of dedicated hosts. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -495,11 +499,18 @@ def list_by_host_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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_host_group.metadata['url'] # type: ignore @@ -513,15 +524,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_disk_encryption_sets_operations.py index e8d47622054d..6522127dd2b8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_disk_encryption_sets_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.DiskEncryptionSet" cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('DiskEncryptionSet', pipeline_response) @@ -112,17 +112,17 @@ def begin_create_or_update( disk_encryption_set, # type: "models.DiskEncryptionSet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. + encryption set operation. :type disk_encryption_set: ~azure.mgmt.compute.v2019_07_01.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. @@ -183,10 +183,13 @@ def _update_initial( ): # type: (...) -> "models.DiskEncryptionSet" cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -204,14 +207,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -219,7 +220,6 @@ def _update_initial( 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('DiskEncryptionSet', pipeline_response) @@ -239,17 +239,17 @@ def begin_update( disk_encryption_set, # type: "models.DiskEncryptionSetUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. + encryption set operation. :type disk_encryption_set: ~azure.mgmt.compute.v2019_07_01.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. @@ -322,9 +322,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -341,9 +344,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -368,9 +370,12 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -387,8 +392,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -408,14 +413,14 @@ def begin_delete( disk_encryption_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. @@ -479,11 +484,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSetList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -496,15 +508,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -544,11 +552,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSetList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -560,15 +575,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_disks_operations.py index ecee271041cd..d115b157018c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_disks_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.Disk" cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('Disk', pipeline_response) @@ -112,14 +112,14 @@ def begin_create_or_update( disk, # type: "models.Disk" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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.v2019_07_01.models.Disk @@ -182,10 +182,13 @@ def _update_initial( ): # type: (...) -> "models.Disk" cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -203,14 +206,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -218,7 +219,6 @@ def _update_initial( 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('Disk', pipeline_response) @@ -238,14 +238,14 @@ def begin_update( disk, # type: "models.DiskUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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.v2019_07_01.models.DiskUpdate @@ -320,9 +320,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -339,9 +342,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -366,7 +368,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -386,7 +390,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -406,14 +409,14 @@ def begin_delete( disk_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. @@ -477,11 +480,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -494,15 +504,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -542,11 +548,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -558,15 +571,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -600,12 +609,15 @@ def _grant_access_initial( grant_access_data, # type: "models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> "models.AccessUri" - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # 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 = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._grant_access_initial.metadata['url'] # type: ignore @@ -623,14 +635,12 @@ def _grant_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -655,17 +665,17 @@ def begin_grant_access( grant_access_data, # type: "models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. + operation. :type grant_access_data: ~azure.mgmt.compute.v2019_07_01.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. @@ -725,7 +735,9 @@ def _revoke_access_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -745,7 +757,6 @@ def _revoke_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -765,14 +776,14 @@ def begin_revoke_access( disk_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_galleries_operations.py index cbe54ba61006..9cd47db0ba97 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_galleries_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.Gallery" cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery, 'Gallery') 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('Gallery', pipeline_response) @@ -115,13 +115,13 @@ def begin_create_or_update( gallery, # type: "models.Gallery" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Gallery"] """Create or update a Shared Image Gallery. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery. The allowed characters are alphabets - and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. + and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. :type gallery_name: str :param gallery: Parameters supplied to the create or update Shared Image Gallery operation. :type gallery: ~azure.mgmt.compute.v2019_07_01.models.Gallery @@ -184,10 +184,13 @@ def _update_initial( ): # type: (...) -> "models.Gallery" cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -205,14 +208,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery, 'GalleryUpdate') 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 @@ -235,13 +236,13 @@ def begin_update( gallery, # type: "models.GalleryUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Gallery"] """Update a Shared Image Gallery. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery. The allowed characters are alphabets - and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. + and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. :type gallery_name: str :param gallery: Parameters supplied to the update Shared Image Gallery operation. :type gallery: ~azure.mgmt.compute.v2019_07_01.models.GalleryUpdate @@ -314,9 +315,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -333,9 +337,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -360,9 +363,12 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -379,8 +385,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -400,7 +406,7 @@ def begin_delete( gallery_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Delete a Shared Image Gallery. :param resource_group_name: The name of the resource group. @@ -469,11 +475,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -486,15 +499,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -534,11 +543,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -550,15 +566,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_application_versions_operations.py index ecda9a504ced..ce1681a1cdaa 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_application_versions_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -58,10 +58,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.GalleryApplicationVersion" cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -81,14 +84,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_application_version, 'GalleryApplicationVersion') 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 @@ -96,7 +97,6 @@ def _create_or_update_initial( 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('GalleryApplicationVersion', pipeline_response) @@ -121,24 +121,24 @@ def begin_create_or_update( gallery_application_version, # type: "models.GalleryApplicationVersion" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GalleryApplicationVersion"] """Create or update a gallery Application Version. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. + Definition resides. :type gallery_name: str :param gallery_application_name: The name of the gallery Application Definition in which the - Application Version is to be created. + Application Version is to be created. :type gallery_application_name: str :param gallery_application_version_name: The name of the gallery Application Version to be - created. Needs to follow semantic version name pattern: The allowed characters are digit and - period. Digits must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. + created. Needs to follow semantic version name pattern: The allowed characters are digit and + period. Digits must be within the range of a 32-bit integer. Format: + :code:``.:code:``.:code:``. :type gallery_application_version_name: str :param gallery_application_version: Parameters supplied to the create or update gallery - Application Version operation. + Application Version operation. :type gallery_application_version: ~azure.mgmt.compute.v2019_07_01.models.GalleryApplicationVersion :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. @@ -203,10 +203,13 @@ def _update_initial( ): # type: (...) -> "models.GalleryApplicationVersion" cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -226,14 +229,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_application_version, 'GalleryApplicationVersionUpdate') 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 @@ -258,24 +259,24 @@ def begin_update( gallery_application_version, # type: "models.GalleryApplicationVersionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GalleryApplicationVersion"] """Update a gallery Application Version. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. + Definition resides. :type gallery_name: str :param gallery_application_name: The name of the gallery Application Definition in which the - Application Version is to be updated. + Application Version is to be updated. :type gallery_application_name: str :param gallery_application_version_name: The name of the gallery Application Version to be - updated. Needs to follow semantic version name pattern: The allowed characters are digit and - period. Digits must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. + updated. Needs to follow semantic version name pattern: The allowed characters are digit and + period. Digits must be within the range of a 32-bit integer. Format: + :code:``.:code:``.:code:``. :type gallery_application_version_name: str :param gallery_application_version: Parameters supplied to the update gallery Application - Version operation. + Version operation. :type gallery_application_version: ~azure.mgmt.compute.v2019_07_01.models.GalleryApplicationVersionUpdate :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. @@ -335,7 +336,7 @@ def get( gallery_name, # type: str gallery_application_name, # type: str gallery_application_version_name, # type: str - expand="ReplicationStatus", # type: Optional[str] + expand=None, # type: Optional[Union[str, "models.ReplicationStatusTypes"]] **kwargs # type: Any ): # type: (...) -> "models.GalleryApplicationVersion" @@ -353,16 +354,19 @@ def get( retrieved. :type gallery_application_version_name: str :param expand: The expand expression to apply on the operation. - :type expand: str + :type expand: str or ~azure.mgmt.compute.v2019_07_01.models.ReplicationStatusTypes :keyword callable cls: A custom type or function that will be passed the direct response :return: GalleryApplicationVersion, or the result of cls(response) :rtype: ~azure.mgmt.compute.v2019_07_01.models.GalleryApplicationVersion :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -383,9 +387,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -412,9 +415,12 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -433,8 +439,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -456,19 +462,19 @@ def begin_delete( gallery_application_version_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Delete a gallery Application Version. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. + Definition resides. :type gallery_name: str :param gallery_application_name: The name of the gallery Application Definition in which the - Application Version resides. + Application Version resides. :type gallery_application_name: str :param gallery_application_version_name: The name of the gallery Application Version to be - deleted. + deleted. :type gallery_application_version_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. @@ -531,10 +537,10 @@ def list_by_gallery_application( :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. + Definition resides. :type gallery_name: str :param gallery_application_name: The name of the Shared Application Gallery Application - Definition from which the Application Versions are to be listed. + Definition from which the Application Versions are to be listed. :type gallery_application_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GalleryApplicationVersionList or the result of cls(response) @@ -542,11 +548,18 @@ def list_by_gallery_application( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersionList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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_gallery_application.metadata['url'] # type: ignore @@ -561,15 +574,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_applications_operations.py index ba1d32256573..53b4a51e9805 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_applications_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -57,10 +57,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.GalleryApplication" cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -79,14 +82,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_application, 'GalleryApplication') 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 @@ -94,7 +95,6 @@ def _create_or_update_initial( 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('GalleryApplication', pipeline_response) @@ -118,20 +118,20 @@ def begin_create_or_update( gallery_application, # type: "models.GalleryApplication" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GalleryApplication"] """Create or update a gallery Application Definition. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition is to be created. + Definition is to be created. :type gallery_name: str :param gallery_application_name: The name of the gallery Application Definition to be created - or updated. The allowed characters are alphabets and numbers with dots, dashes, and periods - allowed in the middle. The maximum length is 80 characters. + or updated. The allowed characters are alphabets and numbers with dots, dashes, and periods + allowed in the middle. The maximum length is 80 characters. :type gallery_application_name: str :param gallery_application: Parameters supplied to the create or update gallery Application - operation. + operation. :type gallery_application: ~azure.mgmt.compute.v2019_07_01.models.GalleryApplication :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. @@ -194,10 +194,13 @@ def _update_initial( ): # type: (...) -> "models.GalleryApplication" cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -216,14 +219,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_application, 'GalleryApplicationUpdate') 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 @@ -247,17 +248,17 @@ def begin_update( gallery_application, # type: "models.GalleryApplicationUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GalleryApplication"] """Update a gallery Application Definition. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition is to be updated. + Definition is to be updated. :type gallery_name: str :param gallery_application_name: The name of the gallery Application Definition to be updated. - The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the - middle. The maximum length is 80 characters. + The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the + middle. The maximum length is 80 characters. :type gallery_application_name: str :param gallery_application: Parameters supplied to the update gallery Application operation. :type gallery_application: ~azure.mgmt.compute.v2019_07_01.models.GalleryApplicationUpdate @@ -336,9 +337,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -356,9 +360,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -384,9 +387,12 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -404,8 +410,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -426,13 +432,13 @@ def begin_delete( gallery_application_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Delete a gallery Application. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition is to be deleted. + Definition is to be deleted. :type gallery_name: str :param gallery_application_name: The name of the gallery Application Definition to be deleted. :type gallery_application_name: str @@ -495,7 +501,7 @@ def list_by_gallery( :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery from which Application - Definitions are to be listed. + Definitions are to be listed. :type gallery_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GalleryApplicationList or the result of cls(response) @@ -503,11 +509,18 @@ def list_by_gallery( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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_gallery.metadata['url'] # type: ignore @@ -521,15 +534,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_image_versions_operations.py index 2d8a0a549dd8..75b4345620f7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_image_versions_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -58,10 +58,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.GalleryImageVersion" cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -81,14 +84,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_image_version, 'GalleryImageVersion') 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 @@ -96,7 +97,6 @@ def _create_or_update_initial( 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('GalleryImageVersion', pipeline_response) @@ -121,24 +121,24 @@ def begin_create_or_update( gallery_image_version, # type: "models.GalleryImageVersion" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GalleryImageVersion"] """Create or update a gallery Image Version. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. + resides. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition in which the Image Version - is to be created. + is to be created. :type gallery_image_name: str :param gallery_image_version_name: The name of the gallery Image Version to be created. Needs - to follow semantic version name pattern: The allowed characters are digit and period. Digits - must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. + to follow semantic version name pattern: The allowed characters are digit and period. Digits + must be within the range of a 32-bit integer. Format: + :code:``.:code:``.:code:``. :type gallery_image_version_name: str :param gallery_image_version: Parameters supplied to the create or update gallery Image Version - operation. + operation. :type gallery_image_version: ~azure.mgmt.compute.v2019_07_01.models.GalleryImageVersion :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. @@ -203,10 +203,13 @@ def _update_initial( ): # type: (...) -> "models.GalleryImageVersion" cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -226,14 +229,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_image_version, 'GalleryImageVersionUpdate') 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 @@ -258,24 +259,24 @@ def begin_update( gallery_image_version, # type: "models.GalleryImageVersionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GalleryImageVersion"] """Update a gallery Image Version. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. + resides. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition in which the Image Version - is to be updated. + is to be updated. :type gallery_image_name: str :param gallery_image_version_name: The name of the gallery Image Version to be updated. Needs - to follow semantic version name pattern: The allowed characters are digit and period. Digits - must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. + to follow semantic version name pattern: The allowed characters are digit and period. Digits + must be within the range of a 32-bit integer. Format: + :code:``.:code:``.:code:``. :type gallery_image_version_name: str :param gallery_image_version: Parameters supplied to the update gallery Image Version - operation. + operation. :type gallery_image_version: ~azure.mgmt.compute.v2019_07_01.models.GalleryImageVersionUpdate :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. @@ -335,7 +336,7 @@ def get( gallery_name, # type: str gallery_image_name, # type: str gallery_image_version_name, # type: str - expand="ReplicationStatus", # type: Optional[str] + expand=None, # type: Optional[Union[str, "models.ReplicationStatusTypes"]] **kwargs # type: Any ): # type: (...) -> "models.GalleryImageVersion" @@ -352,16 +353,19 @@ def get( :param gallery_image_version_name: The name of the gallery Image Version to be retrieved. :type gallery_image_version_name: str :param expand: The expand expression to apply on the operation. - :type expand: str + :type expand: str or ~azure.mgmt.compute.v2019_07_01.models.ReplicationStatusTypes :keyword callable cls: A custom type or function that will be passed the direct response :return: GalleryImageVersion, or the result of cls(response) :rtype: ~azure.mgmt.compute.v2019_07_01.models.GalleryImageVersion :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -382,9 +386,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -411,9 +414,12 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -432,8 +438,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -455,16 +461,16 @@ def begin_delete( gallery_image_version_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Delete a gallery Image Version. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. + resides. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition in which the Image Version - resides. + resides. :type gallery_image_name: str :param gallery_image_version_name: The name of the gallery Image Version to be deleted. :type gallery_image_version_name: str @@ -529,10 +535,10 @@ def list_by_gallery_image( :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. + resides. :type gallery_name: str :param gallery_image_name: The name of the Shared Image Gallery Image Definition from which the - Image Versions are to be listed. + Image Versions are to be listed. :type gallery_image_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GalleryImageVersionList or the result of cls(response) @@ -540,11 +546,18 @@ def list_by_gallery_image( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersionList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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_gallery_image.metadata['url'] # type: ignore @@ -559,15 +572,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_images_operations.py index 2c5481cbd70b..827af134a195 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_images_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -57,10 +57,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.GalleryImage" cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -79,14 +82,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_image, 'GalleryImage') 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 @@ -94,7 +95,6 @@ def _create_or_update_initial( 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('GalleryImage', pipeline_response) @@ -118,17 +118,17 @@ def begin_create_or_update( gallery_image, # type: "models.GalleryImage" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GalleryImage"] """Create or update a gallery Image Definition. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to - be created. + be created. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition to be created or updated. - The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the - middle. The maximum length is 80 characters. + The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the + middle. The maximum length is 80 characters. :type gallery_image_name: str :param gallery_image: Parameters supplied to the create or update gallery image operation. :type gallery_image: ~azure.mgmt.compute.v2019_07_01.models.GalleryImage @@ -193,10 +193,13 @@ def _update_initial( ): # type: (...) -> "models.GalleryImage" cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -215,14 +218,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_image, 'GalleryImageUpdate') 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 @@ -246,17 +247,17 @@ def begin_update( gallery_image, # type: "models.GalleryImageUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GalleryImage"] """Update a gallery Image Definition. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to - be updated. + be updated. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition to be updated. The allowed - characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - maximum length is 80 characters. + characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The + maximum length is 80 characters. :type gallery_image_name: str :param gallery_image: Parameters supplied to the update gallery image operation. :type gallery_image: ~azure.mgmt.compute.v2019_07_01.models.GalleryImageUpdate @@ -334,9 +335,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -354,9 +358,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -382,9 +385,12 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -402,8 +408,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -424,13 +430,13 @@ def begin_delete( gallery_image_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Delete a gallery image. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to - be deleted. + be deleted. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition to be deleted. :type gallery_image_name: str @@ -493,7 +499,7 @@ def list_by_gallery( :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery from which Image Definitions are to - be listed. + be listed. :type gallery_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GalleryImageList or the result of cls(response) @@ -501,11 +507,18 @@ def list_by_gallery( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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_gallery.metadata['url'] # type: ignore @@ -519,15 +532,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_images_operations.py index 59cc8283f845..0c0bc21107e2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_images_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.Image" cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'Image') 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('Image', pipeline_response) @@ -112,7 +112,7 @@ def begin_create_or_update( parameters, # type: "models.Image" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Image"] """Create or update an image. :param resource_group_name: The name of the resource group. @@ -180,10 +180,13 @@ def _update_initial( ): # type: (...) -> "models.Image" cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -201,14 +204,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ImageUpdate') 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 @@ -216,7 +217,6 @@ def _update_initial( 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('Image', pipeline_response) @@ -236,7 +236,7 @@ def begin_update( parameters, # type: "models.ImageUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Image"] """Update an image. :param resource_group_name: The name of the resource group. @@ -303,7 +303,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -323,7 +325,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -343,7 +344,7 @@ def begin_delete( image_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes an Image. :param resource_group_name: The name of the resource group. @@ -418,9 +419,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -439,9 +443,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -474,11 +477,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -491,15 +501,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -532,7 +538,7 @@ def list( ): # type: (...) -> Iterable["models.ImageListResult"] """Gets the list of Images in the subscription. Use nextLink property in the response to get the - next page of Images. Do this till nextLink is null to fetch all the Images. + next page of Images. Do this till nextLink is null to fetch all the Images. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ImageListResult or the result of cls(response) @@ -540,11 +546,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -556,15 +569,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_log_analytics_operations.py index b5f1bbf8d296..86a21c66ca59 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_log_analytics_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod @@ -52,12 +52,15 @@ def _export_request_rate_by_interval_initial( parameters, # type: "models.RequestRateByIntervalInput" **kwargs # type: Any ): - # type: (...) -> "models.LogAnalyticsOperationResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._export_request_rate_by_interval_initial.metadata['url'] # type: ignore @@ -74,14 +77,12 @@ def _export_request_rate_by_interval_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RequestRateByIntervalInput') 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 @@ -105,9 +106,9 @@ def begin_export_request_rate_by_interval( parameters, # type: "models.RequestRateByIntervalInput" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LogAnalyticsOperationResult"] """Export logs that show Api requests made by this subscription in the given time window to show - throttling activities. + throttling activities. :param location: The location upon which virtual-machine-sizes is queried. :type location: str @@ -168,12 +169,15 @@ def _export_throttled_requests_initial( parameters, # type: "models.LogAnalyticsInputBase" **kwargs # type: Any ): - # type: (...) -> "models.LogAnalyticsOperationResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._export_throttled_requests_initial.metadata['url'] # type: ignore @@ -190,14 +194,12 @@ def _export_throttled_requests_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LogAnalyticsInputBase') 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 @@ -221,9 +223,9 @@ def begin_export_throttled_requests( parameters, # type: "models.LogAnalyticsInputBase" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LogAnalyticsOperationResult"] """Export logs that show total throttled Api requests for this subscription in the given time - window. + window. :param location: The location upon which virtual-machine-sizes is queried. :type location: str diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_operations.py index 0e8377a942f0..884abc403246 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -58,11 +58,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeOperationListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -70,15 +77,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_proximity_placement_groups_operations.py index 4d299e6ba587..6f7d1528591d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_proximity_placement_groups_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -67,10 +67,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -88,14 +91,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ProximityPlacementGroup') 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 @@ -103,7 +104,6 @@ def create_or_update( 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('ProximityPlacementGroup', pipeline_response) @@ -138,10 +138,13 @@ def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -159,14 +162,12 @@ def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'UpdateResource') 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 @@ -201,7 +202,9 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -221,7 +224,6 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -258,9 +260,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -279,9 +284,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -311,11 +315,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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_subscription.metadata['url'] # type: ignore @@ -327,15 +338,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -378,11 +385,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -395,15 +409,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_snapshots_operations.py index 6542824ee042..e7a4e7191dc7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_snapshots_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.Snapshot" cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('Snapshot', pipeline_response) @@ -112,14 +112,14 @@ def begin_create_or_update( snapshot, # type: "models.Snapshot" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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.v2019_07_01.models.Snapshot @@ -182,10 +182,13 @@ def _update_initial( ): # type: (...) -> "models.Snapshot" cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -203,14 +206,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -218,7 +219,6 @@ def _update_initial( 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('Snapshot', pipeline_response) @@ -238,14 +238,14 @@ def begin_update( snapshot, # type: "models.SnapshotUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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.v2019_07_01.models.SnapshotUpdate @@ -320,9 +320,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -339,9 +342,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -366,7 +368,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -386,7 +390,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -406,14 +409,14 @@ def begin_delete( snapshot_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. @@ -477,11 +480,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -494,15 +504,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -542,11 +548,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -558,15 +571,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -600,12 +609,15 @@ def _grant_access_initial( grant_access_data, # type: "models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> "models.AccessUri" - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # 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 = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._grant_access_initial.metadata['url'] # type: ignore @@ -623,14 +635,12 @@ def _grant_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -655,17 +665,17 @@ def begin_grant_access( grant_access_data, # type: "models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. + operation. :type grant_access_data: ~azure.mgmt.compute.v2019_07_01.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. @@ -725,7 +735,9 @@ def _revoke_access_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -745,7 +757,6 @@ def _revoke_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -765,14 +776,14 @@ def begin_revoke_access( snapshot_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_usage_operations.py index 9a518e7f69a7..15cffc568a8b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_usage_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,7 +52,7 @@ def list( ): # type: (...) -> Iterable["models.ListUsagesResult"] """Gets, for the specified location, the current compute resource usage information as well as the - limits for compute resources under the subscription. + limits for compute resources under the subscription. :param location: The location for which resource usage is queried. :type location: str @@ -62,11 +62,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -79,15 +86,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_extension_images_operations.py index 758b786e76a4..ac990a73e702 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_extension_images_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -69,9 +69,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -90,9 +93,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -128,9 +130,12 @@ def list_types( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.list_types.metadata['url'] # type: ignore @@ -147,9 +152,8 @@ def list_types( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -197,9 +201,12 @@ def list_versions( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.list_versions.metadata['url'] # type: ignore @@ -223,9 +230,8 @@ def list_versions( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_extensions_operations.py index ee6557f49e40..da482d663576 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_extensions_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachineExtension" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -78,14 +81,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtension') 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 @@ -93,7 +94,6 @@ def _create_or_update_initial( 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('VirtualMachineExtension', pipeline_response) @@ -114,18 +114,18 @@ def begin_create_or_update( extension_parameters, # type: "models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineExtension"] """The operation to create or update the extension. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_name: The name of the virtual machine where the extension should be created or - updated. + updated. :type vm_name: str :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Create Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineExtension :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. @@ -188,10 +188,13 @@ def _update_initial( ): # type: (...) -> "models.VirtualMachineExtension" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -210,14 +213,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtensionUpdate') 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 @@ -241,7 +242,7 @@ def begin_update( extension_parameters, # type: "models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineExtension"] """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -251,7 +252,7 @@ def begin_update( :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Update Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineExtensionUpdate :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. @@ -313,7 +314,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -334,7 +337,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -355,7 +357,7 @@ def begin_delete( vm_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -436,9 +438,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -458,9 +463,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -499,9 +503,12 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -520,9 +527,8 @@ def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_images_operations.py index a49bde3a35b5..2762eaaf7d7f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_images_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -72,9 +72,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -94,9 +97,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -148,9 +150,12 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -175,9 +180,8 @@ def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -213,9 +217,12 @@ def list_offers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.list_offers.metadata['url'] # type: ignore @@ -232,9 +239,8 @@ def list_offers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -267,9 +273,12 @@ def list_publishers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.list_publishers.metadata['url'] # type: ignore @@ -285,9 +294,8 @@ def list_publishers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -326,9 +334,12 @@ def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.list_skus.metadata['url'] # type: ignore @@ -346,9 +357,8 @@ def list_skus( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_run_commands_operations.py index 09b24ea98fa7..2a25ef59366f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_run_commands_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -61,11 +61,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json, text/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 @@ -78,15 +85,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -132,9 +135,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandDocument"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json, text/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -151,9 +157,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_extensions_operations.py index 0cab83dacd32..ef05948334b1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -57,10 +57,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachineScaleSetExtension" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -79,14 +82,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineScaleSetExtension') 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 @@ -94,7 +95,6 @@ def _create_or_update_initial( 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('VirtualMachineScaleSetExtension', pipeline_response) @@ -115,18 +115,18 @@ def begin_create_or_update( extension_parameters, # type: "models.VirtualMachineScaleSetExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineScaleSetExtension"] """The operation to create or update an extension. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_scale_set_name: The name of the VM scale set where the extension should be create or - updated. + updated. :type vm_scale_set_name: str :param vmss_extension_name: The name of the VM scale set extension. :type vmss_extension_name: str :param extension_parameters: Parameters supplied to the Create VM scale set Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSetExtension :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. @@ -189,10 +189,13 @@ def _update_initial( ): # type: (...) -> "models.VirtualMachineScaleSetExtension" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -211,14 +214,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineScaleSetExtensionUpdate') 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 @@ -226,7 +227,6 @@ def _update_initial( 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('VirtualMachineScaleSetExtension', pipeline_response) @@ -247,7 +247,7 @@ def begin_update( extension_parameters, # type: "models.VirtualMachineScaleSetExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineScaleSetExtension"] """The operation to update an extension. :param resource_group_name: The name of the resource group. @@ -257,7 +257,7 @@ def begin_update( :param vmss_extension_name: The name of the VM scale set extension. :type vmss_extension_name: str :param extension_parameters: Parameters supplied to the Update VM scale set Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSetExtensionUpdate :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. @@ -319,7 +319,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -340,7 +342,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -361,7 +362,7 @@ def begin_delete( vmss_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -442,9 +443,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -464,9 +468,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -502,11 +505,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtensionListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -520,15 +530,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index e892c79d4d8d..ed39bc738334 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod @@ -54,7 +54,9 @@ def _cancel_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -74,7 +76,6 @@ def _cancel_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -94,7 +95,7 @@ def begin_cancel( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Cancels the current virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -155,7 +156,9 @@ def _start_os_upgrade_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -175,7 +178,6 @@ def _start_os_upgrade_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -195,10 +197,10 @@ def begin_start_os_upgrade( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts a rolling upgrade to move all virtual machine scale set instances to the latest - available Platform Image OS version. Instances which are already running the latest available - OS version are not affected. + available Platform Image OS version. Instances which are already running the latest available + OS version are not affected. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -258,7 +260,9 @@ def _start_extension_upgrade_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -278,7 +282,6 @@ def _start_extension_upgrade_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -298,10 +301,10 @@ def begin_start_extension_upgrade( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to - the latest available extension version. Instances which are already running the latest - extension versions are not affected. + the latest available extension version. Instances which are already running the latest + extension versions are not affected. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -372,9 +375,12 @@ def get_latest( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RollingUpgradeStatusInfo"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get_latest.metadata['url'] # type: ignore @@ -391,9 +397,8 @@ def get_latest( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py index 9f78545a53e8..14fe76631acb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod @@ -57,10 +57,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachineExtension" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -80,14 +83,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtension') 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 @@ -95,7 +96,6 @@ def _create_or_update_initial( 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('VirtualMachineExtension', pipeline_response) @@ -117,7 +117,7 @@ def begin_create_or_update( extension_parameters, # type: "models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineExtension"] """The operation to create or update the VMSS VM extension. :param resource_group_name: The name of the resource group. @@ -129,7 +129,7 @@ def begin_create_or_update( :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Create Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineExtension :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. @@ -194,10 +194,13 @@ def _update_initial( ): # type: (...) -> "models.VirtualMachineExtension" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -217,14 +220,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtensionUpdate') 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 @@ -249,7 +250,7 @@ def begin_update( extension_parameters, # type: "models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineExtension"] """The operation to update the VMSS VM extension. :param resource_group_name: The name of the resource group. @@ -261,7 +262,7 @@ def begin_update( :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Update Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineExtensionUpdate :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. @@ -325,9 +326,12 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -346,8 +350,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -369,7 +373,7 @@ def begin_delete( vm_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to delete the VMSS VM extension. :param resource_group_name: The name of the resource group. @@ -456,9 +460,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -479,9 +486,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -523,9 +529,12 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -545,9 +554,8 @@ def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_vms_operations.py index b8984027421a..079154708917 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -57,7 +57,9 @@ def _reimage_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") @@ -80,7 +82,6 @@ def _reimage_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_scale_set_vm_reimage_input is not None: body_content = self._serialize.body(vm_scale_set_vm_reimage_input, 'VirtualMachineReimageParameters') @@ -88,7 +89,6 @@ def _reimage_initial( body_content = None 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 @@ -109,7 +109,7 @@ def begin_reimage( vm_scale_set_vm_reimage_input=None, # type: Optional["models.VirtualMachineReimageParameters"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -177,7 +177,9 @@ def _reimage_all_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -198,7 +200,6 @@ def _reimage_all_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -219,9 +220,9 @@ def begin_reimage_all( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. - This operation is only supported for managed disks. + This operation is only supported for managed disks. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -285,7 +286,9 @@ def _deallocate_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -306,7 +309,6 @@ def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -327,10 +329,10 @@ def begin_deallocate( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and - releases the compute resources it uses. You are not billed for the compute resources of this - virtual machine once it is deallocated. + releases the compute resources it uses. You are not billed for the compute resources of this + virtual machine once it is deallocated. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -395,10 +397,13 @@ def _update_initial( ): # type: (...) -> "models.VirtualMachineScaleSetVM" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -417,14 +422,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSetVM') 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 @@ -432,7 +435,6 @@ def _update_initial( 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('VirtualMachineScaleSetVM', pipeline_response) @@ -453,13 +455,13 @@ def begin_update( parameters, # type: "models.VirtualMachineScaleSetVM" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineScaleSetVM"] """Updates a virtual machine of a VM scale set. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_scale_set_name: The name of the VM scale set where the extension should be create or - updated. + updated. :type vm_scale_set_name: str :param instance_id: The instance ID of the virtual machine. :type instance_id: str @@ -525,7 +527,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -546,7 +550,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -567,7 +570,7 @@ def begin_delete( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -648,9 +651,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -670,9 +676,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -711,9 +716,12 @@ def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -731,9 +739,8 @@ def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -766,11 +773,14 @@ def list( :type resource_group_name: str :param virtual_machine_scale_set_name: The name of the VM scale set. :type virtual_machine_scale_set_name: str - :param filter: The filter to apply to the operation. + :param filter: The filter to apply to the operation. Allowed values are + 'startswith(instanceView/statuses/code, 'PowerState') eq true', 'properties/latestModelApplied + eq true', 'properties/latestModelApplied eq false'. :type filter: str - :param select: The list parameters. + :param select: The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. :type select: str - :param expand: The expand expression to apply to the operation. + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetVMListResult or the result of cls(response) @@ -778,11 +788,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -802,15 +819,11 @@ def prepare_request(next_link=None): query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -847,7 +860,9 @@ def _power_off_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -870,7 +885,6 @@ def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -892,10 +906,10 @@ def begin_power_off( skip_shutdown=False, # type: Optional[bool] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached - and you are getting charged for the resources. Instead, use deallocate to release resources and - avoid charges. + and you are getting charged for the resources. Instead, use deallocate to release resources and + avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -904,8 +918,8 @@ def begin_power_off( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param skip_shutdown: The parameter to request non-graceful VM shutdown. True value for this - flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this - flag is false if not specified. + flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this + flag is false if not specified. :type skip_shutdown: 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. @@ -964,7 +978,9 @@ def _restart_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -985,7 +1001,6 @@ def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1006,7 +1021,7 @@ def begin_restart( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Restarts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1071,7 +1086,9 @@ def _start_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -1092,7 +1109,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1113,7 +1129,7 @@ def begin_start( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1178,7 +1194,9 @@ def _redeploy_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -1199,7 +1217,6 @@ def _redeploy_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1220,9 +1237,9 @@ def begin_redeploy( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and - powers it back on. + powers it back on. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1286,7 +1303,9 @@ def _perform_maintenance_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -1307,7 +1326,6 @@ def _perform_maintenance_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1328,7 +1346,7 @@ def begin_perform_maintenance( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Performs maintenance on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1392,12 +1410,15 @@ def _run_command_initial( parameters, # type: "models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> "models.RunCommandResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" # Construct URL url = self._run_command_initial.metadata['url'] # type: ignore @@ -1416,14 +1437,12 @@ def _run_command_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RunCommandInput') 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 @@ -1449,7 +1468,7 @@ def begin_run_command( parameters, # type: "models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RunCommandResult"] """Run command on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_sets_operations.py index 7345fff07efc..6e897de6140b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_sets_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachineScaleSet" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSet') 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('VirtualMachineScaleSet', pipeline_response) @@ -112,7 +112,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualMachineScaleSet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -180,10 +180,13 @@ def _update_initial( ): # type: (...) -> "models.VirtualMachineScaleSet" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -201,14 +204,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSetUpdate') 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 @@ -231,7 +232,7 @@ def begin_update( parameters, # type: "models.VirtualMachineScaleSetUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] """Update a VM scale set. :param resource_group_name: The name of the resource group. @@ -298,7 +299,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -318,7 +321,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -338,7 +340,7 @@ def begin_delete( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VM scale set. :param resource_group_name: The name of the resource group. @@ -410,9 +412,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -429,9 +434,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -457,7 +461,9 @@ def _deallocate_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") @@ -479,7 +485,6 @@ def _deallocate_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -487,7 +492,6 @@ def _deallocate_initial( body_content = None 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 @@ -507,10 +511,10 @@ def begin_deallocate( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and - releases the compute resources. You are not billed for the compute resources that this virtual - machine scale set deallocates. + releases the compute resources. You are not billed for the compute resources that this virtual + machine scale set deallocates. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -574,7 +578,9 @@ def _delete_instances_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") @@ -596,12 +602,10 @@ def _delete_instances_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -621,7 +625,7 @@ def begin_delete_instances( vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -696,9 +700,12 @@ def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -715,9 +722,8 @@ def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -750,11 +756,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -767,15 +780,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -808,8 +817,8 @@ def list_all( ): # type: (...) -> Iterable["models.VirtualMachineScaleSetListWithLinkResult"] """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource - group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this - till nextLink is null to fetch all the VM Scale Sets. + group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this + till nextLink is null to fetch all the VM Scale Sets. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetListWithLinkResult or the result of cls(response) @@ -817,11 +826,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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_all.metadata['url'] # type: ignore @@ -833,15 +849,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -876,7 +888,7 @@ def list_skus( ): # type: (...) -> Iterable["models.VirtualMachineScaleSetListSkusResult"] """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM - instances allowed for each SKU. + instances allowed for each SKU. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -888,11 +900,18 @@ def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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_skus.metadata['url'] # type: ignore @@ -906,15 +925,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -960,11 +975,18 @@ def get_os_upgrade_history( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListOSUpgradeHistory"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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.get_os_upgrade_history.metadata['url'] # type: ignore @@ -978,15 +1000,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1023,7 +1041,9 @@ def _power_off_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") @@ -1047,7 +1067,6 @@ def _power_off_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1055,7 +1074,6 @@ def _power_off_initial( body_content = None 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 @@ -1076,18 +1094,18 @@ def begin_power_off( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still - attached and you are getting charged for the resources. Instead, use deallocate to release - resources and avoid charges. + attached and you are getting charged for the resources. Instead, use deallocate to release + resources and avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_scale_set_name: The name of the VM scale set. :type vm_scale_set_name: str :param skip_shutdown: The parameter to request non-graceful VM shutdown. True value for this - flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this - flag is false if not specified. + flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this + flag is false if not specified. :type skip_shutdown: bool :param vm_instance_i_ds: A list of virtual machine instance IDs from the VM scale set. :type vm_instance_i_ds: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSetVMInstanceIDs @@ -1148,7 +1166,9 @@ def _restart_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") @@ -1170,7 +1190,6 @@ def _restart_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1178,7 +1197,6 @@ def _restart_initial( body_content = None 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 @@ -1198,7 +1216,7 @@ def begin_restart( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Restarts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1263,7 +1281,9 @@ def _start_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") @@ -1285,7 +1305,6 @@ def _start_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1293,7 +1312,6 @@ def _start_initial( body_content = None 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 @@ -1313,7 +1331,7 @@ def begin_start( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1378,7 +1396,9 @@ def _redeploy_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") @@ -1400,7 +1420,6 @@ def _redeploy_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1408,7 +1427,6 @@ def _redeploy_initial( body_content = None 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 @@ -1428,9 +1446,9 @@ def begin_redeploy( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, - and powers them back on. + and powers them back on. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1494,7 +1512,9 @@ def _perform_maintenance_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") @@ -1516,7 +1536,6 @@ def _perform_maintenance_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1524,7 +1543,6 @@ def _perform_maintenance_initial( body_content = None 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 @@ -1544,11 +1562,11 @@ def begin_perform_maintenance( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances - which are not eligible for perform maintenance will be failed. Please refer to best practices - for more details: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual- - machine-scale-sets-maintenance-notifications. + which are not eligible for perform maintenance will be failed. Please refer to best practices + for more details: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual- + machine-scale-sets-maintenance-notifications. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1612,7 +1630,9 @@ def _update_instances_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") @@ -1634,12 +1654,10 @@ def _update_instances_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -1659,7 +1677,7 @@ def begin_update_instances( vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. :param resource_group_name: The name of the resource group. @@ -1724,7 +1742,9 @@ def _reimage_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") @@ -1746,7 +1766,6 @@ def _reimage_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_scale_set_reimage_input is not None: body_content = self._serialize.body(vm_scale_set_reimage_input, 'VirtualMachineScaleSetReimageParameters') @@ -1754,7 +1773,6 @@ def _reimage_initial( body_content = None 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 @@ -1774,10 +1792,10 @@ def begin_reimage( vm_scale_set_reimage_input=None, # type: Optional["models.VirtualMachineScaleSetReimageParameters"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which - don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual - machine is reset to initial state. + don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual + machine is reset to initial state. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1841,7 +1859,9 @@ def _reimage_all_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") @@ -1863,7 +1883,6 @@ def _reimage_all_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1871,7 +1890,6 @@ def _reimage_all_initial( body_content = None 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 @@ -1891,9 +1909,9 @@ def begin_reimage_all( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This - operation is only supported for managed disks. + operation is only supported for managed disks. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1972,9 +1990,12 @@ def force_recovery_service_fabric_platform_update_domain_walk( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RecoveryWalkResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.force_recovery_service_fabric_platform_update_domain_walk.metadata['url'] # type: ignore @@ -1992,9 +2013,8 @@ def force_recovery_service_fabric_platform_update_domain_walk( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -2033,8 +2053,11 @@ def convert_to_single_placement_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL @@ -2048,17 +2071,16 @@ def convert_to_single_placement_group( # 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') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VMScaleSetConvertToSinglePlacementGroupInput') 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_sizes_operations.py index c7ee4e6f5949..8f2c37fcaa22 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_sizes_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,7 +52,7 @@ def list( ): # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] """This API is deprecated. Use `Resources Skus `_. + us/rest/api/compute/resourceskus/list>`_. :param location: The location upon which virtual-machine-sizes is queried. :type location: str @@ -62,11 +62,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -79,15 +86,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machines_operations.py index d875c73ec5b3..8566cf409ccc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machines_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -63,11 +63,18 @@ def list_by_location( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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_location.metadata['url'] # type: ignore @@ -80,15 +87,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -122,12 +125,15 @@ def _capture_initial( parameters, # type: "models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._capture_initial.metadata['url'] # type: ignore @@ -145,14 +151,12 @@ def _capture_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineCaptureParameters') 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 @@ -177,9 +181,9 @@ def begin_capture( parameters, # type: "models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineCaptureResult"] """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used - to create similar VMs. + to create similar VMs. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -246,10 +250,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachine" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -267,14 +274,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachine') 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 @@ -282,7 +287,6 @@ def _create_or_update_initial( 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('VirtualMachine', pipeline_response) @@ -302,9 +306,9 @@ def begin_create_or_update( parameters, # type: "models.VirtualMachine" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachine"] """The operation to create or update a virtual machine. Please note some properties can be set - only during virtual machine creation. + only during virtual machine creation. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -371,10 +375,13 @@ def _update_initial( ): # type: (...) -> "models.VirtualMachine" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -392,14 +399,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineUpdate') 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 @@ -407,7 +412,6 @@ def _update_initial( 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('VirtualMachine', pipeline_response) @@ -427,7 +431,7 @@ def begin_update( parameters, # type: "models.VirtualMachineUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachine"] """The operation to update a virtual machine. :param resource_group_name: The name of the resource group. @@ -494,7 +498,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -514,7 +520,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -534,7 +539,7 @@ def begin_delete( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to delete a virtual machine. :param resource_group_name: The name of the resource group. @@ -609,9 +614,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -630,9 +638,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -668,9 +675,12 @@ def instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self.instance_view.metadata['url'] # type: ignore @@ -687,9 +697,8 @@ def instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -714,7 +723,9 @@ def _convert_to_managed_disks_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -734,7 +745,6 @@ def _convert_to_managed_disks_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -754,9 +764,9 @@ def begin_convert_to_managed_disks( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop- - deallocated before invoking this operation. + deallocated before invoking this operation. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -816,7 +826,9 @@ def _deallocate_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -836,7 +848,6 @@ def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -856,9 +867,9 @@ def begin_deallocate( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Shuts down the virtual machine and releases the compute resources. You are not billed for the - compute resources that this virtual machine uses. + compute resources that this virtual machine uses. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -934,7 +945,9 @@ def generalize( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -954,7 +967,6 @@ def generalize( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -975,7 +987,7 @@ def list( ): # type: (...) -> Iterable["models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified resource group. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -985,11 +997,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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 @@ -1002,15 +1021,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1044,10 +1059,10 @@ def list_all( ): # type: (...) -> Iterable["models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified subscription. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :param status_only: statusOnly=true enables fetching run time status of all Virtual Machines in - the subscription. + the subscription. :type status_only: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineListResult or the result of cls(response) @@ -1055,11 +1070,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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_all.metadata['url'] # type: ignore @@ -1073,15 +1095,11 @@ def prepare_request(next_link=None): if status_only is not None: query_parameters['statusOnly'] = self._serialize.query("status_only", status_only, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1116,7 +1134,7 @@ def list_available_sizes( ): # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes to which the specified virtual machine can be - resized. + resized. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1128,11 +1146,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + 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_available_sizes.metadata['url'] # type: ignore @@ -1146,15 +1171,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1190,7 +1211,9 @@ def _power_off_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -1212,7 +1235,6 @@ def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1233,17 +1255,17 @@ def begin_power_off( skip_shutdown=False, # type: Optional[bool] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with - the same provisioned resources. You are still charged for this virtual machine. + the same provisioned resources. You are still charged for this virtual machine. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_name: The name of the virtual machine. :type vm_name: str :param skip_shutdown: The parameter to request non-graceful VM shutdown. True value for this - flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this - flag is false if not specified. + flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this + flag is false if not specified. :type skip_shutdown: 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. @@ -1300,9 +1322,12 @@ def _reapply_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" + accept = "application/json" # Construct URL url = self._reapply_initial.metadata['url'] # type: ignore @@ -1319,8 +1344,8 @@ def _reapply_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1340,7 +1365,7 @@ def begin_reapply( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to reapply a virtual machine's state. :param resource_group_name: The name of the resource group. @@ -1401,7 +1426,9 @@ def _restart_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -1421,7 +1448,6 @@ def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1441,7 +1467,7 @@ def begin_restart( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to restart a virtual machine. :param resource_group_name: The name of the resource group. @@ -1502,7 +1528,9 @@ def _start_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -1522,7 +1550,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1542,7 +1569,7 @@ def begin_start( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to start a virtual machine. :param resource_group_name: The name of the resource group. @@ -1603,7 +1630,9 @@ def _redeploy_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -1623,7 +1652,6 @@ def _redeploy_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1643,7 +1671,7 @@ def begin_redeploy( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Shuts down the virtual machine, moves it to a new node, and powers it back on. :param resource_group_name: The name of the resource group. @@ -1705,7 +1733,9 @@ def _reimage_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") @@ -1727,7 +1757,6 @@ def _reimage_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: body_content = self._serialize.body(parameters, 'VirtualMachineReimageParameters') @@ -1735,7 +1764,6 @@ def _reimage_initial( body_content = None 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 @@ -1755,7 +1783,7 @@ def begin_reimage( parameters=None, # type: Optional["models.VirtualMachineReimageParameters"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Reimages the virtual machine which has an ephemeral OS disk back to its initial state. :param resource_group_name: The name of the resource group. @@ -1819,7 +1847,9 @@ def _perform_maintenance_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -1839,7 +1869,6 @@ def _perform_maintenance_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1859,7 +1888,7 @@ def begin_perform_maintenance( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to perform maintenance on a virtual machine. :param resource_group_name: The name of the resource group. @@ -1919,12 +1948,15 @@ def _run_command_initial( parameters, # type: "models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> "models.RunCommandResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" # Construct URL url = self._run_command_initial.metadata['url'] # type: ignore @@ -1942,14 +1974,12 @@ def _run_command_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RunCommandInput') 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 @@ -1974,7 +2004,7 @@ def begin_run_command( parameters, # type: "models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RunCommandResult"] """Run command on the VM. :param resource_group_name: The name of the resource group. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/__init__.py index 20a4019e9c23..cdc7f7a1709a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/__init__.py @@ -10,7 +10,7 @@ __all__ = ['ComputeManagementClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass 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 b926870da9fd..637da39beaca 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,6 +56,7 @@ 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/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_configuration.py index 018a50abcd99..45351f86240a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -47,8 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2019-11-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-compute/{}'.format(VERSION)) self._configure(**kwargs) @@ -61,6 +61,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) 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 f3dfd76a1d35..1ed1808966d9 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 @@ -4,7 +4,11 @@ "client": { "name": "ComputeManagementClient", "filename": "_compute_management_client", - "description": "Compute Client." + "description": "Compute Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true }, "global_parameters": { "sync_method": { @@ -41,7 +45,10 @@ }, "config": { "credential": true, - "credential_scopes": ["https://management.azure.com/.default"] + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null }, "operation_groups": { "disks": "DisksOperations", diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/__init__.py index c8a8b4817269..9e9459635989 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._compute_management_client_async import ComputeManagementClient +from ._compute_management_client import ComputeManagementClient __all__ = ['ComputeManagementClient'] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/_compute_management_client_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/_compute_management_client.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/_compute_management_client_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/_compute_management_client.py index 72bc6cf9c185..896aa8817f96 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/_compute_management_client_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/_compute_management_client.py @@ -15,10 +15,10 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration_async import ComputeManagementClientConfiguration -from .operations_async import DisksOperations -from .operations_async import SnapshotsOperations -from .operations_async import DiskEncryptionSetsOperations +from ._configuration import ComputeManagementClientConfiguration +from .operations import DisksOperations +from .operations import SnapshotsOperations +from .operations import DiskEncryptionSetsOperations from .. import models @@ -26,11 +26,11 @@ class ComputeManagementClient(object): """Compute Client. :ivar disks: DisksOperations operations - :vartype disks: azure.mgmt.compute.v2019_11_01.aio.operations_async.DisksOperations + :vartype disks: azure.mgmt.compute.v2019_11_01.aio.operations.DisksOperations :ivar snapshots: SnapshotsOperations operations - :vartype snapshots: azure.mgmt.compute.v2019_11_01.aio.operations_async.SnapshotsOperations + :vartype snapshots: azure.mgmt.compute.v2019_11_01.aio.operations.SnapshotsOperations :ivar disk_encryption_sets: DiskEncryptionSetsOperations operations - :vartype disk_encryption_sets: azure.mgmt.compute.v2019_11_01.aio.operations_async.DiskEncryptionSetsOperations + :vartype disk_encryption_sets: azure.mgmt.compute.v2019_11_01.aio.operations.DiskEncryptionSetsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. @@ -53,6 +53,7 @@ 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/aio/_configuration_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/_configuration.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/_configuration_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/_configuration.py index f8afede90d32..8f91d7173f40 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/_configuration_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -44,8 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2019-11-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-compute/{}'.format(VERSION)) self._configure(**kwargs) @@ -57,6 +57,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations_async/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/__init__.py similarity index 74% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations_async/__init__.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/__init__.py index 7e40c3a7633a..c280f94ec071 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations_async/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/__init__.py @@ -6,9 +6,9 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._disks_operations_async import DisksOperations -from ._snapshots_operations_async import SnapshotsOperations -from ._disk_encryption_sets_operations_async import DiskEncryptionSetsOperations +from ._disks_operations import DisksOperations +from ._snapshots_operations import SnapshotsOperations +from ._disk_encryption_sets_operations import DiskEncryptionSetsOperations __all__ = [ 'DisksOperations', diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations_async/_disk_encryption_sets_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_disk_encryption_sets_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations_async/_disk_encryption_sets_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_disk_encryption_sets_operations.py index 9ccade1f6490..318e3ee38178 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations_async/_disk_encryption_sets_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_disk_encryption_sets_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.DiskEncryptionSet": cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('DiskEncryptionSet', pipeline_response) @@ -106,17 +106,17 @@ async def begin_create_or_update( disk_encryption_set_name: str, disk_encryption_set: "models.DiskEncryptionSet", **kwargs - ) -> "models.DiskEncryptionSet": + ) -> 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. + 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. + encryption set operation. :type disk_encryption_set: ~azure.mgmt.compute.v2019_11_01.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. @@ -124,8 +124,8 @@ async def begin_create_or_update( 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: DiskEncryptionSet, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_11_01.models.DiskEncryptionSet + :return: An instance of AsyncLROPoller that returns either DiskEncryptionSet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_11_01.models.DiskEncryptionSet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -176,10 +176,13 @@ async def _update_initial( **kwargs ) -> "models.DiskEncryptionSet": cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -197,14 +200,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -212,7 +213,6 @@ async def _update_initial( 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('DiskEncryptionSet', pipeline_response) @@ -231,17 +231,17 @@ async def begin_update( disk_encryption_set_name: str, disk_encryption_set: "models.DiskEncryptionSetUpdate", **kwargs - ) -> "models.DiskEncryptionSet": + ) -> 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. + 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. + encryption set operation. :type disk_encryption_set: ~azure.mgmt.compute.v2019_11_01.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. @@ -249,8 +249,8 @@ async def begin_update( 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: DiskEncryptionSet, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_11_01.models.DiskEncryptionSet + :return: An instance of AsyncLROPoller that returns either DiskEncryptionSet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_11_01.models.DiskEncryptionSet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -313,9 +313,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -332,9 +335,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -358,9 +360,12 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -377,8 +382,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -397,14 +402,14 @@ async def begin_delete( resource_group_name: str, disk_encryption_set_name: str, **kwargs - ) -> None: + ) -> 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. + 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. @@ -412,8 +417,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -467,11 +472,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSetList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" + 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 @@ -484,15 +496,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -531,11 +539,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSetList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" + 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 @@ -547,15 +562,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations_async/_disks_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_disks_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations_async/_disks_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_disks_operations.py index f8e50155dc55..a5c558ce2e9e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations_async/_disks_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_disks_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.Disk": cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('Disk', pipeline_response) @@ -106,14 +106,14 @@ async def begin_create_or_update( disk_name: str, disk: "models.Disk", **kwargs - ) -> "models.Disk": + ) -> 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. + 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.v2019_11_01.models.Disk @@ -123,8 +123,8 @@ async def begin_create_or_update( 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: Disk, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_11_01.models.Disk + :return: An instance of AsyncLROPoller that returns either Disk or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_11_01.models.Disk] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -175,10 +175,13 @@ async def _update_initial( **kwargs ) -> "models.Disk": cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -196,14 +199,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -211,7 +212,6 @@ async def _update_initial( 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('Disk', pipeline_response) @@ -230,14 +230,14 @@ async def begin_update( disk_name: str, disk: "models.DiskUpdate", **kwargs - ) -> "models.Disk": + ) -> 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. + 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.v2019_11_01.models.DiskUpdate @@ -247,8 +247,8 @@ async def begin_update( 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: Disk, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_11_01.models.Disk + :return: An instance of AsyncLROPoller that returns either Disk or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_11_01.models.Disk] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -311,9 +311,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -330,9 +333,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -356,7 +358,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -376,7 +380,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -395,14 +398,14 @@ async def begin_delete( resource_group_name: str, disk_name: str, **kwargs - ) -> None: + ) -> 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. + 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. @@ -410,8 +413,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -465,11 +468,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" + 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 @@ -482,15 +492,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -529,11 +535,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" + 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 @@ -545,15 +558,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -586,12 +595,15 @@ async def _grant_access_initial( disk_name: str, grant_access_data: "models.GrantAccessData", **kwargs - ) -> "models.AccessUri": - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> 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 = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._grant_access_initial.metadata['url'] # type: ignore @@ -609,14 +621,12 @@ async def _grant_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -640,17 +650,17 @@ async def begin_grant_access( disk_name: str, grant_access_data: "models.GrantAccessData", **kwargs - ) -> "models.AccessUri": + ) -> 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. + 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. + operation. :type grant_access_data: ~azure.mgmt.compute.v2019_11_01.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. @@ -658,8 +668,8 @@ async def begin_grant_access( 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: AccessUri, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_11_01.models.AccessUri + :return: An instance of AsyncLROPoller that returns either AccessUri or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_11_01.models.AccessUri] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -709,7 +719,9 @@ async def _revoke_access_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -729,7 +741,6 @@ async def _revoke_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -748,14 +759,14 @@ async def begin_revoke_access( resource_group_name: str, disk_name: str, **kwargs - ) -> None: + ) -> 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. + 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. @@ -763,8 +774,8 @@ async def begin_revoke_access( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations_async/_snapshots_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_snapshots_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations_async/_snapshots_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_snapshots_operations.py index 2a7794e8d2c6..f512035abb34 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations_async/_snapshots_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_snapshots_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.Snapshot": cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('Snapshot', pipeline_response) @@ -106,14 +106,14 @@ async def begin_create_or_update( snapshot_name: str, snapshot: "models.Snapshot", **kwargs - ) -> "models.Snapshot": + ) -> 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. + 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.v2019_11_01.models.Snapshot @@ -123,8 +123,8 @@ async def begin_create_or_update( 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: Snapshot, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_11_01.models.Snapshot + :return: An instance of AsyncLROPoller that returns either Snapshot or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_11_01.models.Snapshot] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -175,10 +175,13 @@ async def _update_initial( **kwargs ) -> "models.Snapshot": cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -196,14 +199,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -211,7 +212,6 @@ async def _update_initial( 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('Snapshot', pipeline_response) @@ -230,14 +230,14 @@ async def begin_update( snapshot_name: str, snapshot: "models.SnapshotUpdate", **kwargs - ) -> "models.Snapshot": + ) -> 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. + 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.v2019_11_01.models.SnapshotUpdate @@ -247,8 +247,8 @@ async def begin_update( 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: Snapshot, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_11_01.models.Snapshot + :return: An instance of AsyncLROPoller that returns either Snapshot or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_11_01.models.Snapshot] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -311,9 +311,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -330,9 +333,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -356,7 +358,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -376,7 +380,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -395,14 +398,14 @@ async def begin_delete( resource_group_name: str, snapshot_name: str, **kwargs - ) -> None: + ) -> 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. + 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. @@ -410,8 +413,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -465,11 +468,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" + 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 @@ -482,15 +492,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -529,11 +535,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" + 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 @@ -545,15 +558,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -586,12 +595,15 @@ async def _grant_access_initial( snapshot_name: str, grant_access_data: "models.GrantAccessData", **kwargs - ) -> "models.AccessUri": - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> 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 = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._grant_access_initial.metadata['url'] # type: ignore @@ -609,14 +621,12 @@ async def _grant_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -640,17 +650,17 @@ async def begin_grant_access( snapshot_name: str, grant_access_data: "models.GrantAccessData", **kwargs - ) -> "models.AccessUri": + ) -> 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. + 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. + operation. :type grant_access_data: ~azure.mgmt.compute.v2019_11_01.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. @@ -658,8 +668,8 @@ async def begin_grant_access( 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: AccessUri, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_11_01.models.AccessUri + :return: An instance of AsyncLROPoller that returns either AccessUri or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_11_01.models.AccessUri] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -709,7 +719,9 @@ async def _revoke_access_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -729,7 +741,6 @@ async def _revoke_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -748,14 +759,14 @@ async def begin_revoke_access( resource_group_name: str, snapshot_name: str, **kwargs - ) -> None: + ) -> 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. + 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. @@ -763,8 +774,8 @@ async def begin_revoke_access( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/models/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/models/__init__.py index c05cbf0ec8a8..aaafc8a91c92 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/models/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/models/__init__.py @@ -66,6 +66,7 @@ from ._compute_management_client_enums import ( AccessLevel, DiskCreateOption, + DiskEncryptionSetIdentityType, DiskState, DiskStorageAccountTypes, EncryptionType, @@ -104,6 +105,7 @@ 'SourceVault', 'AccessLevel', 'DiskCreateOption', + 'DiskEncryptionSetIdentityType', 'DiskState', 'DiskStorageAccountTypes', 'EncryptionType', diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/models/_compute_management_client_enums.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/models/_compute_management_client_enums.py index 2dd8d4366dcb..6f7da999ae88 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/models/_compute_management_client_enums.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/models/_compute_management_client_enums.py @@ -6,71 +6,95 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum +from enum import Enum, EnumMeta +from six import with_metaclass -class AccessLevel(str, Enum): +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) - none = "None" - read = "Read" - write = "Write" + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) -class DiskCreateOption(str, Enum): + +class AccessLevel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + NONE = "None" + READ = "Read" + WRITE = "Write" + +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. + 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. + """ + + SYSTEM_ASSIGNED = "SystemAssigned" -class DiskState(str, Enum): +class DiskState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The 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. + 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(str, Enum): +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. + 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(str, Enum): +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 with XStore managed key at rest. It is the default encryption type. - encryption_at_rest_with_customer_key = "EncryptionAtRestWithCustomerKey" #: Disk is encrypted with Customer managed key at rest. + ENCRYPTION_AT_REST_WITH_PLATFORM_KEY = "EncryptionAtRestWithPlatformKey" #: Disk is encrypted with XStore managed key at rest. It is the default encryption type. + ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY = "EncryptionAtRestWithCustomerKey" #: Disk is encrypted with Customer managed key at rest. -class HyperVGeneration(str, Enum): +class HyperVGeneration(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The hypervisor generation of the Virtual Machine. Applicable to OS disks only. """ - v1 = "V1" - v2 = "V2" + V1 = "V1" + V2 = "V2" -class OperatingSystemTypes(str, Enum): +class OperatingSystemTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The Operating System type. """ - windows = "Windows" - linux = "Linux" + WINDOWS = "Windows" + LINUX = "Linux" -class SnapshotStorageAccountTypes(str, Enum): +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. + 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. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/models/_models.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/models/_models.py index aac0db7ecb90..ae18ae5be503 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/models/_models.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/models/_models.py @@ -639,9 +639,9 @@ class EncryptionSetIdentity(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar type: The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is - supported. Default value: "SystemAssigned". - :vartype type: str + :param type: The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is + supported. Possible values include: "SystemAssigned". + :type type: str or ~azure.mgmt.compute.v2019_11_01.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. @@ -653,7 +653,6 @@ class EncryptionSetIdentity(msrest.serialization.Model): """ _validation = { - 'type': {'constant': True}, 'principal_id': {'readonly': True}, 'tenant_id': {'readonly': True}, } @@ -664,13 +663,12 @@ class EncryptionSetIdentity(msrest.serialization.Model): 'tenant_id': {'key': 'tenantId', 'type': 'str'}, } - type = "SystemAssigned" - def __init__( self, **kwargs ): super(EncryptionSetIdentity, self).__init__(**kwargs) + self.type = kwargs.get('type', None) self.principal_id = None self.tenant_id = None diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/models/_models_py3.py index 7e8a77c9e751..058fd2181067 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/models/_models_py3.py @@ -711,9 +711,9 @@ class EncryptionSetIdentity(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar type: The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is - supported. Default value: "SystemAssigned". - :vartype type: str + :param type: The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is + supported. Possible values include: "SystemAssigned". + :type type: str or ~azure.mgmt.compute.v2019_11_01.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. @@ -725,7 +725,6 @@ class EncryptionSetIdentity(msrest.serialization.Model): """ _validation = { - 'type': {'constant': True}, 'principal_id': {'readonly': True}, 'tenant_id': {'readonly': True}, } @@ -736,13 +735,14 @@ class EncryptionSetIdentity(msrest.serialization.Model): 'tenant_id': {'key': 'tenantId', 'type': 'str'}, } - type = "SystemAssigned" - 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_disk_encryption_sets_operations.py index 851fe4b1c19b..78bc7cc404c5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_disk_encryption_sets_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.DiskEncryptionSet" cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('DiskEncryptionSet', pipeline_response) @@ -112,17 +112,17 @@ def begin_create_or_update( disk_encryption_set, # type: "models.DiskEncryptionSet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. + encryption set operation. :type disk_encryption_set: ~azure.mgmt.compute.v2019_11_01.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. @@ -183,10 +183,13 @@ def _update_initial( ): # type: (...) -> "models.DiskEncryptionSet" cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -204,14 +207,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -219,7 +220,6 @@ def _update_initial( 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('DiskEncryptionSet', pipeline_response) @@ -239,17 +239,17 @@ def begin_update( disk_encryption_set, # type: "models.DiskEncryptionSetUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. + encryption set operation. :type disk_encryption_set: ~azure.mgmt.compute.v2019_11_01.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. @@ -322,9 +322,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -341,9 +344,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -368,9 +370,12 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -387,8 +392,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -408,14 +413,14 @@ def begin_delete( disk_encryption_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. @@ -479,11 +484,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSetList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" + 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 @@ -496,15 +508,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -544,11 +552,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSetList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" + 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 @@ -560,15 +575,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_disks_operations.py index def5d38feb8f..a3e2faf627a3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_disks_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.Disk" cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('Disk', pipeline_response) @@ -112,14 +112,14 @@ def begin_create_or_update( disk, # type: "models.Disk" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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.v2019_11_01.models.Disk @@ -182,10 +182,13 @@ def _update_initial( ): # type: (...) -> "models.Disk" cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -203,14 +206,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -218,7 +219,6 @@ def _update_initial( 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('Disk', pipeline_response) @@ -238,14 +238,14 @@ def begin_update( disk, # type: "models.DiskUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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.v2019_11_01.models.DiskUpdate @@ -320,9 +320,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -339,9 +342,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -366,7 +368,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -386,7 +390,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -406,14 +409,14 @@ def begin_delete( disk_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. @@ -477,11 +480,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" + 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 @@ -494,15 +504,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -542,11 +548,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" + 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 @@ -558,15 +571,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -600,12 +609,15 @@ def _grant_access_initial( grant_access_data, # type: "models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> "models.AccessUri" - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # 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 = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._grant_access_initial.metadata['url'] # type: ignore @@ -623,14 +635,12 @@ def _grant_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -655,17 +665,17 @@ def begin_grant_access( grant_access_data, # type: "models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. + operation. :type grant_access_data: ~azure.mgmt.compute.v2019_11_01.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. @@ -725,7 +735,9 @@ def _revoke_access_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -745,7 +757,6 @@ def _revoke_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -765,14 +776,14 @@ def begin_revoke_access( disk_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_snapshots_operations.py index 29fbb45bd5ae..765675d7210d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_snapshots_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.Snapshot" cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('Snapshot', pipeline_response) @@ -112,14 +112,14 @@ def begin_create_or_update( snapshot, # type: "models.Snapshot" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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.v2019_11_01.models.Snapshot @@ -182,10 +182,13 @@ def _update_initial( ): # type: (...) -> "models.Snapshot" cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -203,14 +206,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -218,7 +219,6 @@ def _update_initial( 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('Snapshot', pipeline_response) @@ -238,14 +238,14 @@ def begin_update( snapshot, # type: "models.SnapshotUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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.v2019_11_01.models.SnapshotUpdate @@ -320,9 +320,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -339,9 +342,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -366,7 +368,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -386,7 +390,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -406,14 +409,14 @@ def begin_delete( snapshot_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. @@ -477,11 +480,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" + 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 @@ -494,15 +504,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -542,11 +548,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" + 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 @@ -558,15 +571,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -600,12 +609,15 @@ def _grant_access_initial( grant_access_data, # type: "models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> "models.AccessUri" - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # 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 = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._grant_access_initial.metadata['url'] # type: ignore @@ -623,14 +635,12 @@ def _grant_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -655,17 +665,17 @@ def begin_grant_access( grant_access_data, # type: "models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. + operation. :type grant_access_data: ~azure.mgmt.compute.v2019_11_01.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. @@ -725,7 +735,9 @@ def _revoke_access_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -745,7 +757,6 @@ def _revoke_access_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -765,14 +776,14 @@ def begin_revoke_access( snapshot_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. + 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. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/__init__.py index 20a4019e9c23..cdc7f7a1709a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/__init__.py @@ -10,7 +10,7 @@ __all__ = ['ComputeManagementClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass 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 0865646e071e..249869d97f82 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,6 +122,7 @@ 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/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_configuration.py index 13be80c59acf..af0e285dd89f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -47,8 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2019-12-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-compute/{}'.format(VERSION)) self._configure(**kwargs) @@ -61,6 +61,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) 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 13b4a2ea1628..6c2c2101a7f8 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 @@ -4,7 +4,11 @@ "client": { "name": "ComputeManagementClient", "filename": "_compute_management_client", - "description": "Compute Client." + "description": "Compute Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true }, "global_parameters": { "sync_method": { @@ -41,7 +45,10 @@ }, "config": { "credential": true, - "credential_scopes": ["https://management.azure.com/.default"] + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null }, "operation_groups": { "operations": "Operations", diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/__init__.py index c8a8b4817269..9e9459635989 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._compute_management_client_async import ComputeManagementClient +from ._compute_management_client import ComputeManagementClient __all__ = ['ComputeManagementClient'] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/_compute_management_client_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/_compute_management_client.py similarity index 76% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/_compute_management_client_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/_compute_management_client.py index a337feab9d2b..8fca3e525bf8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/_compute_management_client_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/_compute_management_client.py @@ -15,32 +15,32 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration_async import ComputeManagementClientConfiguration -from .operations_async import Operations -from .operations_async import AvailabilitySetsOperations -from .operations_async import ProximityPlacementGroupsOperations -from .operations_async import DedicatedHostGroupsOperations -from .operations_async import DedicatedHostsOperations -from .operations_async import SshPublicKeysOperations -from .operations_async import VirtualMachineExtensionImagesOperations -from .operations_async import VirtualMachineExtensionsOperations -from .operations_async import VirtualMachineImagesOperations -from .operations_async import UsageOperations -from .operations_async import VirtualMachinesOperations -from .operations_async import VirtualMachineSizesOperations -from .operations_async import ImagesOperations -from .operations_async import VirtualMachineScaleSetsOperations -from .operations_async import VirtualMachineScaleSetExtensionsOperations -from .operations_async import VirtualMachineScaleSetRollingUpgradesOperations -from .operations_async import VirtualMachineScaleSetVMExtensionsOperations -from .operations_async import VirtualMachineScaleSetVMsOperations -from .operations_async import LogAnalyticsOperations -from .operations_async import VirtualMachineRunCommandsOperations -from .operations_async import GalleriesOperations -from .operations_async import GalleryImagesOperations -from .operations_async import GalleryImageVersionsOperations -from .operations_async import GalleryApplicationsOperations -from .operations_async import GalleryApplicationVersionsOperations +from ._configuration import ComputeManagementClientConfiguration +from .operations import Operations +from .operations import AvailabilitySetsOperations +from .operations import ProximityPlacementGroupsOperations +from .operations import DedicatedHostGroupsOperations +from .operations import DedicatedHostsOperations +from .operations import SshPublicKeysOperations +from .operations import VirtualMachineExtensionImagesOperations +from .operations import VirtualMachineExtensionsOperations +from .operations import VirtualMachineImagesOperations +from .operations import UsageOperations +from .operations import VirtualMachinesOperations +from .operations import VirtualMachineSizesOperations +from .operations import ImagesOperations +from .operations import VirtualMachineScaleSetsOperations +from .operations import VirtualMachineScaleSetExtensionsOperations +from .operations import VirtualMachineScaleSetRollingUpgradesOperations +from .operations import VirtualMachineScaleSetVMExtensionsOperations +from .operations import VirtualMachineScaleSetVMsOperations +from .operations import LogAnalyticsOperations +from .operations import VirtualMachineRunCommandsOperations +from .operations import GalleriesOperations +from .operations import GalleryImagesOperations +from .operations import GalleryImageVersionsOperations +from .operations import GalleryApplicationsOperations +from .operations import GalleryApplicationVersionsOperations from .. import models @@ -48,55 +48,55 @@ class ComputeManagementClient(object): """Compute Client. :ivar operations: Operations operations - :vartype operations: azure.mgmt.compute.v2019_12_01.aio.operations_async.Operations + :vartype operations: azure.mgmt.compute.v2019_12_01.aio.operations.Operations :ivar availability_sets: AvailabilitySetsOperations operations - :vartype availability_sets: azure.mgmt.compute.v2019_12_01.aio.operations_async.AvailabilitySetsOperations + :vartype availability_sets: azure.mgmt.compute.v2019_12_01.aio.operations.AvailabilitySetsOperations :ivar proximity_placement_groups: ProximityPlacementGroupsOperations operations - :vartype proximity_placement_groups: azure.mgmt.compute.v2019_12_01.aio.operations_async.ProximityPlacementGroupsOperations + :vartype proximity_placement_groups: azure.mgmt.compute.v2019_12_01.aio.operations.ProximityPlacementGroupsOperations :ivar dedicated_host_groups: DedicatedHostGroupsOperations operations - :vartype dedicated_host_groups: azure.mgmt.compute.v2019_12_01.aio.operations_async.DedicatedHostGroupsOperations + :vartype dedicated_host_groups: azure.mgmt.compute.v2019_12_01.aio.operations.DedicatedHostGroupsOperations :ivar dedicated_hosts: DedicatedHostsOperations operations - :vartype dedicated_hosts: azure.mgmt.compute.v2019_12_01.aio.operations_async.DedicatedHostsOperations + :vartype dedicated_hosts: azure.mgmt.compute.v2019_12_01.aio.operations.DedicatedHostsOperations :ivar ssh_public_keys: SshPublicKeysOperations operations - :vartype ssh_public_keys: azure.mgmt.compute.v2019_12_01.aio.operations_async.SshPublicKeysOperations + :vartype ssh_public_keys: azure.mgmt.compute.v2019_12_01.aio.operations.SshPublicKeysOperations :ivar virtual_machine_extension_images: VirtualMachineExtensionImagesOperations operations - :vartype virtual_machine_extension_images: azure.mgmt.compute.v2019_12_01.aio.operations_async.VirtualMachineExtensionImagesOperations + :vartype virtual_machine_extension_images: azure.mgmt.compute.v2019_12_01.aio.operations.VirtualMachineExtensionImagesOperations :ivar virtual_machine_extensions: VirtualMachineExtensionsOperations operations - :vartype virtual_machine_extensions: azure.mgmt.compute.v2019_12_01.aio.operations_async.VirtualMachineExtensionsOperations + :vartype virtual_machine_extensions: azure.mgmt.compute.v2019_12_01.aio.operations.VirtualMachineExtensionsOperations :ivar virtual_machine_images: VirtualMachineImagesOperations operations - :vartype virtual_machine_images: azure.mgmt.compute.v2019_12_01.aio.operations_async.VirtualMachineImagesOperations + :vartype virtual_machine_images: azure.mgmt.compute.v2019_12_01.aio.operations.VirtualMachineImagesOperations :ivar usage: UsageOperations operations - :vartype usage: azure.mgmt.compute.v2019_12_01.aio.operations_async.UsageOperations + :vartype usage: azure.mgmt.compute.v2019_12_01.aio.operations.UsageOperations :ivar virtual_machines: VirtualMachinesOperations operations - :vartype virtual_machines: azure.mgmt.compute.v2019_12_01.aio.operations_async.VirtualMachinesOperations + :vartype virtual_machines: azure.mgmt.compute.v2019_12_01.aio.operations.VirtualMachinesOperations :ivar virtual_machine_sizes: VirtualMachineSizesOperations operations - :vartype virtual_machine_sizes: azure.mgmt.compute.v2019_12_01.aio.operations_async.VirtualMachineSizesOperations + :vartype virtual_machine_sizes: azure.mgmt.compute.v2019_12_01.aio.operations.VirtualMachineSizesOperations :ivar images: ImagesOperations operations - :vartype images: azure.mgmt.compute.v2019_12_01.aio.operations_async.ImagesOperations + :vartype images: azure.mgmt.compute.v2019_12_01.aio.operations.ImagesOperations :ivar virtual_machine_scale_sets: VirtualMachineScaleSetsOperations operations - :vartype virtual_machine_scale_sets: azure.mgmt.compute.v2019_12_01.aio.operations_async.VirtualMachineScaleSetsOperations + :vartype virtual_machine_scale_sets: azure.mgmt.compute.v2019_12_01.aio.operations.VirtualMachineScaleSetsOperations :ivar virtual_machine_scale_set_extensions: VirtualMachineScaleSetExtensionsOperations operations - :vartype virtual_machine_scale_set_extensions: azure.mgmt.compute.v2019_12_01.aio.operations_async.VirtualMachineScaleSetExtensionsOperations + :vartype virtual_machine_scale_set_extensions: azure.mgmt.compute.v2019_12_01.aio.operations.VirtualMachineScaleSetExtensionsOperations :ivar virtual_machine_scale_set_rolling_upgrades: VirtualMachineScaleSetRollingUpgradesOperations operations - :vartype virtual_machine_scale_set_rolling_upgrades: azure.mgmt.compute.v2019_12_01.aio.operations_async.VirtualMachineScaleSetRollingUpgradesOperations + :vartype virtual_machine_scale_set_rolling_upgrades: azure.mgmt.compute.v2019_12_01.aio.operations.VirtualMachineScaleSetRollingUpgradesOperations :ivar virtual_machine_scale_set_vm_extensions: VirtualMachineScaleSetVMExtensionsOperations operations - :vartype virtual_machine_scale_set_vm_extensions: azure.mgmt.compute.v2019_12_01.aio.operations_async.VirtualMachineScaleSetVMExtensionsOperations + :vartype virtual_machine_scale_set_vm_extensions: azure.mgmt.compute.v2019_12_01.aio.operations.VirtualMachineScaleSetVMExtensionsOperations :ivar virtual_machine_scale_set_vms: VirtualMachineScaleSetVMsOperations operations - :vartype virtual_machine_scale_set_vms: azure.mgmt.compute.v2019_12_01.aio.operations_async.VirtualMachineScaleSetVMsOperations + :vartype virtual_machine_scale_set_vms: azure.mgmt.compute.v2019_12_01.aio.operations.VirtualMachineScaleSetVMsOperations :ivar log_analytics: LogAnalyticsOperations operations - :vartype log_analytics: azure.mgmt.compute.v2019_12_01.aio.operations_async.LogAnalyticsOperations + :vartype log_analytics: azure.mgmt.compute.v2019_12_01.aio.operations.LogAnalyticsOperations :ivar virtual_machine_run_commands: VirtualMachineRunCommandsOperations operations - :vartype virtual_machine_run_commands: azure.mgmt.compute.v2019_12_01.aio.operations_async.VirtualMachineRunCommandsOperations + :vartype virtual_machine_run_commands: azure.mgmt.compute.v2019_12_01.aio.operations.VirtualMachineRunCommandsOperations :ivar galleries: GalleriesOperations operations - :vartype galleries: azure.mgmt.compute.v2019_12_01.aio.operations_async.GalleriesOperations + :vartype galleries: azure.mgmt.compute.v2019_12_01.aio.operations.GalleriesOperations :ivar gallery_images: GalleryImagesOperations operations - :vartype gallery_images: azure.mgmt.compute.v2019_12_01.aio.operations_async.GalleryImagesOperations + :vartype gallery_images: azure.mgmt.compute.v2019_12_01.aio.operations.GalleryImagesOperations :ivar gallery_image_versions: GalleryImageVersionsOperations operations - :vartype gallery_image_versions: azure.mgmt.compute.v2019_12_01.aio.operations_async.GalleryImageVersionsOperations + :vartype gallery_image_versions: azure.mgmt.compute.v2019_12_01.aio.operations.GalleryImageVersionsOperations :ivar gallery_applications: GalleryApplicationsOperations operations - :vartype gallery_applications: azure.mgmt.compute.v2019_12_01.aio.operations_async.GalleryApplicationsOperations + :vartype gallery_applications: azure.mgmt.compute.v2019_12_01.aio.operations.GalleryApplicationsOperations :ivar gallery_application_versions: GalleryApplicationVersionsOperations operations - :vartype gallery_application_versions: azure.mgmt.compute.v2019_12_01.aio.operations_async.GalleryApplicationVersionsOperations + :vartype gallery_application_versions: azure.mgmt.compute.v2019_12_01.aio.operations.GalleryApplicationVersionsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. @@ -119,6 +119,7 @@ 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/aio/_configuration_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/_configuration.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/_configuration_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/_configuration.py index 13ae5fd95c7f..71ba8b9eb38a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/_configuration_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -44,8 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2019-12-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-compute/{}'.format(VERSION)) self._configure(**kwargs) @@ -57,6 +57,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/__init__.py new file mode 100644 index 000000000000..7d409a1b87d4 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/__init__.py @@ -0,0 +1,61 @@ +# 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 ._operations import Operations +from ._availability_sets_operations import AvailabilitySetsOperations +from ._proximity_placement_groups_operations import ProximityPlacementGroupsOperations +from ._dedicated_host_groups_operations import DedicatedHostGroupsOperations +from ._dedicated_hosts_operations import DedicatedHostsOperations +from ._ssh_public_keys_operations import SshPublicKeysOperations +from ._virtual_machine_extension_images_operations import VirtualMachineExtensionImagesOperations +from ._virtual_machine_extensions_operations import VirtualMachineExtensionsOperations +from ._virtual_machine_images_operations import VirtualMachineImagesOperations +from ._usage_operations import UsageOperations +from ._virtual_machines_operations import VirtualMachinesOperations +from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations +from ._images_operations import ImagesOperations +from ._virtual_machine_scale_sets_operations import VirtualMachineScaleSetsOperations +from ._virtual_machine_scale_set_extensions_operations import VirtualMachineScaleSetExtensionsOperations +from ._virtual_machine_scale_set_rolling_upgrades_operations import VirtualMachineScaleSetRollingUpgradesOperations +from ._virtual_machine_scale_set_vm_extensions_operations import VirtualMachineScaleSetVMExtensionsOperations +from ._virtual_machine_scale_set_vms_operations import VirtualMachineScaleSetVMsOperations +from ._log_analytics_operations import LogAnalyticsOperations +from ._virtual_machine_run_commands_operations import VirtualMachineRunCommandsOperations +from ._galleries_operations import GalleriesOperations +from ._gallery_images_operations import GalleryImagesOperations +from ._gallery_image_versions_operations import GalleryImageVersionsOperations +from ._gallery_applications_operations import GalleryApplicationsOperations +from ._gallery_application_versions_operations import GalleryApplicationVersionsOperations + +__all__ = [ + 'Operations', + 'AvailabilitySetsOperations', + 'ProximityPlacementGroupsOperations', + 'DedicatedHostGroupsOperations', + 'DedicatedHostsOperations', + 'SshPublicKeysOperations', + 'VirtualMachineExtensionImagesOperations', + 'VirtualMachineExtensionsOperations', + 'VirtualMachineImagesOperations', + 'UsageOperations', + 'VirtualMachinesOperations', + 'VirtualMachineSizesOperations', + 'ImagesOperations', + 'VirtualMachineScaleSetsOperations', + 'VirtualMachineScaleSetExtensionsOperations', + 'VirtualMachineScaleSetRollingUpgradesOperations', + 'VirtualMachineScaleSetVMExtensionsOperations', + 'VirtualMachineScaleSetVMsOperations', + 'LogAnalyticsOperations', + 'VirtualMachineRunCommandsOperations', + 'GalleriesOperations', + 'GalleryImagesOperations', + 'GalleryImageVersionsOperations', + 'GalleryApplicationsOperations', + 'GalleryApplicationVersionsOperations', +] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_availability_sets_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_availability_sets_operations.py similarity index 90% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_availability_sets_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_availability_sets_operations.py index 1b17e3b88b60..82b7a225caa2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_availability_sets_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_availability_sets_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -62,10 +62,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -83,14 +86,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailabilitySet') 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 @@ -127,10 +128,13 @@ async def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -148,14 +152,12 @@ async def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailabilitySetUpdate') 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 @@ -189,7 +191,9 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -209,7 +213,6 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -241,9 +244,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -260,9 +266,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -286,7 +291,8 @@ def list_by_subscription( ) -> AsyncIterable["models.AvailabilitySetListResult"]: """Lists all availability sets in a subscription. - :param expand: The expand expression to apply to the operation. + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AvailabilitySetListResult or the result of cls(response) @@ -294,11 +300,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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_subscription.metadata['url'] # type: ignore @@ -312,15 +325,11 @@ def prepare_request(next_link=None): if expand is not None: query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -362,11 +371,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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 @@ -379,15 +395,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -421,7 +433,7 @@ def list_available_sizes( **kwargs ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes that can be used to create a new virtual machine in - an existing availability set. + an existing availability set. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -433,11 +445,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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_available_sizes.metadata['url'] # type: ignore @@ -451,15 +470,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_dedicated_host_groups_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_dedicated_host_groups_operations.py similarity index 90% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_dedicated_host_groups_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_dedicated_host_groups_operations.py index dfc3c8f6309b..6082a287af0d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_dedicated_host_groups_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_dedicated_host_groups_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -64,10 +64,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -85,14 +88,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DedicatedHostGroup') 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 @@ -100,7 +101,6 @@ async def create_or_update( 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('DedicatedHostGroup', pipeline_response) @@ -134,10 +134,13 @@ async def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -155,14 +158,12 @@ async def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DedicatedHostGroupUpdate') 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 @@ -196,7 +197,9 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -216,7 +219,6 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -248,9 +250,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -267,9 +272,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -292,7 +296,7 @@ def list_by_resource_group( **kwargs ) -> AsyncIterable["models.DedicatedHostGroupListResult"]: """Lists all of the dedicated host groups in the specified resource group. Use the nextLink - property in the response to get the next page of dedicated host groups. + property in the response to get the next page of dedicated host groups. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -302,11 +306,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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 @@ -319,15 +330,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -359,7 +366,7 @@ def list_by_subscription( **kwargs ) -> AsyncIterable["models.DedicatedHostGroupListResult"]: """Lists all of the dedicated host groups in the subscription. Use the nextLink property in the - response to get the next page of dedicated host groups. + response to get the next page of dedicated host groups. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DedicatedHostGroupListResult or the result of cls(response) @@ -367,11 +374,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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_subscription.metadata['url'] # type: ignore @@ -383,15 +397,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_dedicated_hosts_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_dedicated_hosts_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_dedicated_hosts_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_dedicated_hosts_operations.py index 542d54981849..c4dff56e9609 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_dedicated_hosts_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_dedicated_hosts_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,10 +52,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.DedicatedHost": cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -74,14 +77,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DedicatedHost') 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 @@ -89,7 +90,6 @@ async def _create_or_update_initial( 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('DedicatedHost', pipeline_response) @@ -109,7 +109,7 @@ async def begin_create_or_update( host_name: str, parameters: "models.DedicatedHost", **kwargs - ) -> "models.DedicatedHost": + ) -> AsyncLROPoller["models.DedicatedHost"]: """Create or update a dedicated host . :param resource_group_name: The name of the resource group. @@ -126,8 +126,8 @@ async def begin_create_or_update( 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: DedicatedHost, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_12_01.models.DedicatedHost + :return: An instance of AsyncLROPoller that returns either DedicatedHost or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_12_01.models.DedicatedHost] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -180,10 +180,13 @@ async def _update_initial( **kwargs ) -> "models.DedicatedHost": cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -202,14 +205,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DedicatedHostUpdate') 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 @@ -232,7 +233,7 @@ async def begin_update( host_name: str, parameters: "models.DedicatedHostUpdate", **kwargs - ) -> "models.DedicatedHost": + ) -> AsyncLROPoller["models.DedicatedHost"]: """Update an dedicated host . :param resource_group_name: The name of the resource group. @@ -249,8 +250,8 @@ async def begin_update( 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: DedicatedHost, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_12_01.models.DedicatedHost + :return: An instance of AsyncLROPoller that returns either DedicatedHost or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_12_01.models.DedicatedHost] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -302,7 +303,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -323,7 +326,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -343,7 +345,7 @@ async def begin_delete( host_group_name: str, host_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Delete a dedicated host. :param resource_group_name: The name of the resource group. @@ -358,8 +360,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -423,9 +425,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -445,9 +450,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -471,7 +475,7 @@ def list_by_host_group( **kwargs ) -> AsyncIterable["models.DedicatedHostListResult"]: """Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink - property in the response to get the next page of dedicated hosts. + property in the response to get the next page of dedicated hosts. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -483,11 +487,18 @@ def list_by_host_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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_host_group.metadata['url'] # type: ignore @@ -501,15 +512,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_galleries_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_galleries_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_galleries_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_galleries_operations.py index 8c6ac4b8934f..66fc4d936d28 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_galleries_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_galleries_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.Gallery": cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery, 'Gallery') 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('Gallery', pipeline_response) @@ -109,13 +109,13 @@ async def begin_create_or_update( gallery_name: str, gallery: "models.Gallery", **kwargs - ) -> "models.Gallery": + ) -> AsyncLROPoller["models.Gallery"]: """Create or update a Shared Image Gallery. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery. The allowed characters are alphabets - and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. + and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. :type gallery_name: str :param gallery: Parameters supplied to the create or update Shared Image Gallery operation. :type gallery: ~azure.mgmt.compute.v2019_12_01.models.Gallery @@ -125,8 +125,8 @@ async def begin_create_or_update( 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: Gallery, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_12_01.models.Gallery + :return: An instance of AsyncLROPoller that returns either Gallery or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_12_01.models.Gallery] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -177,10 +177,13 @@ async def _update_initial( **kwargs ) -> "models.Gallery": cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -198,14 +201,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery, 'GalleryUpdate') 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 @@ -227,13 +228,13 @@ async def begin_update( gallery_name: str, gallery: "models.GalleryUpdate", **kwargs - ) -> "models.Gallery": + ) -> AsyncLROPoller["models.Gallery"]: """Update a Shared Image Gallery. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery. The allowed characters are alphabets - and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. + and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. :type gallery_name: str :param gallery: Parameters supplied to the update Shared Image Gallery operation. :type gallery: ~azure.mgmt.compute.v2019_12_01.models.GalleryUpdate @@ -243,8 +244,8 @@ async def begin_update( 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: Gallery, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_12_01.models.Gallery + :return: An instance of AsyncLROPoller that returns either Gallery or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_12_01.models.Gallery] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -305,9 +306,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -324,9 +328,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -350,9 +353,12 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -369,8 +375,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -389,7 +395,7 @@ async def begin_delete( resource_group_name: str, gallery_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Delete a Shared Image Gallery. :param resource_group_name: The name of the resource group. @@ -402,8 +408,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -457,11 +463,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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 @@ -474,15 +487,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -521,11 +530,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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 @@ -537,15 +553,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_gallery_application_versions_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_application_versions_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_gallery_application_versions_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_application_versions_operations.py index 48e122365482..ca72440b852d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_gallery_application_versions_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_application_versions_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -53,10 +53,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.GalleryApplicationVersion": cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -76,14 +79,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_application_version, 'GalleryApplicationVersion') 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 @@ -91,7 +92,6 @@ async def _create_or_update_initial( 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('GalleryApplicationVersion', pipeline_response) @@ -115,24 +115,24 @@ async def begin_create_or_update( gallery_application_version_name: str, gallery_application_version: "models.GalleryApplicationVersion", **kwargs - ) -> "models.GalleryApplicationVersion": + ) -> AsyncLROPoller["models.GalleryApplicationVersion"]: """Create or update a gallery Application Version. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. + Definition resides. :type gallery_name: str :param gallery_application_name: The name of the gallery Application Definition in which the - Application Version is to be created. + Application Version is to be created. :type gallery_application_name: str :param gallery_application_version_name: The name of the gallery Application Version to be - created. Needs to follow semantic version name pattern: The allowed characters are digit and - period. Digits must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. + created. Needs to follow semantic version name pattern: The allowed characters are digit and + period. Digits must be within the range of a 32-bit integer. Format: + :code:``.:code:``.:code:``. :type gallery_application_version_name: str :param gallery_application_version: Parameters supplied to the create or update gallery - Application Version operation. + Application Version operation. :type gallery_application_version: ~azure.mgmt.compute.v2019_12_01.models.GalleryApplicationVersion :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. @@ -140,8 +140,8 @@ async def begin_create_or_update( 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: GalleryApplicationVersion, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_12_01.models.GalleryApplicationVersion + :return: An instance of AsyncLROPoller that returns either GalleryApplicationVersion or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_12_01.models.GalleryApplicationVersion] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -196,10 +196,13 @@ async def _update_initial( **kwargs ) -> "models.GalleryApplicationVersion": cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -219,14 +222,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_application_version, 'GalleryApplicationVersionUpdate') 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 @@ -250,24 +251,24 @@ async def begin_update( gallery_application_version_name: str, gallery_application_version: "models.GalleryApplicationVersionUpdate", **kwargs - ) -> "models.GalleryApplicationVersion": + ) -> AsyncLROPoller["models.GalleryApplicationVersion"]: """Update a gallery Application Version. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. + Definition resides. :type gallery_name: str :param gallery_application_name: The name of the gallery Application Definition in which the - Application Version is to be updated. + Application Version is to be updated. :type gallery_application_name: str :param gallery_application_version_name: The name of the gallery Application Version to be - updated. Needs to follow semantic version name pattern: The allowed characters are digit and - period. Digits must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. + updated. Needs to follow semantic version name pattern: The allowed characters are digit and + period. Digits must be within the range of a 32-bit integer. Format: + :code:``.:code:``.:code:``. :type gallery_application_version_name: str :param gallery_application_version: Parameters supplied to the update gallery Application - Version operation. + Version operation. :type gallery_application_version: ~azure.mgmt.compute.v2019_12_01.models.GalleryApplicationVersionUpdate :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. @@ -275,8 +276,8 @@ async def begin_update( 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: GalleryApplicationVersion, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_12_01.models.GalleryApplicationVersion + :return: An instance of AsyncLROPoller that returns either GalleryApplicationVersion or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_12_01.models.GalleryApplicationVersion] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -327,7 +328,7 @@ async def get( gallery_name: str, gallery_application_name: str, gallery_application_version_name: str, - expand: Optional[str] = "ReplicationStatus", + expand: Optional[Union[str, "models.ReplicationStatusTypes"]] = None, **kwargs ) -> "models.GalleryApplicationVersion": """Retrieves information about a gallery Application Version. @@ -344,16 +345,19 @@ async def get( retrieved. :type gallery_application_version_name: str :param expand: The expand expression to apply on the operation. - :type expand: str + :type expand: str or ~azure.mgmt.compute.v2019_12_01.models.ReplicationStatusTypes :keyword callable cls: A custom type or function that will be passed the direct response :return: GalleryApplicationVersion, or the result of cls(response) :rtype: ~azure.mgmt.compute.v2019_12_01.models.GalleryApplicationVersion :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -374,9 +378,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -402,9 +405,12 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -423,8 +429,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -445,19 +451,19 @@ async def begin_delete( gallery_application_name: str, gallery_application_version_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Delete a gallery Application Version. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. + Definition resides. :type gallery_name: str :param gallery_application_name: The name of the gallery Application Definition in which the - Application Version resides. + Application Version resides. :type gallery_application_name: str :param gallery_application_version_name: The name of the gallery Application Version to be - deleted. + deleted. :type gallery_application_version_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. @@ -465,8 +471,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -519,10 +525,10 @@ def list_by_gallery_application( :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. + Definition resides. :type gallery_name: str :param gallery_application_name: The name of the Shared Application Gallery Application - Definition from which the Application Versions are to be listed. + Definition from which the Application Versions are to be listed. :type gallery_application_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GalleryApplicationVersionList or the result of cls(response) @@ -530,11 +536,18 @@ def list_by_gallery_application( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersionList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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_gallery_application.metadata['url'] # type: ignore @@ -549,15 +562,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_gallery_applications_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_applications_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_gallery_applications_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_applications_operations.py index bc8d933649f6..59e2d991e8ae 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_gallery_applications_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_applications_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,10 +52,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.GalleryApplication": cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -74,14 +77,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_application, 'GalleryApplication') 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 @@ -89,7 +90,6 @@ async def _create_or_update_initial( 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('GalleryApplication', pipeline_response) @@ -112,20 +112,20 @@ async def begin_create_or_update( gallery_application_name: str, gallery_application: "models.GalleryApplication", **kwargs - ) -> "models.GalleryApplication": + ) -> AsyncLROPoller["models.GalleryApplication"]: """Create or update a gallery Application Definition. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition is to be created. + Definition is to be created. :type gallery_name: str :param gallery_application_name: The name of the gallery Application Definition to be created - or updated. The allowed characters are alphabets and numbers with dots, dashes, and periods - allowed in the middle. The maximum length is 80 characters. + or updated. The allowed characters are alphabets and numbers with dots, dashes, and periods + allowed in the middle. The maximum length is 80 characters. :type gallery_application_name: str :param gallery_application: Parameters supplied to the create or update gallery Application - operation. + operation. :type gallery_application: ~azure.mgmt.compute.v2019_12_01.models.GalleryApplication :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. @@ -133,8 +133,8 @@ async def begin_create_or_update( 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: GalleryApplication, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_12_01.models.GalleryApplication + :return: An instance of AsyncLROPoller that returns either GalleryApplication or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_12_01.models.GalleryApplication] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -187,10 +187,13 @@ async def _update_initial( **kwargs ) -> "models.GalleryApplication": cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -209,14 +212,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_application, 'GalleryApplicationUpdate') 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 @@ -239,17 +240,17 @@ async def begin_update( gallery_application_name: str, gallery_application: "models.GalleryApplicationUpdate", **kwargs - ) -> "models.GalleryApplication": + ) -> AsyncLROPoller["models.GalleryApplication"]: """Update a gallery Application Definition. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition is to be updated. + Definition is to be updated. :type gallery_name: str :param gallery_application_name: The name of the gallery Application Definition to be updated. - The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the - middle. The maximum length is 80 characters. + The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the + middle. The maximum length is 80 characters. :type gallery_application_name: str :param gallery_application: Parameters supplied to the update gallery Application operation. :type gallery_application: ~azure.mgmt.compute.v2019_12_01.models.GalleryApplicationUpdate @@ -259,8 +260,8 @@ async def begin_update( 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: GalleryApplication, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_12_01.models.GalleryApplication + :return: An instance of AsyncLROPoller that returns either GalleryApplication or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_12_01.models.GalleryApplication] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -327,9 +328,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -347,9 +351,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -374,9 +377,12 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -394,8 +400,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -415,13 +421,13 @@ async def begin_delete( gallery_name: str, gallery_application_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Delete a gallery Application. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition is to be deleted. + Definition is to be deleted. :type gallery_name: str :param gallery_application_name: The name of the gallery Application Definition to be deleted. :type gallery_application_name: str @@ -431,8 +437,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -483,7 +489,7 @@ def list_by_gallery( :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery from which Application - Definitions are to be listed. + Definitions are to be listed. :type gallery_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GalleryApplicationList or the result of cls(response) @@ -491,11 +497,18 @@ def list_by_gallery( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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_gallery.metadata['url'] # type: ignore @@ -509,15 +522,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_gallery_image_versions_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_image_versions_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_gallery_image_versions_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_image_versions_operations.py index cd9cef0018fd..33be1bea99c8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_gallery_image_versions_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_image_versions_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -53,10 +53,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.GalleryImageVersion": cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -76,14 +79,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_image_version, 'GalleryImageVersion') 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 @@ -91,7 +92,6 @@ async def _create_or_update_initial( 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('GalleryImageVersion', pipeline_response) @@ -115,24 +115,24 @@ async def begin_create_or_update( gallery_image_version_name: str, gallery_image_version: "models.GalleryImageVersion", **kwargs - ) -> "models.GalleryImageVersion": + ) -> AsyncLROPoller["models.GalleryImageVersion"]: """Create or update a gallery Image Version. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. + resides. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition in which the Image Version - is to be created. + is to be created. :type gallery_image_name: str :param gallery_image_version_name: The name of the gallery Image Version to be created. Needs - to follow semantic version name pattern: The allowed characters are digit and period. Digits - must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. + to follow semantic version name pattern: The allowed characters are digit and period. Digits + must be within the range of a 32-bit integer. Format: + :code:``.:code:``.:code:``. :type gallery_image_version_name: str :param gallery_image_version: Parameters supplied to the create or update gallery Image Version - operation. + operation. :type gallery_image_version: ~azure.mgmt.compute.v2019_12_01.models.GalleryImageVersion :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. @@ -140,8 +140,8 @@ async def begin_create_or_update( 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: GalleryImageVersion, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_12_01.models.GalleryImageVersion + :return: An instance of AsyncLROPoller that returns either GalleryImageVersion or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_12_01.models.GalleryImageVersion] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -196,10 +196,13 @@ async def _update_initial( **kwargs ) -> "models.GalleryImageVersion": cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -219,14 +222,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_image_version, 'GalleryImageVersionUpdate') 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 @@ -250,24 +251,24 @@ async def begin_update( gallery_image_version_name: str, gallery_image_version: "models.GalleryImageVersionUpdate", **kwargs - ) -> "models.GalleryImageVersion": + ) -> AsyncLROPoller["models.GalleryImageVersion"]: """Update a gallery Image Version. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. + resides. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition in which the Image Version - is to be updated. + is to be updated. :type gallery_image_name: str :param gallery_image_version_name: The name of the gallery Image Version to be updated. Needs - to follow semantic version name pattern: The allowed characters are digit and period. Digits - must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. + to follow semantic version name pattern: The allowed characters are digit and period. Digits + must be within the range of a 32-bit integer. Format: + :code:``.:code:``.:code:``. :type gallery_image_version_name: str :param gallery_image_version: Parameters supplied to the update gallery Image Version - operation. + operation. :type gallery_image_version: ~azure.mgmt.compute.v2019_12_01.models.GalleryImageVersionUpdate :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. @@ -275,8 +276,8 @@ async def begin_update( 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: GalleryImageVersion, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_12_01.models.GalleryImageVersion + :return: An instance of AsyncLROPoller that returns either GalleryImageVersion or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_12_01.models.GalleryImageVersion] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -327,7 +328,7 @@ async def get( gallery_name: str, gallery_image_name: str, gallery_image_version_name: str, - expand: Optional[str] = "ReplicationStatus", + expand: Optional[Union[str, "models.ReplicationStatusTypes"]] = None, **kwargs ) -> "models.GalleryImageVersion": """Retrieves information about a gallery Image Version. @@ -343,16 +344,19 @@ async def get( :param gallery_image_version_name: The name of the gallery Image Version to be retrieved. :type gallery_image_version_name: str :param expand: The expand expression to apply on the operation. - :type expand: str + :type expand: str or ~azure.mgmt.compute.v2019_12_01.models.ReplicationStatusTypes :keyword callable cls: A custom type or function that will be passed the direct response :return: GalleryImageVersion, or the result of cls(response) :rtype: ~azure.mgmt.compute.v2019_12_01.models.GalleryImageVersion :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -373,9 +377,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -401,9 +404,12 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -422,8 +428,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -444,16 +450,16 @@ async def begin_delete( gallery_image_name: str, gallery_image_version_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Delete a gallery Image Version. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. + resides. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition in which the Image Version - resides. + resides. :type gallery_image_name: str :param gallery_image_version_name: The name of the gallery Image Version to be deleted. :type gallery_image_version_name: str @@ -463,8 +469,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -517,10 +523,10 @@ def list_by_gallery_image( :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. + resides. :type gallery_name: str :param gallery_image_name: The name of the Shared Image Gallery Image Definition from which the - Image Versions are to be listed. + Image Versions are to be listed. :type gallery_image_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GalleryImageVersionList or the result of cls(response) @@ -528,11 +534,18 @@ def list_by_gallery_image( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersionList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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_gallery_image.metadata['url'] # type: ignore @@ -547,15 +560,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_gallery_images_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_images_operations.py similarity index 90% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_gallery_images_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_images_operations.py index 0d27ae52b950..3e74e11216f9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_gallery_images_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_images_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,10 +52,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.GalleryImage": cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -74,14 +77,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_image, 'GalleryImage') 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 @@ -89,7 +90,6 @@ async def _create_or_update_initial( 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('GalleryImage', pipeline_response) @@ -112,17 +112,17 @@ async def begin_create_or_update( gallery_image_name: str, gallery_image: "models.GalleryImage", **kwargs - ) -> "models.GalleryImage": + ) -> AsyncLROPoller["models.GalleryImage"]: """Create or update a gallery Image Definition. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to - be created. + be created. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition to be created or updated. - The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the - middle. The maximum length is 80 characters. + The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the + middle. The maximum length is 80 characters. :type gallery_image_name: str :param gallery_image: Parameters supplied to the create or update gallery image operation. :type gallery_image: ~azure.mgmt.compute.v2019_12_01.models.GalleryImage @@ -132,8 +132,8 @@ async def begin_create_or_update( 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: GalleryImage, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_12_01.models.GalleryImage + :return: An instance of AsyncLROPoller that returns either GalleryImage or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_12_01.models.GalleryImage] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -186,10 +186,13 @@ async def _update_initial( **kwargs ) -> "models.GalleryImage": cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -208,14 +211,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_image, 'GalleryImageUpdate') 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 @@ -238,17 +239,17 @@ async def begin_update( gallery_image_name: str, gallery_image: "models.GalleryImageUpdate", **kwargs - ) -> "models.GalleryImage": + ) -> AsyncLROPoller["models.GalleryImage"]: """Update a gallery Image Definition. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to - be updated. + be updated. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition to be updated. The allowed - characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - maximum length is 80 characters. + characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The + maximum length is 80 characters. :type gallery_image_name: str :param gallery_image: Parameters supplied to the update gallery image operation. :type gallery_image: ~azure.mgmt.compute.v2019_12_01.models.GalleryImageUpdate @@ -258,8 +259,8 @@ async def begin_update( 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: GalleryImage, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_12_01.models.GalleryImage + :return: An instance of AsyncLROPoller that returns either GalleryImage or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_12_01.models.GalleryImage] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -325,9 +326,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -345,9 +349,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -372,9 +375,12 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -392,8 +398,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -413,13 +419,13 @@ async def begin_delete( gallery_name: str, gallery_image_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Delete a gallery image. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to - be deleted. + be deleted. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition to be deleted. :type gallery_image_name: str @@ -429,8 +435,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -481,7 +487,7 @@ def list_by_gallery( :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery from which Image Definitions are to - be listed. + be listed. :type gallery_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GalleryImageList or the result of cls(response) @@ -489,11 +495,18 @@ def list_by_gallery( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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_gallery.metadata['url'] # type: ignore @@ -507,15 +520,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_images_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_images_operations.py similarity index 90% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_images_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_images_operations.py index 98bbd385d17f..b1f7bd5153f7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_images_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_images_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.Image": cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'Image') 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('Image', pipeline_response) @@ -106,7 +106,7 @@ async def begin_create_or_update( image_name: str, parameters: "models.Image", **kwargs - ) -> "models.Image": + ) -> AsyncLROPoller["models.Image"]: """Create or update an image. :param resource_group_name: The name of the resource group. @@ -121,8 +121,8 @@ async def begin_create_or_update( 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: Image, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_12_01.models.Image + :return: An instance of AsyncLROPoller that returns either Image or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_12_01.models.Image] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -173,10 +173,13 @@ async def _update_initial( **kwargs ) -> "models.Image": cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -194,14 +197,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ImageUpdate') 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 @@ -209,7 +210,6 @@ async def _update_initial( 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('Image', pipeline_response) @@ -228,7 +228,7 @@ async def begin_update( image_name: str, parameters: "models.ImageUpdate", **kwargs - ) -> "models.Image": + ) -> AsyncLROPoller["models.Image"]: """Update an image. :param resource_group_name: The name of the resource group. @@ -243,8 +243,8 @@ async def begin_update( 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: Image, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_12_01.models.Image + :return: An instance of AsyncLROPoller that returns either Image or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_12_01.models.Image] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -294,7 +294,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -314,7 +316,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -333,7 +334,7 @@ async def begin_delete( resource_group_name: str, image_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes an Image. :param resource_group_name: The name of the resource group. @@ -346,8 +347,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -407,9 +408,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -428,9 +432,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -462,11 +465,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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 @@ -479,15 +489,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -519,7 +525,7 @@ def list( **kwargs ) -> AsyncIterable["models.ImageListResult"]: """Gets the list of Images in the subscription. Use nextLink property in the response to get the - next page of Images. Do this till nextLink is null to fetch all the Images. + next page of Images. Do this till nextLink is null to fetch all the Images. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ImageListResult or the result of cls(response) @@ -527,11 +533,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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 @@ -543,15 +556,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_log_analytics_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_log_analytics_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_log_analytics_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_log_analytics_operations.py index 138068496d7c..1ad22349de45 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_log_analytics_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_log_analytics_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -47,12 +47,15 @@ async def _export_request_rate_by_interval_initial( location: str, parameters: "models.RequestRateByIntervalInput", **kwargs - ) -> "models.LogAnalyticsOperationResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.LogAnalyticsOperationResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._export_request_rate_by_interval_initial.metadata['url'] # type: ignore @@ -69,14 +72,12 @@ async def _export_request_rate_by_interval_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RequestRateByIntervalInput') 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 @@ -99,9 +100,9 @@ async def begin_export_request_rate_by_interval( location: str, parameters: "models.RequestRateByIntervalInput", **kwargs - ) -> "models.LogAnalyticsOperationResult": + ) -> AsyncLROPoller["models.LogAnalyticsOperationResult"]: """Export logs that show Api requests made by this subscription in the given time window to show - throttling activities. + throttling activities. :param location: The location upon which virtual-machine-sizes is queried. :type location: str @@ -113,8 +114,8 @@ async def begin_export_request_rate_by_interval( 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: LogAnalyticsOperationResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_12_01.models.LogAnalyticsOperationResult + :return: An instance of AsyncLROPoller that returns either LogAnalyticsOperationResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_12_01.models.LogAnalyticsOperationResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -161,12 +162,15 @@ async def _export_throttled_requests_initial( location: str, parameters: "models.LogAnalyticsInputBase", **kwargs - ) -> "models.LogAnalyticsOperationResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.LogAnalyticsOperationResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._export_throttled_requests_initial.metadata['url'] # type: ignore @@ -183,14 +187,12 @@ async def _export_throttled_requests_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LogAnalyticsInputBase') 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 @@ -213,9 +215,9 @@ async def begin_export_throttled_requests( location: str, parameters: "models.LogAnalyticsInputBase", **kwargs - ) -> "models.LogAnalyticsOperationResult": + ) -> AsyncLROPoller["models.LogAnalyticsOperationResult"]: """Export logs that show total throttled Api requests for this subscription in the given time - window. + window. :param location: The location upon which virtual-machine-sizes is queried. :type location: str @@ -227,8 +229,8 @@ async def begin_export_throttled_requests( 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: LogAnalyticsOperationResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_12_01.models.LogAnalyticsOperationResult + :return: An instance of AsyncLROPoller that returns either LogAnalyticsOperationResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_12_01.models.LogAnalyticsOperationResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_operations.py similarity index 87% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_operations.py index 4f99b9f05ca3..19cf5cf16e8e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -53,11 +53,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeOperationListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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 @@ -65,15 +72,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_proximity_placement_groups_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_proximity_placement_groups_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_proximity_placement_groups_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_proximity_placement_groups_operations.py index 307d05c68001..0564c043bdb1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_proximity_placement_groups_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_proximity_placement_groups_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -62,10 +62,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -83,14 +86,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ProximityPlacementGroup') 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 @@ -98,7 +99,6 @@ async def create_or_update( 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('ProximityPlacementGroup', pipeline_response) @@ -132,10 +132,13 @@ async def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -153,14 +156,12 @@ async def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'UpdateResource') 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 @@ -194,7 +195,9 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -214,7 +217,6 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -250,9 +252,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -271,9 +276,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -302,11 +306,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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_subscription.metadata['url'] # type: ignore @@ -318,15 +329,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -368,11 +375,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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 @@ -385,15 +399,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_ssh_public_keys_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_ssh_public_keys_operations.py similarity index 90% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_ssh_public_keys_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_ssh_public_keys_operations.py index 6a92d21afc06..8acc603f7153 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_ssh_public_keys_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_ssh_public_keys_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -46,7 +46,7 @@ def list_by_subscription( **kwargs ) -> AsyncIterable["models.SshPublicKeysGroupListResult"]: """Lists all of the SSH public keys in the subscription. Use the nextLink property in the response - to get the next page of SSH public keys. + to get the next page of SSH public keys. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SshPublicKeysGroupListResult or the result of cls(response) @@ -54,11 +54,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeysGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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_subscription.metadata['url'] # type: ignore @@ -70,15 +77,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -111,7 +114,7 @@ def list_by_resource_group( **kwargs ) -> AsyncIterable["models.SshPublicKeysGroupListResult"]: """Lists all of the SSH public keys in the specified resource group. Use the nextLink property in - the response to get the next page of SSH public keys. + the response to get the next page of SSH public keys. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -121,11 +124,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeysGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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 @@ -138,15 +148,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -194,10 +200,13 @@ async def create( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeyResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create.metadata['url'] # type: ignore @@ -215,14 +224,12 @@ async def create( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SshPublicKeyResource') 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 @@ -230,7 +237,6 @@ async def create( 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('SshPublicKeyResource', pipeline_response) @@ -264,10 +270,13 @@ async def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeyResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -285,14 +294,12 @@ async def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SshPublicKeyUpdateResource') 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 @@ -326,7 +333,9 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -346,7 +355,6 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -378,9 +386,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeyResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -397,9 +408,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -436,9 +446,12 @@ async def generate_key_pair( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeyGenerateKeyPairResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.generate_key_pair.metadata['url'] # type: ignore @@ -455,9 +468,8 @@ async def generate_key_pair( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_usage_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_usage_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_usage_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_usage_operations.py index 7c8a86de0c22..f20aacda364b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_usage_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_usage_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -47,7 +47,7 @@ def list( **kwargs ) -> AsyncIterable["models.ListUsagesResult"]: """Gets, for the specified location, the current compute resource usage information as well as the - limits for compute resources under the subscription. + limits for compute resources under the subscription. :param location: The location for which resource usage is queried. :type location: str @@ -57,11 +57,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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 @@ -74,15 +81,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_virtual_machine_extension_images_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_extension_images_operations.py similarity index 92% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_virtual_machine_extension_images_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_extension_images_operations.py index d97ba6214fd6..ead885cce009 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_virtual_machine_extension_images_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -64,9 +64,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -85,9 +88,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -122,9 +124,12 @@ async def list_types( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.list_types.metadata['url'] # type: ignore @@ -141,9 +146,8 @@ async def list_types( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -190,9 +194,12 @@ async def list_versions( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.list_versions.metadata['url'] # type: ignore @@ -216,9 +223,8 @@ async def list_versions( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_virtual_machine_extensions_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_extensions_operations.py similarity index 92% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_virtual_machine_extensions_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_extensions_operations.py index d9841dc89ffa..dc3386d101d2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_virtual_machine_extensions_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_extensions_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachineExtension": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -73,14 +76,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtension') 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 @@ -88,7 +89,6 @@ async def _create_or_update_initial( 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('VirtualMachineExtension', pipeline_response) @@ -108,18 +108,18 @@ async def begin_create_or_update( vm_extension_name: str, extension_parameters: "models.VirtualMachineExtension", **kwargs - ) -> "models.VirtualMachineExtension": + ) -> AsyncLROPoller["models.VirtualMachineExtension"]: """The operation to create or update the extension. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_name: The name of the virtual machine where the extension should be created or - updated. + updated. :type vm_name: str :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Create Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineExtension :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. @@ -127,8 +127,8 @@ async def begin_create_or_update( 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: VirtualMachineExtension, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineExtension + :return: An instance of AsyncLROPoller that returns either VirtualMachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -181,10 +181,13 @@ async def _update_initial( **kwargs ) -> "models.VirtualMachineExtension": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -203,14 +206,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtensionUpdate') 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 @@ -233,7 +234,7 @@ async def begin_update( vm_extension_name: str, extension_parameters: "models.VirtualMachineExtensionUpdate", **kwargs - ) -> "models.VirtualMachineExtension": + ) -> AsyncLROPoller["models.VirtualMachineExtension"]: """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -243,7 +244,7 @@ async def begin_update( :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Update Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineExtensionUpdate :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. @@ -251,8 +252,8 @@ async def begin_update( 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: VirtualMachineExtension, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineExtension + :return: An instance of AsyncLROPoller that returns either VirtualMachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -304,7 +305,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -325,7 +328,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -345,7 +347,7 @@ async def begin_delete( vm_name: str, vm_extension_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -360,8 +362,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -425,9 +427,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -447,9 +452,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -487,9 +491,12 @@ async def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -508,9 +515,8 @@ async def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_virtual_machine_images_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_images_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_virtual_machine_images_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_images_operations.py index d9ca36c56d19..e01f28774c0f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_virtual_machine_images_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_images_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -67,9 +67,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -89,9 +92,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -142,9 +144,12 @@ async def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -169,9 +174,8 @@ async def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -206,9 +210,12 @@ async def list_offers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.list_offers.metadata['url'] # type: ignore @@ -225,9 +232,8 @@ async def list_offers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -259,9 +265,12 @@ async def list_publishers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.list_publishers.metadata['url'] # type: ignore @@ -277,9 +286,8 @@ async def list_publishers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -317,9 +325,12 @@ async def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.list_skus.metadata['url'] # type: ignore @@ -337,9 +348,8 @@ async def list_skus( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_virtual_machine_run_commands_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_run_commands_operations.py similarity index 89% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_virtual_machine_run_commands_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_run_commands_operations.py index 785f61e8b8fb..0abb8cec5a34 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_virtual_machine_run_commands_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,11 +56,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json, text/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 @@ -73,15 +80,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -126,9 +129,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandDocument"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json, text/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -145,9 +151,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_virtual_machine_scale_set_extensions_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_virtual_machine_scale_set_extensions_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index 2cbf97e0e6d3..cbc3856050ac 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_virtual_machine_scale_set_extensions_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,10 +52,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachineScaleSetExtension": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -74,14 +77,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineScaleSetExtension') 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 @@ -89,7 +90,6 @@ async def _create_or_update_initial( 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('VirtualMachineScaleSetExtension', pipeline_response) @@ -109,18 +109,18 @@ async def begin_create_or_update( vmss_extension_name: str, extension_parameters: "models.VirtualMachineScaleSetExtension", **kwargs - ) -> "models.VirtualMachineScaleSetExtension": + ) -> AsyncLROPoller["models.VirtualMachineScaleSetExtension"]: """The operation to create or update an extension. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_scale_set_name: The name of the VM scale set where the extension should be create or - updated. + updated. :type vm_scale_set_name: str :param vmss_extension_name: The name of the VM scale set extension. :type vmss_extension_name: str :param extension_parameters: Parameters supplied to the Create VM scale set Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSetExtension :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. @@ -128,8 +128,8 @@ async def begin_create_or_update( 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: VirtualMachineScaleSetExtension, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSetExtension + :return: An instance of AsyncLROPoller that returns either VirtualMachineScaleSetExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSetExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -182,10 +182,13 @@ async def _update_initial( **kwargs ) -> "models.VirtualMachineScaleSetExtension": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -204,14 +207,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineScaleSetExtensionUpdate') 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 @@ -219,7 +220,6 @@ async def _update_initial( 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('VirtualMachineScaleSetExtension', pipeline_response) @@ -239,7 +239,7 @@ async def begin_update( vmss_extension_name: str, extension_parameters: "models.VirtualMachineScaleSetExtensionUpdate", **kwargs - ) -> "models.VirtualMachineScaleSetExtension": + ) -> AsyncLROPoller["models.VirtualMachineScaleSetExtension"]: """The operation to update an extension. :param resource_group_name: The name of the resource group. @@ -249,7 +249,7 @@ async def begin_update( :param vmss_extension_name: The name of the VM scale set extension. :type vmss_extension_name: str :param extension_parameters: Parameters supplied to the Update VM scale set Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSetExtensionUpdate :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. @@ -257,8 +257,8 @@ async def begin_update( 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: VirtualMachineScaleSetExtension, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSetExtension + :return: An instance of AsyncLROPoller that returns either VirtualMachineScaleSetExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSetExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -310,7 +310,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -331,7 +333,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -351,7 +352,7 @@ async def begin_delete( vm_scale_set_name: str, vmss_extension_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -366,8 +367,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -431,9 +432,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -453,9 +457,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -490,11 +493,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtensionListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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 @@ -508,15 +518,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_virtual_machine_scale_set_rolling_upgrades_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_virtual_machine_scale_set_rolling_upgrades_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index b3cbe508bb82..2bf43493dd59 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_virtual_machine_scale_set_rolling_upgrades_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -49,7 +49,9 @@ async def _cancel_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -69,7 +71,6 @@ async def _cancel_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -88,7 +89,7 @@ async def begin_cancel( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Cancels the current virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -101,8 +102,8 @@ async def begin_cancel( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -148,7 +149,9 @@ async def _start_os_upgrade_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -168,7 +171,6 @@ async def _start_os_upgrade_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -187,10 +189,10 @@ async def begin_start_os_upgrade( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts a rolling upgrade to move all virtual machine scale set instances to the latest - available Platform Image OS version. Instances which are already running the latest available - OS version are not affected. + available Platform Image OS version. Instances which are already running the latest available + OS version are not affected. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -202,8 +204,8 @@ async def begin_start_os_upgrade( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -249,7 +251,9 @@ async def _start_extension_upgrade_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -269,7 +273,6 @@ async def _start_extension_upgrade_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -288,10 +291,10 @@ async def begin_start_extension_upgrade( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to - the latest available extension version. Instances which are already running the latest - extension versions are not affected. + the latest available extension version. Instances which are already running the latest + extension versions are not affected. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -303,8 +306,8 @@ async def begin_start_extension_upgrade( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -361,9 +364,12 @@ async def get_latest( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RollingUpgradeStatusInfo"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get_latest.metadata['url'] # type: ignore @@ -380,9 +386,8 @@ async def get_latest( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_virtual_machine_scale_set_vm_extensions_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py similarity index 92% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_virtual_machine_scale_set_vm_extensions_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py index 1ace15c68276..7f6d39f84e81 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_virtual_machine_scale_set_vm_extensions_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,10 +52,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachineExtension": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -75,14 +78,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtension') 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 @@ -90,7 +91,6 @@ async def _create_or_update_initial( 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('VirtualMachineExtension', pipeline_response) @@ -111,7 +111,7 @@ async def begin_create_or_update( vm_extension_name: str, extension_parameters: "models.VirtualMachineExtension", **kwargs - ) -> "models.VirtualMachineExtension": + ) -> AsyncLROPoller["models.VirtualMachineExtension"]: """The operation to create or update the VMSS VM extension. :param resource_group_name: The name of the resource group. @@ -123,7 +123,7 @@ async def begin_create_or_update( :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Create Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineExtension :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. @@ -131,8 +131,8 @@ async def begin_create_or_update( 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: VirtualMachineExtension, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineExtension + :return: An instance of AsyncLROPoller that returns either VirtualMachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -187,10 +187,13 @@ async def _update_initial( **kwargs ) -> "models.VirtualMachineExtension": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -210,14 +213,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtensionUpdate') 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 @@ -241,7 +242,7 @@ async def begin_update( vm_extension_name: str, extension_parameters: "models.VirtualMachineExtensionUpdate", **kwargs - ) -> "models.VirtualMachineExtension": + ) -> AsyncLROPoller["models.VirtualMachineExtension"]: """The operation to update the VMSS VM extension. :param resource_group_name: The name of the resource group. @@ -253,7 +254,7 @@ async def begin_update( :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Update Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineExtensionUpdate :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. @@ -261,8 +262,8 @@ async def begin_update( 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: VirtualMachineExtension, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineExtension + :return: An instance of AsyncLROPoller that returns either VirtualMachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -316,9 +317,12 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -337,8 +341,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -359,7 +363,7 @@ async def begin_delete( instance_id: str, vm_extension_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to delete the VMSS VM extension. :param resource_group_name: The name of the resource group. @@ -376,8 +380,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -445,9 +449,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -468,9 +475,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -511,9 +517,12 @@ async def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -533,9 +542,8 @@ async def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_virtual_machine_scale_set_vms_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_vms_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_virtual_machine_scale_set_vms_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index c93146edbfe0..34b35c0af436 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_virtual_machine_scale_set_vms_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,7 +52,9 @@ async def _reimage_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") @@ -75,7 +77,6 @@ async def _reimage_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_scale_set_vm_reimage_input is not None: body_content = self._serialize.body(vm_scale_set_vm_reimage_input, 'VirtualMachineReimageParameters') @@ -83,7 +84,6 @@ async def _reimage_initial( body_content = None 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 @@ -103,7 +103,7 @@ async def begin_reimage( instance_id: str, vm_scale_set_vm_reimage_input: Optional["models.VirtualMachineReimageParameters"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -120,8 +120,8 @@ async def begin_reimage( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -170,7 +170,9 @@ async def _reimage_all_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -191,7 +193,6 @@ async def _reimage_all_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -211,9 +212,9 @@ async def begin_reimage_all( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. - This operation is only supported for managed disks. + This operation is only supported for managed disks. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -227,8 +228,8 @@ async def begin_reimage_all( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -276,7 +277,9 @@ async def _deallocate_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -297,7 +300,6 @@ async def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -317,10 +319,10 @@ async def begin_deallocate( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and - releases the compute resources it uses. You are not billed for the compute resources of this - virtual machine once it is deallocated. + releases the compute resources it uses. You are not billed for the compute resources of this + virtual machine once it is deallocated. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -334,8 +336,8 @@ async def begin_deallocate( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -384,10 +386,13 @@ async def _update_initial( **kwargs ) -> "models.VirtualMachineScaleSetVM": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -406,14 +411,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSetVM') 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 @@ -421,7 +424,6 @@ async def _update_initial( 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('VirtualMachineScaleSetVM', pipeline_response) @@ -441,13 +443,13 @@ async def begin_update( instance_id: str, parameters: "models.VirtualMachineScaleSetVM", **kwargs - ) -> "models.VirtualMachineScaleSetVM": + ) -> AsyncLROPoller["models.VirtualMachineScaleSetVM"]: """Updates a virtual machine of a VM scale set. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_scale_set_name: The name of the VM scale set where the extension should be create or - updated. + updated. :type vm_scale_set_name: str :param instance_id: The instance ID of the virtual machine. :type instance_id: str @@ -459,8 +461,8 @@ async def begin_update( 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: VirtualMachineScaleSetVM, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSetVM + :return: An instance of AsyncLROPoller that returns either VirtualMachineScaleSetVM or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSetVM] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -512,7 +514,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -533,7 +537,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -553,7 +556,7 @@ async def begin_delete( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -568,8 +571,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -633,9 +636,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -655,9 +661,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -695,9 +700,12 @@ async def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -715,9 +723,8 @@ async def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -749,11 +756,14 @@ def list( :type resource_group_name: str :param virtual_machine_scale_set_name: The name of the VM scale set. :type virtual_machine_scale_set_name: str - :param filter: The filter to apply to the operation. + :param filter: The filter to apply to the operation. Allowed values are + 'startswith(instanceView/statuses/code, 'PowerState') eq true', 'properties/latestModelApplied + eq true', 'properties/latestModelApplied eq false'. :type filter: str - :param select: The list parameters. + :param select: The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. :type select: str - :param expand: The expand expression to apply to the operation. + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetVMListResult or the result of cls(response) @@ -761,11 +771,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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 @@ -785,15 +802,11 @@ def prepare_request(next_link=None): query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -829,7 +842,9 @@ async def _power_off_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -852,7 +867,6 @@ async def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -873,10 +887,10 @@ async def begin_power_off( instance_id: str, skip_shutdown: Optional[bool] = False, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached - and you are getting charged for the resources. Instead, use deallocate to release resources and - avoid charges. + and you are getting charged for the resources. Instead, use deallocate to release resources and + avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -885,8 +899,8 @@ async def begin_power_off( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param skip_shutdown: The parameter to request non-graceful VM shutdown. True value for this - flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this - flag is false if not specified. + flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this + flag is false if not specified. :type skip_shutdown: 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. @@ -894,8 +908,8 @@ async def begin_power_off( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -944,7 +958,9 @@ async def _restart_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -965,7 +981,6 @@ async def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -985,7 +1000,7 @@ async def begin_restart( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Restarts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1000,8 +1015,8 @@ async def begin_restart( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1049,7 +1064,9 @@ async def _start_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -1070,7 +1087,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1090,7 +1106,7 @@ async def begin_start( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1105,8 +1121,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1154,7 +1170,9 @@ async def _redeploy_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -1175,7 +1193,6 @@ async def _redeploy_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1195,9 +1212,9 @@ async def begin_redeploy( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and - powers it back on. + powers it back on. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1211,8 +1228,8 @@ async def begin_redeploy( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1260,7 +1277,9 @@ async def _perform_maintenance_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -1281,7 +1300,6 @@ async def _perform_maintenance_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1301,7 +1319,7 @@ async def begin_perform_maintenance( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Performs maintenance on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1316,8 +1334,8 @@ async def begin_perform_maintenance( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1379,7 +1397,9 @@ async def simulate_eviction( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -1400,7 +1420,6 @@ async def simulate_eviction( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1421,12 +1440,15 @@ async def _run_command_initial( instance_id: str, parameters: "models.RunCommandInput", **kwargs - ) -> "models.RunCommandResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.RunCommandResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" # Construct URL url = self._run_command_initial.metadata['url'] # type: ignore @@ -1445,14 +1467,12 @@ async def _run_command_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RunCommandInput') 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 @@ -1477,7 +1497,7 @@ async def begin_run_command( instance_id: str, parameters: "models.RunCommandInput", **kwargs - ) -> "models.RunCommandResult": + ) -> AsyncLROPoller["models.RunCommandResult"]: """Run command on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1494,8 +1514,8 @@ async def begin_run_command( 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: RunCommandResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_12_01.models.RunCommandResult + :return: An instance of AsyncLROPoller that returns either RunCommandResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_12_01.models.RunCommandResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_virtual_machine_scale_sets_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_sets_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_virtual_machine_scale_sets_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_sets_operations.py index 9f7e7a143270..9baf4a2a0f61 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_virtual_machine_scale_sets_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,10 +51,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachineScaleSet": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -72,14 +75,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSet') 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 @@ -87,7 +88,6 @@ async def _create_or_update_initial( 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('VirtualMachineScaleSet', pipeline_response) @@ -106,7 +106,7 @@ async def begin_create_or_update( vm_scale_set_name: str, parameters: "models.VirtualMachineScaleSet", **kwargs - ) -> "models.VirtualMachineScaleSet": + ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -121,8 +121,8 @@ async def begin_create_or_update( 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: VirtualMachineScaleSet, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSet + :return: An instance of AsyncLROPoller that returns either VirtualMachineScaleSet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -173,10 +173,13 @@ async def _update_initial( **kwargs ) -> "models.VirtualMachineScaleSet": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -194,14 +197,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSetUpdate') 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 @@ -223,7 +224,7 @@ async def begin_update( vm_scale_set_name: str, parameters: "models.VirtualMachineScaleSetUpdate", **kwargs - ) -> "models.VirtualMachineScaleSet": + ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: """Update a VM scale set. :param resource_group_name: The name of the resource group. @@ -238,8 +239,8 @@ async def begin_update( 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: VirtualMachineScaleSet, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSet + :return: An instance of AsyncLROPoller that returns either VirtualMachineScaleSet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -289,7 +290,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -309,7 +312,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -328,7 +330,7 @@ async def begin_delete( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VM scale set. :param resource_group_name: The name of the resource group. @@ -341,8 +343,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -399,9 +401,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -418,9 +423,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -445,7 +449,9 @@ async def _deallocate_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") @@ -467,7 +473,6 @@ async def _deallocate_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -475,7 +480,6 @@ async def _deallocate_initial( body_content = None 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 @@ -494,10 +498,10 @@ async def begin_deallocate( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and - releases the compute resources. You are not billed for the compute resources that this virtual - machine scale set deallocates. + releases the compute resources. You are not billed for the compute resources that this virtual + machine scale set deallocates. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -511,8 +515,8 @@ async def begin_deallocate( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -560,7 +564,9 @@ async def _delete_instances_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") @@ -582,12 +588,10 @@ async def _delete_instances_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -606,7 +610,7 @@ async def begin_delete_instances( vm_scale_set_name: str, vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -621,8 +625,8 @@ async def begin_delete_instances( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -680,9 +684,12 @@ async def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -699,9 +706,8 @@ async def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -733,11 +739,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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 @@ -750,15 +763,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -790,8 +799,8 @@ def list_all( **kwargs ) -> AsyncIterable["models.VirtualMachineScaleSetListWithLinkResult"]: """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource - group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this - till nextLink is null to fetch all the VM Scale Sets. + group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this + till nextLink is null to fetch all the VM Scale Sets. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetListWithLinkResult or the result of cls(response) @@ -799,11 +808,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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_all.metadata['url'] # type: ignore @@ -815,15 +831,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -857,7 +869,7 @@ def list_skus( **kwargs ) -> AsyncIterable["models.VirtualMachineScaleSetListSkusResult"]: """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM - instances allowed for each SKU. + instances allowed for each SKU. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -869,11 +881,18 @@ def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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_skus.metadata['url'] # type: ignore @@ -887,15 +906,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -940,11 +955,18 @@ def get_os_upgrade_history( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListOSUpgradeHistory"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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.get_os_upgrade_history.metadata['url'] # type: ignore @@ -958,15 +980,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1002,7 +1020,9 @@ async def _power_off_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") @@ -1026,7 +1046,6 @@ async def _power_off_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1034,7 +1053,6 @@ async def _power_off_initial( body_content = None 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 @@ -1054,18 +1072,18 @@ async def begin_power_off( skip_shutdown: Optional[bool] = False, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still - attached and you are getting charged for the resources. Instead, use deallocate to release - resources and avoid charges. + attached and you are getting charged for the resources. Instead, use deallocate to release + resources and avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_scale_set_name: The name of the VM scale set. :type vm_scale_set_name: str :param skip_shutdown: The parameter to request non-graceful VM shutdown. True value for this - flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this - flag is false if not specified. + flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this + flag is false if not specified. :type skip_shutdown: bool :param vm_instance_i_ds: A list of virtual machine instance IDs from the VM scale set. :type vm_instance_i_ds: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSetVMInstanceIDs @@ -1075,8 +1093,8 @@ async def begin_power_off( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1125,7 +1143,9 @@ async def _restart_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") @@ -1147,7 +1167,6 @@ async def _restart_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1155,7 +1174,6 @@ async def _restart_initial( body_content = None 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 @@ -1174,7 +1192,7 @@ async def begin_restart( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Restarts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1189,8 +1207,8 @@ async def begin_restart( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1238,7 +1256,9 @@ async def _start_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") @@ -1260,7 +1280,6 @@ async def _start_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1268,7 +1287,6 @@ async def _start_initial( body_content = None 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 @@ -1287,7 +1305,7 @@ async def begin_start( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1302,8 +1320,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1351,7 +1369,9 @@ async def _redeploy_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") @@ -1373,7 +1393,6 @@ async def _redeploy_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1381,7 +1400,6 @@ async def _redeploy_initial( body_content = None 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 @@ -1400,9 +1418,9 @@ async def begin_redeploy( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, - and powers them back on. + and powers them back on. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1416,8 +1434,8 @@ async def begin_redeploy( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1465,7 +1483,9 @@ async def _perform_maintenance_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") @@ -1487,7 +1507,6 @@ async def _perform_maintenance_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1495,7 +1514,6 @@ async def _perform_maintenance_initial( body_content = None 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 @@ -1514,11 +1532,11 @@ async def begin_perform_maintenance( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances - which are not eligible for perform maintenance will be failed. Please refer to best practices - for more details: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual- - machine-scale-sets-maintenance-notifications. + which are not eligible for perform maintenance will be failed. Please refer to best practices + for more details: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual- + machine-scale-sets-maintenance-notifications. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1532,8 +1550,8 @@ async def begin_perform_maintenance( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1581,7 +1599,9 @@ async def _update_instances_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") @@ -1603,12 +1623,10 @@ async def _update_instances_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -1627,7 +1645,7 @@ async def begin_update_instances( vm_scale_set_name: str, vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. :param resource_group_name: The name of the resource group. @@ -1642,8 +1660,8 @@ async def begin_update_instances( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1691,7 +1709,9 @@ async def _reimage_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") @@ -1713,7 +1733,6 @@ async def _reimage_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_scale_set_reimage_input is not None: body_content = self._serialize.body(vm_scale_set_reimage_input, 'VirtualMachineScaleSetReimageParameters') @@ -1721,7 +1740,6 @@ async def _reimage_initial( body_content = None 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 @@ -1740,10 +1758,10 @@ async def begin_reimage( vm_scale_set_name: str, vm_scale_set_reimage_input: Optional["models.VirtualMachineScaleSetReimageParameters"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which - don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual - machine is reset to initial state. + don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual + machine is reset to initial state. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1757,8 +1775,8 @@ async def begin_reimage( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1806,7 +1824,9 @@ async def _reimage_all_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") @@ -1828,7 +1848,6 @@ async def _reimage_all_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1836,7 +1855,6 @@ async def _reimage_all_initial( body_content = None 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 @@ -1855,9 +1873,9 @@ async def begin_reimage_all( vm_scale_set_name: str, vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This - operation is only supported for managed disks. + operation is only supported for managed disks. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1871,8 +1889,8 @@ async def begin_reimage_all( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1935,9 +1953,12 @@ async def force_recovery_service_fabric_platform_update_domain_walk( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RecoveryWalkResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.force_recovery_service_fabric_platform_update_domain_walk.metadata['url'] # type: ignore @@ -1955,9 +1976,8 @@ async def force_recovery_service_fabric_platform_update_domain_walk( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1995,8 +2015,11 @@ async def convert_to_single_placement_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL @@ -2010,17 +2033,16 @@ async def convert_to_single_placement_group( # 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') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VMScaleSetConvertToSinglePlacementGroupInput') 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 @@ -2041,7 +2063,9 @@ async def _set_orchestration_service_state_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") @@ -2063,12 +2087,10 @@ async def _set_orchestration_service_state_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'OrchestrationServiceStateInput') 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 @@ -2087,7 +2109,7 @@ async def begin_set_orchestration_service_state( vm_scale_set_name: str, parameters: "models.OrchestrationServiceStateInput", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Changes ServiceState property for a given service. :param resource_group_name: The name of the resource group. @@ -2102,8 +2124,8 @@ async def begin_set_orchestration_service_state( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_virtual_machine_sizes_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_sizes_operations.py similarity index 88% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_virtual_machine_sizes_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_sizes_operations.py index efc1cb9db8e2..4738a94dcbd7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_virtual_machine_sizes_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_sizes_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -47,7 +47,7 @@ def list( **kwargs ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: """This API is deprecated. Use `Resources Skus `_. + us/rest/api/compute/resourceskus/list>`_. :param location: The location upon which virtual-machine-sizes is queried. :type location: str @@ -57,11 +57,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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 @@ -74,15 +81,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_virtual_machines_operations_async.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machines_operations.py similarity index 91% rename from sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_virtual_machines_operations_async.py rename to sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machines_operations.py index f09bcb9cbc97..fbde41c0ced7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/_virtual_machines_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machines_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -58,11 +58,18 @@ def list_by_location( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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_location.metadata['url'] # type: ignore @@ -75,15 +82,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -116,12 +119,15 @@ async def _capture_initial( vm_name: str, parameters: "models.VirtualMachineCaptureParameters", **kwargs - ) -> "models.VirtualMachineCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.VirtualMachineCaptureResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._capture_initial.metadata['url'] # type: ignore @@ -139,14 +145,12 @@ async def _capture_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineCaptureParameters') 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 @@ -170,9 +174,9 @@ async def begin_capture( vm_name: str, parameters: "models.VirtualMachineCaptureParameters", **kwargs - ) -> "models.VirtualMachineCaptureResult": + ) -> AsyncLROPoller["models.VirtualMachineCaptureResult"]: """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used - to create similar VMs. + to create similar VMs. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -186,8 +190,8 @@ async def begin_capture( 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: VirtualMachineCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineCaptureResult + :return: An instance of AsyncLROPoller that returns either VirtualMachineCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineCaptureResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -238,10 +242,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.VirtualMachine": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -259,14 +266,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachine') 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 @@ -274,7 +279,6 @@ async def _create_or_update_initial( 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('VirtualMachine', pipeline_response) @@ -293,9 +297,9 @@ async def begin_create_or_update( vm_name: str, parameters: "models.VirtualMachine", **kwargs - ) -> "models.VirtualMachine": + ) -> AsyncLROPoller["models.VirtualMachine"]: """The operation to create or update a virtual machine. Please note some properties can be set - only during virtual machine creation. + only during virtual machine creation. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -309,8 +313,8 @@ async def begin_create_or_update( 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: VirtualMachine, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachine + :return: An instance of AsyncLROPoller that returns either VirtualMachine or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_12_01.models.VirtualMachine] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -361,10 +365,13 @@ async def _update_initial( **kwargs ) -> "models.VirtualMachine": cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -382,14 +389,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineUpdate') 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 @@ -397,7 +402,6 @@ async def _update_initial( 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('VirtualMachine', pipeline_response) @@ -416,7 +420,7 @@ async def begin_update( vm_name: str, parameters: "models.VirtualMachineUpdate", **kwargs - ) -> "models.VirtualMachine": + ) -> AsyncLROPoller["models.VirtualMachine"]: """The operation to update a virtual machine. :param resource_group_name: The name of the resource group. @@ -431,8 +435,8 @@ async def begin_update( 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: VirtualMachine, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachine + :return: An instance of AsyncLROPoller that returns either VirtualMachine or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_12_01.models.VirtualMachine] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -482,7 +486,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -502,7 +508,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -521,7 +526,7 @@ async def begin_delete( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to delete a virtual machine. :param resource_group_name: The name of the resource group. @@ -534,8 +539,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -595,9 +600,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -616,9 +624,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -653,9 +660,12 @@ async def instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.instance_view.metadata['url'] # type: ignore @@ -672,9 +682,8 @@ async def instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -698,7 +707,9 @@ async def _convert_to_managed_disks_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -718,7 +729,6 @@ async def _convert_to_managed_disks_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -737,9 +747,9 @@ async def begin_convert_to_managed_disks( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop- - deallocated before invoking this operation. + deallocated before invoking this operation. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -751,8 +761,8 @@ async def begin_convert_to_managed_disks( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -798,7 +808,9 @@ async def _deallocate_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -818,7 +830,6 @@ async def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -837,9 +848,9 @@ async def begin_deallocate( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Shuts down the virtual machine and releases the compute resources. You are not billed for the - compute resources that this virtual machine uses. + compute resources that this virtual machine uses. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -851,8 +862,8 @@ async def begin_deallocate( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -914,7 +925,9 @@ async def generalize( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -934,7 +947,6 @@ async def generalize( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -954,7 +966,7 @@ def list( **kwargs ) -> AsyncIterable["models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified resource group. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -964,11 +976,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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 @@ -981,15 +1000,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1022,10 +1037,10 @@ def list_all( **kwargs ) -> AsyncIterable["models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified subscription. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :param status_only: statusOnly=true enables fetching run time status of all Virtual Machines in - the subscription. + the subscription. :type status_only: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineListResult or the result of cls(response) @@ -1033,11 +1048,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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_all.metadata['url'] # type: ignore @@ -1051,15 +1073,11 @@ def prepare_request(next_link=None): if status_only is not None: query_parameters['statusOnly'] = self._serialize.query("status_only", status_only, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1093,7 +1111,7 @@ def list_available_sizes( **kwargs ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes to which the specified virtual machine can be - resized. + resized. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1105,11 +1123,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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_available_sizes.metadata['url'] # type: ignore @@ -1123,15 +1148,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1166,7 +1187,9 @@ async def _power_off_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -1188,7 +1211,6 @@ async def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1208,17 +1230,17 @@ async def begin_power_off( vm_name: str, skip_shutdown: Optional[bool] = False, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with - the same provisioned resources. You are still charged for this virtual machine. + the same provisioned resources. You are still charged for this virtual machine. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_name: The name of the virtual machine. :type vm_name: str :param skip_shutdown: The parameter to request non-graceful VM shutdown. True value for this - flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this - flag is false if not specified. + flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this + flag is false if not specified. :type skip_shutdown: 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. @@ -1226,8 +1248,8 @@ async def begin_power_off( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1274,9 +1296,12 @@ async def _reapply_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self._reapply_initial.metadata['url'] # type: ignore @@ -1293,8 +1318,8 @@ async def _reapply_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1313,7 +1338,7 @@ async def begin_reapply( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to reapply a virtual machine's state. :param resource_group_name: The name of the resource group. @@ -1326,8 +1351,8 @@ async def begin_reapply( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1373,7 +1398,9 @@ async def _restart_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -1393,7 +1420,6 @@ async def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1412,7 +1438,7 @@ async def begin_restart( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to restart a virtual machine. :param resource_group_name: The name of the resource group. @@ -1425,8 +1451,8 @@ async def begin_restart( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1472,7 +1498,9 @@ async def _start_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -1492,7 +1520,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1511,7 +1538,7 @@ async def begin_start( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to start a virtual machine. :param resource_group_name: The name of the resource group. @@ -1524,8 +1551,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1571,7 +1598,9 @@ async def _redeploy_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -1591,7 +1620,6 @@ async def _redeploy_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1610,7 +1638,7 @@ async def begin_redeploy( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Shuts down the virtual machine, moves it to a new node, and powers it back on. :param resource_group_name: The name of the resource group. @@ -1623,8 +1651,8 @@ async def begin_redeploy( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1671,7 +1699,9 @@ async def _reimage_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") @@ -1693,7 +1723,6 @@ async def _reimage_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: body_content = self._serialize.body(parameters, 'VirtualMachineReimageParameters') @@ -1701,7 +1730,6 @@ async def _reimage_initial( body_content = None 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 @@ -1720,7 +1748,7 @@ async def begin_reimage( vm_name: str, parameters: Optional["models.VirtualMachineReimageParameters"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Reimages the virtual machine which has an ephemeral OS disk back to its initial state. :param resource_group_name: The name of the resource group. @@ -1735,8 +1763,8 @@ async def begin_reimage( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1783,7 +1811,9 @@ async def _perform_maintenance_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -1803,7 +1833,6 @@ async def _perform_maintenance_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1822,7 +1851,7 @@ async def begin_perform_maintenance( resource_group_name: str, vm_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """The operation to perform maintenance on a virtual machine. :param resource_group_name: The name of the resource group. @@ -1835,8 +1864,8 @@ async def begin_perform_maintenance( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -1894,7 +1923,9 @@ async def simulate_eviction( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -1914,7 +1945,6 @@ async def simulate_eviction( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -1934,12 +1964,15 @@ async def _run_command_initial( vm_name: str, parameters: "models.RunCommandInput", **kwargs - ) -> "models.RunCommandResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.RunCommandResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" # Construct URL url = self._run_command_initial.metadata['url'] # type: ignore @@ -1957,14 +1990,12 @@ async def _run_command_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RunCommandInput') 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 @@ -1988,7 +2019,7 @@ async def begin_run_command( vm_name: str, parameters: "models.RunCommandInput", **kwargs - ) -> "models.RunCommandResult": + ) -> AsyncLROPoller["models.RunCommandResult"]: """Run command on the VM. :param resource_group_name: The name of the resource group. @@ -2003,8 +2034,8 @@ async def begin_run_command( 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: RunCommandResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2019_12_01.models.RunCommandResult + :return: An instance of AsyncLROPoller that returns either RunCommandResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_12_01.models.RunCommandResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/__init__.py deleted file mode 100644 index ae893c9cf958..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations_async/__init__.py +++ /dev/null @@ -1,61 +0,0 @@ -# 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 ._operations_async import Operations -from ._availability_sets_operations_async import AvailabilitySetsOperations -from ._proximity_placement_groups_operations_async import ProximityPlacementGroupsOperations -from ._dedicated_host_groups_operations_async import DedicatedHostGroupsOperations -from ._dedicated_hosts_operations_async import DedicatedHostsOperations -from ._ssh_public_keys_operations_async import SshPublicKeysOperations -from ._virtual_machine_extension_images_operations_async import VirtualMachineExtensionImagesOperations -from ._virtual_machine_extensions_operations_async import VirtualMachineExtensionsOperations -from ._virtual_machine_images_operations_async import VirtualMachineImagesOperations -from ._usage_operations_async import UsageOperations -from ._virtual_machines_operations_async import VirtualMachinesOperations -from ._virtual_machine_sizes_operations_async import VirtualMachineSizesOperations -from ._images_operations_async import ImagesOperations -from ._virtual_machine_scale_sets_operations_async import VirtualMachineScaleSetsOperations -from ._virtual_machine_scale_set_extensions_operations_async import VirtualMachineScaleSetExtensionsOperations -from ._virtual_machine_scale_set_rolling_upgrades_operations_async import VirtualMachineScaleSetRollingUpgradesOperations -from ._virtual_machine_scale_set_vm_extensions_operations_async import VirtualMachineScaleSetVMExtensionsOperations -from ._virtual_machine_scale_set_vms_operations_async import VirtualMachineScaleSetVMsOperations -from ._log_analytics_operations_async import LogAnalyticsOperations -from ._virtual_machine_run_commands_operations_async import VirtualMachineRunCommandsOperations -from ._galleries_operations_async import GalleriesOperations -from ._gallery_images_operations_async import GalleryImagesOperations -from ._gallery_image_versions_operations_async import GalleryImageVersionsOperations -from ._gallery_applications_operations_async import GalleryApplicationsOperations -from ._gallery_application_versions_operations_async import GalleryApplicationVersionsOperations - -__all__ = [ - 'Operations', - 'AvailabilitySetsOperations', - 'ProximityPlacementGroupsOperations', - 'DedicatedHostGroupsOperations', - 'DedicatedHostsOperations', - 'SshPublicKeysOperations', - 'VirtualMachineExtensionImagesOperations', - 'VirtualMachineExtensionsOperations', - 'VirtualMachineImagesOperations', - 'UsageOperations', - 'VirtualMachinesOperations', - 'VirtualMachineSizesOperations', - 'ImagesOperations', - 'VirtualMachineScaleSetsOperations', - 'VirtualMachineScaleSetExtensionsOperations', - 'VirtualMachineScaleSetRollingUpgradesOperations', - 'VirtualMachineScaleSetVMExtensionsOperations', - 'VirtualMachineScaleSetVMsOperations', - 'LogAnalyticsOperations', - 'VirtualMachineRunCommandsOperations', - 'GalleriesOperations', - 'GalleryImagesOperations', - 'GalleryImageVersionsOperations', - 'GalleryApplicationsOperations', - 'GalleryApplicationVersionsOperations', -] 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 29209b074a07..c2bbf318e8a7 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 @@ -448,6 +448,7 @@ AvailabilitySetSkuTypes, CachingTypes, DedicatedHostLicenseTypes, + DiffDiskOptions, DiffDiskPlacement, DiskCreateOptionTypes, GalleryApplicationVersionPropertiesProvisioningState, @@ -463,11 +464,13 @@ MaintenanceOperationResultCodeTypes, OperatingSystemStateTypes, OperatingSystemTypes, + OrchestrationServiceNames, OrchestrationServiceState, OrchestrationServiceStateAction, ProtocolTypes, ProximityPlacementGroupType, ReplicationState, + ReplicationStatusTypes, ResourceIdentityType, RollingUpgradeActionType, RollingUpgradeStatusCode, @@ -707,6 +710,7 @@ 'AvailabilitySetSkuTypes', 'CachingTypes', 'DedicatedHostLicenseTypes', + 'DiffDiskOptions', 'DiffDiskPlacement', 'DiskCreateOptionTypes', 'GalleryApplicationVersionPropertiesProvisioningState', @@ -722,11 +726,13 @@ 'MaintenanceOperationResultCodeTypes', 'OperatingSystemStateTypes', 'OperatingSystemTypes', + 'OrchestrationServiceNames', 'OrchestrationServiceState', 'OrchestrationServiceStateAction', 'ProtocolTypes', 'ProximityPlacementGroupType', 'ReplicationState', + 'ReplicationStatusTypes', 'ResourceIdentityType', 'RollingUpgradeActionType', 'RollingUpgradeStatusCode', diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_compute_management_client_enums.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_compute_management_client_enums.py index ca679ca5db08..be31185d7ed0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_compute_management_client_enums.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_compute_management_client_enums.py @@ -6,48 +6,72 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum - -class AggregatedReplicationState(str, Enum): +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class AggregatedReplicationState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """This is the aggregated replication status based on all the regional replication status flags. """ - unknown = "Unknown" - in_progress = "InProgress" - completed = "Completed" - failed = "Failed" + UNKNOWN = "Unknown" + IN_PROGRESS = "InProgress" + COMPLETED = "Completed" + FAILED = "Failed" -class AvailabilitySetSkuTypes(str, Enum): +class AvailabilitySetSkuTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the sku of an Availability Set. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual machines with unmanaged disks. Default value is 'Classic'. """ - classic = "Classic" - aligned = "Aligned" + CLASSIC = "Classic" + ALIGNED = "Aligned" -class CachingTypes(str, Enum): +class CachingTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the caching requirements. :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **None** :code:`
`:code:`
` **ReadOnly** :code:`
`:code:`
` **ReadWrite** :code:`
`:code:`
` Default: **None for Standard storage. ReadOnly for Premium storage** """ - none = "None" - read_only = "ReadOnly" - read_write = "ReadWrite" + NONE = "None" + READ_ONLY = "ReadOnly" + READ_WRITE = "ReadWrite" -class DedicatedHostLicenseTypes(str, Enum): +class DedicatedHostLicenseTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the software license type that will be applied to the VMs deployed on the dedicated host. :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **None** :code:`
`:code:`
` **Windows_Server_Hybrid** :code:`
`:code:`
` **Windows_Server_Perpetual** :code:`
`:code:`
` Default: **None** """ - none = "None" - windows_server_hybrid = "Windows_Server_Hybrid" - windows_server_perpetual = "Windows_Server_Perpetual" + NONE = "None" + WINDOWS_SERVER_HYBRID = "Windows_Server_Hybrid" + WINDOWS_SERVER_PERPETUAL = "Windows_Server_Perpetual" + +class DiffDiskOptions(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the ephemeral disk option for operating system disk. + """ -class DiffDiskPlacement(str, Enum): + LOCAL = "Local" + +class DiffDiskPlacement(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the ephemeral disk placement for operating system disk. This property can be used by user in the request to choose the location i.e, cache disk or resource disk space for Ephemeral OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer @@ -57,10 +81,10 @@ class DiffDiskPlacement(str, Enum): requirements """ - cache_disk = "CacheDisk" - resource_disk = "ResourceDisk" + CACHE_DISK = "CacheDisk" + RESOURCE_DISK = "ResourceDisk" -class DiskCreateOptionTypes(str, Enum): +class DiskCreateOptionTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies how the virtual machine should be created.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` **Attach** \u2013 This value is used when you are using a specialized disk to create the virtual machine.:code:`
`:code:`
` **FromImage** \u2013 @@ -69,218 +93,229 @@ class DiskCreateOptionTypes(str, Enum): marketplace image, you also use the plan element previously described. """ - from_image = "FromImage" - empty = "Empty" - attach = "Attach" + FROM_IMAGE = "FromImage" + EMPTY = "Empty" + ATTACH = "Attach" -class GalleryApplicationVersionPropertiesProvisioningState(str, Enum): +class GalleryApplicationVersionPropertiesProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The provisioning state, which only appears in the response. """ - creating = "Creating" - updating = "Updating" - failed = "Failed" - succeeded = "Succeeded" - deleting = "Deleting" - migrating = "Migrating" + CREATING = "Creating" + UPDATING = "Updating" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + DELETING = "Deleting" + MIGRATING = "Migrating" -class GalleryImagePropertiesProvisioningState(str, Enum): +class GalleryImagePropertiesProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The provisioning state, which only appears in the response. """ - creating = "Creating" - updating = "Updating" - failed = "Failed" - succeeded = "Succeeded" - deleting = "Deleting" - migrating = "Migrating" + CREATING = "Creating" + UPDATING = "Updating" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + DELETING = "Deleting" + MIGRATING = "Migrating" -class GalleryImageVersionPropertiesProvisioningState(str, Enum): +class GalleryImageVersionPropertiesProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The provisioning state, which only appears in the response. """ - creating = "Creating" - updating = "Updating" - failed = "Failed" - succeeded = "Succeeded" - deleting = "Deleting" - migrating = "Migrating" + CREATING = "Creating" + UPDATING = "Updating" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + DELETING = "Deleting" + MIGRATING = "Migrating" -class GalleryPropertiesProvisioningState(str, Enum): +class GalleryPropertiesProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The provisioning state, which only appears in the response. """ - creating = "Creating" - updating = "Updating" - failed = "Failed" - succeeded = "Succeeded" - deleting = "Deleting" - migrating = "Migrating" + CREATING = "Creating" + UPDATING = "Updating" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + DELETING = "Deleting" + MIGRATING = "Migrating" -class HostCaching(str, Enum): +class HostCaching(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' """ - none = "None" - read_only = "ReadOnly" - read_write = "ReadWrite" + NONE = "None" + READ_ONLY = "ReadOnly" + READ_WRITE = "ReadWrite" -class HyperVGeneration(str, Enum): +class HyperVGeneration(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The hypervisor generation of the Virtual Machine. Applicable to OS disks only. """ - v1 = "V1" - v2 = "V2" + V1 = "V1" + V2 = "V2" -class HyperVGenerationType(str, Enum): +class HyperVGenerationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the HyperVGeneration Type associated with a resource """ - v1 = "V1" - v2 = "V2" + V1 = "V1" + V2 = "V2" -class HyperVGenerationTypes(str, Enum): +class HyperVGenerationTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the HyperVGeneration Type """ - v1 = "V1" - v2 = "V2" + V1 = "V1" + V2 = "V2" -class IntervalInMins(str, Enum): +class IntervalInMins(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Interval value in minutes used to create LogAnalytics call rate logs. """ - three_mins = "ThreeMins" - five_mins = "FiveMins" - thirty_mins = "ThirtyMins" - sixty_mins = "SixtyMins" + THREE_MINS = "ThreeMins" + FIVE_MINS = "FiveMins" + THIRTY_MINS = "ThirtyMins" + SIXTY_MINS = "SixtyMins" -class IPVersion(str, Enum): +class IPVersion(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. """ - i_pv4 = "IPv4" - i_pv6 = "IPv6" + I_PV4 = "IPv4" + I_PV6 = "IPv6" -class MaintenanceOperationResultCodeTypes(str, Enum): +class MaintenanceOperationResultCodeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The Last Maintenance Operation Result Code. """ - none = "None" - retry_later = "RetryLater" - maintenance_aborted = "MaintenanceAborted" - maintenance_completed = "MaintenanceCompleted" + NONE = "None" + RETRY_LATER = "RetryLater" + MAINTENANCE_ABORTED = "MaintenanceAborted" + MAINTENANCE_COMPLETED = "MaintenanceCompleted" -class OperatingSystemStateTypes(str, Enum): +class OperatingSystemStateTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The OS State. """ - generalized = "Generalized" #: Generalized image. Needs to be provisioned during deployment time. - specialized = "Specialized" #: Specialized image. Contains already provisioned OS Disk. + GENERALIZED = "Generalized" #: Generalized image. Needs to be provisioned during deployment time. + SPECIALIZED = "Specialized" #: Specialized image. Contains already provisioned OS Disk. -class OperatingSystemTypes(str, Enum): +class OperatingSystemTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The operating system of the osDiskImage. """ - windows = "Windows" - linux = "Linux" + WINDOWS = "Windows" + LINUX = "Linux" -class OrchestrationServiceState(str, Enum): +class OrchestrationServiceNames(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The name of the service. + """ + + AUTOMATIC_REPAIRS = "AutomaticRepairs" + DUMMY_ORCHESTRATION_SERVICE_NAME = "DummyOrchestrationServiceName" + +class OrchestrationServiceState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The current state of the service. """ - not_running = "NotRunning" - running = "Running" - suspended = "Suspended" + NOT_RUNNING = "NotRunning" + RUNNING = "Running" + SUSPENDED = "Suspended" -class OrchestrationServiceStateAction(str, Enum): +class OrchestrationServiceStateAction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The action to be performed. """ - resume = "Resume" - suspend = "Suspend" + RESUME = "Resume" + SUSPEND = "Suspend" -class ProtocolTypes(str, Enum): +class ProtocolTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the protocol of WinRM listener. :code:`
`:code:`
` Possible values are: :code:`
`\ **http** :code:`
`:code:`
` **https** """ - http = "Http" - https = "Https" + HTTP = "Http" + HTTPS = "Https" -class ProximityPlacementGroupType(str, Enum): +class ProximityPlacementGroupType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the type of the proximity placement group. :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **Standard** : Co-locate resources within an Azure region or Availability Zone. :code:`
`:code:`
` **Ultra** : For future use. """ - standard = "Standard" - ultra = "Ultra" + STANDARD = "Standard" + ULTRA = "Ultra" -class ReplicationState(str, Enum): +class ReplicationState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """This is the regional replication state. """ - unknown = "Unknown" - replicating = "Replicating" - completed = "Completed" - failed = "Failed" + UNKNOWN = "Unknown" + REPLICATING = "Replicating" + COMPLETED = "Completed" + FAILED = "Failed" + +class ReplicationStatusTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + REPLICATION_STATUS = "ReplicationStatus" -class ResourceIdentityType(str, Enum): +class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The type of identity used for the virtual machine. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine. """ - system_assigned = "SystemAssigned" - user_assigned = "UserAssigned" - system_assigned_user_assigned = "SystemAssigned, UserAssigned" - none = "None" + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned, UserAssigned" + NONE = "None" -class RollingUpgradeActionType(str, Enum): +class RollingUpgradeActionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The last action performed on the rolling upgrade. """ - start = "Start" - cancel = "Cancel" + START = "Start" + CANCEL = "Cancel" -class RollingUpgradeStatusCode(str, Enum): +class RollingUpgradeStatusCode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Code indicating the current status of the upgrade. """ - rolling_forward = "RollingForward" - cancelled = "Cancelled" - completed = "Completed" - faulted = "Faulted" + ROLLING_FORWARD = "RollingForward" + CANCELLED = "Cancelled" + COMPLETED = "Completed" + FAULTED = "Faulted" -class SettingNames(str, Enum): +class SettingNames(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon. """ - auto_logon = "AutoLogon" - first_logon_commands = "FirstLogonCommands" + AUTO_LOGON = "AutoLogon" + FIRST_LOGON_COMMANDS = "FirstLogonCommands" -class StatusLevelTypes(str, Enum): +class StatusLevelTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The level code. """ - info = "Info" - warning = "Warning" - error = "Error" + INFO = "Info" + WARNING = "Warning" + ERROR = "Error" -class StorageAccountType(str, Enum): +class StorageAccountType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the storage account type to be used to store the image. This property is not updatable. """ - standard_lrs = "Standard_LRS" - standard_zrs = "Standard_ZRS" - premium_lrs = "Premium_LRS" + STANDARD_LRS = "Standard_LRS" + STANDARD_ZRS = "Standard_ZRS" + PREMIUM_LRS = "Premium_LRS" -class StorageAccountTypes(str, Enum): +class StorageAccountTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the storage account type for the managed disk. Managed OS disk storage account type can only be set when you create the scale set. NOTE: UltraSSD_LRS can only be used with data disks. It cannot be used with OS Disk. Standard_LRS uses Standard HDD. StandardSSD_LRS uses @@ -290,12 +325,12 @@ class StorageAccountTypes(str, Enum): https://docs.microsoft.com/en-us/azure/virtual-machines/linux/disks-types """ - standard_lrs = "Standard_LRS" - premium_lrs = "Premium_LRS" - standard_ssd_lrs = "StandardSSD_LRS" - ultra_ssd_lrs = "UltraSSD_LRS" + STANDARD_LRS = "Standard_LRS" + PREMIUM_LRS = "Premium_LRS" + STANDARD_SSD_LRS = "StandardSSD_LRS" + ULTRA_SSD_LRS = "UltraSSD_LRS" -class UpgradeMode(str, Enum): +class UpgradeMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the mode of an upgrade to virtual machines in the scale set.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` **Manual** - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade @@ -303,58 +338,58 @@ class UpgradeMode(str, Enum): automatically updated at the same time. """ - automatic = "Automatic" - manual = "Manual" - rolling = "Rolling" + AUTOMATIC = "Automatic" + MANUAL = "Manual" + ROLLING = "Rolling" -class UpgradeOperationInvoker(str, Enum): +class UpgradeOperationInvoker(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Invoker of the Upgrade Operation """ - unknown = "Unknown" - user = "User" - platform = "Platform" + UNKNOWN = "Unknown" + USER = "User" + PLATFORM = "Platform" -class UpgradeState(str, Enum): +class UpgradeState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Code indicating the current status of the upgrade. """ - rolling_forward = "RollingForward" - cancelled = "Cancelled" - completed = "Completed" - faulted = "Faulted" + ROLLING_FORWARD = "RollingForward" + CANCELLED = "Cancelled" + COMPLETED = "Completed" + FAULTED = "Faulted" -class VirtualMachineEvictionPolicyTypes(str, Enum): +class VirtualMachineEvictionPolicyTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the eviction policy for the Azure Spot VM/VMSS """ - deallocate = "Deallocate" - delete = "Delete" + DEALLOCATE = "Deallocate" + DELETE = "Delete" -class VirtualMachinePriorityTypes(str, Enum): +class VirtualMachinePriorityTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the priority for a standalone virtual machine or the virtual machines in the scale set. :code:`
`:code:`
` 'Low' enum will be deprecated in the future, please use 'Spot' as the enum to deploy Azure Spot VM/VMSS. """ - regular = "Regular" - low = "Low" - spot = "Spot" + REGULAR = "Regular" + LOW = "Low" + SPOT = "Spot" -class VirtualMachineScaleSetScaleInRules(str, Enum): +class VirtualMachineScaleSetScaleInRules(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - default = "Default" - oldest_vm = "OldestVM" - newest_vm = "NewestVM" + DEFAULT = "Default" + OLDEST_VM = "OldestVM" + NEWEST_VM = "NewestVM" -class VirtualMachineScaleSetSkuScaleType(str, Enum): +class VirtualMachineScaleSetSkuScaleType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The scale type applicable to the sku. """ - automatic = "Automatic" - none = "None" + AUTOMATIC = "Automatic" + NONE = "None" -class VirtualMachineSizeTypes(str, Enum): +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 `_. @@ -368,169 +403,169 @@ class VirtualMachineSizeTypes(str, Enum): `_ """ - basic_a0 = "Basic_A0" - basic_a1 = "Basic_A1" - basic_a2 = "Basic_A2" - basic_a3 = "Basic_A3" - basic_a4 = "Basic_A4" - standard_a0 = "Standard_A0" - standard_a1 = "Standard_A1" - standard_a2 = "Standard_A2" - standard_a3 = "Standard_A3" - standard_a4 = "Standard_A4" - standard_a5 = "Standard_A5" - standard_a6 = "Standard_A6" - standard_a7 = "Standard_A7" - standard_a8 = "Standard_A8" - standard_a9 = "Standard_A9" - standard_a10 = "Standard_A10" - standard_a11 = "Standard_A11" - standard_a1_v2 = "Standard_A1_v2" - standard_a2_v2 = "Standard_A2_v2" - standard_a4_v2 = "Standard_A4_v2" - standard_a8_v2 = "Standard_A8_v2" - standard_a2_m_v2 = "Standard_A2m_v2" - standard_a4_m_v2 = "Standard_A4m_v2" - standard_a8_m_v2 = "Standard_A8m_v2" - standard_b1_s = "Standard_B1s" - standard_b1_ms = "Standard_B1ms" - standard_b2_s = "Standard_B2s" - standard_b2_ms = "Standard_B2ms" - standard_b4_ms = "Standard_B4ms" - standard_b8_ms = "Standard_B8ms" - standard_d1 = "Standard_D1" - standard_d2 = "Standard_D2" - standard_d3 = "Standard_D3" - standard_d4 = "Standard_D4" - standard_d11 = "Standard_D11" - standard_d12 = "Standard_D12" - standard_d13 = "Standard_D13" - standard_d14 = "Standard_D14" - standard_d1_v2 = "Standard_D1_v2" - standard_d2_v2 = "Standard_D2_v2" - standard_d3_v2 = "Standard_D3_v2" - standard_d4_v2 = "Standard_D4_v2" - standard_d5_v2 = "Standard_D5_v2" - standard_d2_v3 = "Standard_D2_v3" - standard_d4_v3 = "Standard_D4_v3" - standard_d8_v3 = "Standard_D8_v3" - standard_d16_v3 = "Standard_D16_v3" - standard_d32_v3 = "Standard_D32_v3" - standard_d64_v3 = "Standard_D64_v3" - standard_d2_s_v3 = "Standard_D2s_v3" - standard_d4_s_v3 = "Standard_D4s_v3" - standard_d8_s_v3 = "Standard_D8s_v3" - standard_d16_s_v3 = "Standard_D16s_v3" - standard_d32_s_v3 = "Standard_D32s_v3" - standard_d64_s_v3 = "Standard_D64s_v3" - standard_d11_v2 = "Standard_D11_v2" - standard_d12_v2 = "Standard_D12_v2" - standard_d13_v2 = "Standard_D13_v2" - standard_d14_v2 = "Standard_D14_v2" - standard_d15_v2 = "Standard_D15_v2" - standard_ds1 = "Standard_DS1" - standard_ds2 = "Standard_DS2" - standard_ds3 = "Standard_DS3" - standard_ds4 = "Standard_DS4" - standard_ds11 = "Standard_DS11" - standard_ds12 = "Standard_DS12" - standard_ds13 = "Standard_DS13" - standard_ds14 = "Standard_DS14" - standard_ds1_v2 = "Standard_DS1_v2" - standard_ds2_v2 = "Standard_DS2_v2" - standard_ds3_v2 = "Standard_DS3_v2" - standard_ds4_v2 = "Standard_DS4_v2" - standard_ds5_v2 = "Standard_DS5_v2" - standard_ds11_v2 = "Standard_DS11_v2" - standard_ds12_v2 = "Standard_DS12_v2" - standard_ds13_v2 = "Standard_DS13_v2" - standard_ds14_v2 = "Standard_DS14_v2" - standard_ds15_v2 = "Standard_DS15_v2" - standard_ds13_4_v2 = "Standard_DS13-4_v2" - standard_ds13_2_v2 = "Standard_DS13-2_v2" - standard_ds14_8_v2 = "Standard_DS14-8_v2" - standard_ds14_4_v2 = "Standard_DS14-4_v2" - standard_e2_v3 = "Standard_E2_v3" - standard_e4_v3 = "Standard_E4_v3" - standard_e8_v3 = "Standard_E8_v3" - standard_e16_v3 = "Standard_E16_v3" - standard_e32_v3 = "Standard_E32_v3" - standard_e64_v3 = "Standard_E64_v3" - standard_e2_s_v3 = "Standard_E2s_v3" - standard_e4_s_v3 = "Standard_E4s_v3" - standard_e8_s_v3 = "Standard_E8s_v3" - standard_e16_s_v3 = "Standard_E16s_v3" - standard_e32_s_v3 = "Standard_E32s_v3" - standard_e64_s_v3 = "Standard_E64s_v3" - standard_e32_16_v3 = "Standard_E32-16_v3" - standard_e32_8_s_v3 = "Standard_E32-8s_v3" - standard_e64_32_s_v3 = "Standard_E64-32s_v3" - standard_e64_16_s_v3 = "Standard_E64-16s_v3" - standard_f1 = "Standard_F1" - standard_f2 = "Standard_F2" - standard_f4 = "Standard_F4" - standard_f8 = "Standard_F8" - standard_f16 = "Standard_F16" - standard_f1_s = "Standard_F1s" - standard_f2_s = "Standard_F2s" - standard_f4_s = "Standard_F4s" - standard_f8_s = "Standard_F8s" - standard_f16_s = "Standard_F16s" - standard_f2_s_v2 = "Standard_F2s_v2" - standard_f4_s_v2 = "Standard_F4s_v2" - standard_f8_s_v2 = "Standard_F8s_v2" - standard_f16_s_v2 = "Standard_F16s_v2" - standard_f32_s_v2 = "Standard_F32s_v2" - standard_f64_s_v2 = "Standard_F64s_v2" - standard_f72_s_v2 = "Standard_F72s_v2" - standard_g1 = "Standard_G1" - standard_g2 = "Standard_G2" - standard_g3 = "Standard_G3" - standard_g4 = "Standard_G4" - standard_g5 = "Standard_G5" - standard_gs1 = "Standard_GS1" - standard_gs2 = "Standard_GS2" - standard_gs3 = "Standard_GS3" - standard_gs4 = "Standard_GS4" - standard_gs5 = "Standard_GS5" - standard_gs4_8 = "Standard_GS4-8" - standard_gs4_4 = "Standard_GS4-4" - standard_gs5_16 = "Standard_GS5-16" - standard_gs5_8 = "Standard_GS5-8" - standard_h8 = "Standard_H8" - standard_h16 = "Standard_H16" - standard_h8_m = "Standard_H8m" - standard_h16_m = "Standard_H16m" - standard_h16_r = "Standard_H16r" - standard_h16_mr = "Standard_H16mr" - standard_l4_s = "Standard_L4s" - standard_l8_s = "Standard_L8s" - standard_l16_s = "Standard_L16s" - standard_l32_s = "Standard_L32s" - standard_m64_s = "Standard_M64s" - standard_m64_ms = "Standard_M64ms" - standard_m128_s = "Standard_M128s" - standard_m128_ms = "Standard_M128ms" - standard_m64_32_ms = "Standard_M64-32ms" - standard_m64_16_ms = "Standard_M64-16ms" - standard_m128_64_ms = "Standard_M128-64ms" - standard_m128_32_ms = "Standard_M128-32ms" - standard_nc6 = "Standard_NC6" - standard_nc12 = "Standard_NC12" - standard_nc24 = "Standard_NC24" - standard_nc24_r = "Standard_NC24r" - standard_nc6_s_v2 = "Standard_NC6s_v2" - standard_nc12_s_v2 = "Standard_NC12s_v2" - standard_nc24_s_v2 = "Standard_NC24s_v2" - standard_nc24_rs_v2 = "Standard_NC24rs_v2" - standard_nc6_s_v3 = "Standard_NC6s_v3" - standard_nc12_s_v3 = "Standard_NC12s_v3" - standard_nc24_s_v3 = "Standard_NC24s_v3" - standard_nc24_rs_v3 = "Standard_NC24rs_v3" - standard_nd6_s = "Standard_ND6s" - standard_nd12_s = "Standard_ND12s" - standard_nd24_s = "Standard_ND24s" - standard_nd24_rs = "Standard_ND24rs" - standard_nv6 = "Standard_NV6" - standard_nv12 = "Standard_NV12" - standard_nv24 = "Standard_NV24" + BASIC_A0 = "Basic_A0" + BASIC_A1 = "Basic_A1" + BASIC_A2 = "Basic_A2" + BASIC_A3 = "Basic_A3" + BASIC_A4 = "Basic_A4" + STANDARD_A0 = "Standard_A0" + STANDARD_A1 = "Standard_A1" + STANDARD_A2 = "Standard_A2" + STANDARD_A3 = "Standard_A3" + STANDARD_A4 = "Standard_A4" + STANDARD_A5 = "Standard_A5" + STANDARD_A6 = "Standard_A6" + STANDARD_A7 = "Standard_A7" + STANDARD_A8 = "Standard_A8" + STANDARD_A9 = "Standard_A9" + STANDARD_A10 = "Standard_A10" + STANDARD_A11 = "Standard_A11" + STANDARD_A1_V2 = "Standard_A1_v2" + STANDARD_A2_V2 = "Standard_A2_v2" + STANDARD_A4_V2 = "Standard_A4_v2" + STANDARD_A8_V2 = "Standard_A8_v2" + STANDARD_A2_M_V2 = "Standard_A2m_v2" + STANDARD_A4_M_V2 = "Standard_A4m_v2" + STANDARD_A8_M_V2 = "Standard_A8m_v2" + STANDARD_B1_S = "Standard_B1s" + STANDARD_B1_MS = "Standard_B1ms" + STANDARD_B2_S = "Standard_B2s" + STANDARD_B2_MS = "Standard_B2ms" + STANDARD_B4_MS = "Standard_B4ms" + STANDARD_B8_MS = "Standard_B8ms" + STANDARD_D1 = "Standard_D1" + STANDARD_D2 = "Standard_D2" + STANDARD_D3 = "Standard_D3" + STANDARD_D4 = "Standard_D4" + STANDARD_D11 = "Standard_D11" + STANDARD_D12 = "Standard_D12" + STANDARD_D13 = "Standard_D13" + STANDARD_D14 = "Standard_D14" + STANDARD_D1_V2 = "Standard_D1_v2" + STANDARD_D2_V2 = "Standard_D2_v2" + STANDARD_D3_V2 = "Standard_D3_v2" + STANDARD_D4_V2 = "Standard_D4_v2" + STANDARD_D5_V2 = "Standard_D5_v2" + STANDARD_D2_V3 = "Standard_D2_v3" + STANDARD_D4_V3 = "Standard_D4_v3" + STANDARD_D8_V3 = "Standard_D8_v3" + STANDARD_D16_V3 = "Standard_D16_v3" + STANDARD_D32_V3 = "Standard_D32_v3" + STANDARD_D64_V3 = "Standard_D64_v3" + STANDARD_D2_S_V3 = "Standard_D2s_v3" + STANDARD_D4_S_V3 = "Standard_D4s_v3" + STANDARD_D8_S_V3 = "Standard_D8s_v3" + STANDARD_D16_S_V3 = "Standard_D16s_v3" + STANDARD_D32_S_V3 = "Standard_D32s_v3" + STANDARD_D64_S_V3 = "Standard_D64s_v3" + STANDARD_D11_V2 = "Standard_D11_v2" + STANDARD_D12_V2 = "Standard_D12_v2" + STANDARD_D13_V2 = "Standard_D13_v2" + STANDARD_D14_V2 = "Standard_D14_v2" + STANDARD_D15_V2 = "Standard_D15_v2" + STANDARD_DS1 = "Standard_DS1" + STANDARD_DS2 = "Standard_DS2" + STANDARD_DS3 = "Standard_DS3" + STANDARD_DS4 = "Standard_DS4" + STANDARD_DS11 = "Standard_DS11" + STANDARD_DS12 = "Standard_DS12" + STANDARD_DS13 = "Standard_DS13" + STANDARD_DS14 = "Standard_DS14" + STANDARD_DS1_V2 = "Standard_DS1_v2" + STANDARD_DS2_V2 = "Standard_DS2_v2" + STANDARD_DS3_V2 = "Standard_DS3_v2" + STANDARD_DS4_V2 = "Standard_DS4_v2" + STANDARD_DS5_V2 = "Standard_DS5_v2" + STANDARD_DS11_V2 = "Standard_DS11_v2" + STANDARD_DS12_V2 = "Standard_DS12_v2" + STANDARD_DS13_V2 = "Standard_DS13_v2" + STANDARD_DS14_V2 = "Standard_DS14_v2" + STANDARD_DS15_V2 = "Standard_DS15_v2" + STANDARD_DS13_4_V2 = "Standard_DS13-4_v2" + STANDARD_DS13_2_V2 = "Standard_DS13-2_v2" + STANDARD_DS14_8_V2 = "Standard_DS14-8_v2" + STANDARD_DS14_4_V2 = "Standard_DS14-4_v2" + STANDARD_E2_V3 = "Standard_E2_v3" + STANDARD_E4_V3 = "Standard_E4_v3" + STANDARD_E8_V3 = "Standard_E8_v3" + STANDARD_E16_V3 = "Standard_E16_v3" + STANDARD_E32_V3 = "Standard_E32_v3" + STANDARD_E64_V3 = "Standard_E64_v3" + STANDARD_E2_S_V3 = "Standard_E2s_v3" + STANDARD_E4_S_V3 = "Standard_E4s_v3" + STANDARD_E8_S_V3 = "Standard_E8s_v3" + STANDARD_E16_S_V3 = "Standard_E16s_v3" + STANDARD_E32_S_V3 = "Standard_E32s_v3" + STANDARD_E64_S_V3 = "Standard_E64s_v3" + STANDARD_E32_16_V3 = "Standard_E32-16_v3" + STANDARD_E32_8_S_V3 = "Standard_E32-8s_v3" + STANDARD_E64_32_S_V3 = "Standard_E64-32s_v3" + STANDARD_E64_16_S_V3 = "Standard_E64-16s_v3" + STANDARD_F1 = "Standard_F1" + STANDARD_F2 = "Standard_F2" + STANDARD_F4 = "Standard_F4" + STANDARD_F8 = "Standard_F8" + STANDARD_F16 = "Standard_F16" + STANDARD_F1_S = "Standard_F1s" + STANDARD_F2_S = "Standard_F2s" + STANDARD_F4_S = "Standard_F4s" + STANDARD_F8_S = "Standard_F8s" + STANDARD_F16_S = "Standard_F16s" + STANDARD_F2_S_V2 = "Standard_F2s_v2" + STANDARD_F4_S_V2 = "Standard_F4s_v2" + STANDARD_F8_S_V2 = "Standard_F8s_v2" + STANDARD_F16_S_V2 = "Standard_F16s_v2" + STANDARD_F32_S_V2 = "Standard_F32s_v2" + STANDARD_F64_S_V2 = "Standard_F64s_v2" + STANDARD_F72_S_V2 = "Standard_F72s_v2" + STANDARD_G1 = "Standard_G1" + STANDARD_G2 = "Standard_G2" + STANDARD_G3 = "Standard_G3" + STANDARD_G4 = "Standard_G4" + STANDARD_G5 = "Standard_G5" + STANDARD_GS1 = "Standard_GS1" + STANDARD_GS2 = "Standard_GS2" + STANDARD_GS3 = "Standard_GS3" + STANDARD_GS4 = "Standard_GS4" + STANDARD_GS5 = "Standard_GS5" + STANDARD_GS4_8 = "Standard_GS4-8" + STANDARD_GS4_4 = "Standard_GS4-4" + STANDARD_GS5_16 = "Standard_GS5-16" + STANDARD_GS5_8 = "Standard_GS5-8" + STANDARD_H8 = "Standard_H8" + STANDARD_H16 = "Standard_H16" + STANDARD_H8_M = "Standard_H8m" + STANDARD_H16_M = "Standard_H16m" + STANDARD_H16_R = "Standard_H16r" + STANDARD_H16_MR = "Standard_H16mr" + STANDARD_L4_S = "Standard_L4s" + STANDARD_L8_S = "Standard_L8s" + STANDARD_L16_S = "Standard_L16s" + STANDARD_L32_S = "Standard_L32s" + STANDARD_M64_S = "Standard_M64s" + STANDARD_M64_MS = "Standard_M64ms" + STANDARD_M128_S = "Standard_M128s" + STANDARD_M128_MS = "Standard_M128ms" + STANDARD_M64_32_MS = "Standard_M64-32ms" + STANDARD_M64_16_MS = "Standard_M64-16ms" + STANDARD_M128_64_MS = "Standard_M128-64ms" + STANDARD_M128_32_MS = "Standard_M128-32ms" + STANDARD_NC6 = "Standard_NC6" + STANDARD_NC12 = "Standard_NC12" + STANDARD_NC24 = "Standard_NC24" + STANDARD_NC24_R = "Standard_NC24r" + STANDARD_NC6_S_V2 = "Standard_NC6s_v2" + STANDARD_NC12_S_V2 = "Standard_NC12s_v2" + STANDARD_NC24_S_V2 = "Standard_NC24s_v2" + STANDARD_NC24_RS_V2 = "Standard_NC24rs_v2" + STANDARD_NC6_S_V3 = "Standard_NC6s_v3" + STANDARD_NC12_S_V3 = "Standard_NC12s_v3" + STANDARD_NC24_S_V3 = "Standard_NC24s_v3" + STANDARD_NC24_RS_V3 = "Standard_NC24rs_v3" + STANDARD_ND6_S = "Standard_ND6s" + STANDARD_ND12_S = "Standard_ND12s" + STANDARD_ND24_S = "Standard_ND24s" + STANDARD_ND24_RS = "Standard_ND24rs" + STANDARD_NV6 = "Standard_NV6" + STANDARD_NV12 = "Standard_NV12" + STANDARD_NV24 = "Standard_NV24" 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 a3904b97f495..42c40844b160 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 @@ -1272,11 +1272,9 @@ def __init__( class DiffDiskSettings(msrest.serialization.Model): """Describes the parameters of ephemeral disk settings that can be specified for operating system disk. :code:`
`:code:`
` NOTE: The ephemeral disk settings can only be specified for managed disk. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar option: Specifies the ephemeral disk settings for operating system disk. Default value: - "Local". - :vartype option: str + :param option: Specifies the ephemeral disk settings for operating system disk. Possible values + include: "Local". + :type option: str or ~azure.mgmt.compute.v2019_12_01.models.DiffDiskOptions :param placement: Specifies the ephemeral disk placement for operating system disk.:code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **CacheDisk** :code:`
`:code:`
` **ResourceDisk** :code:`
`:code:`
` Default: **CacheDisk** if @@ -1288,22 +1286,17 @@ class DiffDiskSettings(msrest.serialization.Model): :type placement: str or ~azure.mgmt.compute.v2019_12_01.models.DiffDiskPlacement """ - _validation = { - 'option': {'constant': True}, - } - _attribute_map = { 'option': {'key': 'option', 'type': 'str'}, 'placement': {'key': 'placement', 'type': 'str'}, } - option = "Local" - def __init__( self, **kwargs ): super(DiffDiskSettings, self).__init__(**kwargs) + self.option = kwargs.get('option', None) self.placement = kwargs.get('placement', None) @@ -3607,19 +3600,18 @@ def __init__( class OrchestrationServiceStateInput(msrest.serialization.Model): """The input for OrchestrationServiceState. - 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 service_name: Required. The name of the service. Default value: "AutomaticRepairs". - :vartype service_name: str + :param service_name: Required. The name of the service. Possible values include: + "AutomaticRepairs", "DummyOrchestrationServiceName". + :type service_name: str or ~azure.mgmt.compute.v2019_12_01.models.OrchestrationServiceNames :param action: Required. The action to be performed. Possible values include: "Resume", "Suspend". :type action: str or ~azure.mgmt.compute.v2019_12_01.models.OrchestrationServiceStateAction """ _validation = { - 'service_name': {'required': True, 'constant': True}, + 'service_name': {'required': True}, 'action': {'required': True}, } @@ -3628,13 +3620,12 @@ class OrchestrationServiceStateInput(msrest.serialization.Model): 'action': {'key': 'action', 'type': 'str'}, } - service_name = "AutomaticRepairs" - def __init__( self, **kwargs ): super(OrchestrationServiceStateInput, self).__init__(**kwargs) + self.service_name = kwargs['service_name'] self.action = kwargs['action'] @@ -3643,15 +3634,16 @@ class OrchestrationServiceSummary(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar service_name: The name of the service. Default value: "AutomaticRepairs". - :vartype service_name: str + :ivar service_name: The name of the service. Possible values include: "AutomaticRepairs", + "DummyOrchestrationServiceName". + :vartype service_name: str or ~azure.mgmt.compute.v2019_12_01.models.OrchestrationServiceNames :ivar service_state: The current state of the service. Possible values include: "NotRunning", "Running", "Suspended". :vartype service_state: str or ~azure.mgmt.compute.v2019_12_01.models.OrchestrationServiceState """ _validation = { - 'service_name': {'readonly': True, 'constant': True}, + 'service_name': {'readonly': True}, 'service_state': {'readonly': True}, } @@ -3660,8 +3652,6 @@ class OrchestrationServiceSummary(msrest.serialization.Model): 'service_state': {'key': 'serviceState', 'type': 'str'}, } - service_name = "AutomaticRepairs" - def __init__( self, **kwargs @@ -5650,8 +5640,8 @@ class VirtualMachine(Resource): "Low", "Spot". :type priority: str or ~azure.mgmt.compute.v2019_12_01.models.VirtualMachinePriorityTypes :param eviction_policy: Specifies the eviction policy for the Azure Spot virtual machine and - Azure Spot scale set. :code:`
`:code:`
`For Azure Spot virtual machines, the only - supported value is 'Deallocate' and the minimum api-version is 2019-03-01. + Azure Spot scale set. :code:`
`:code:`
`For Azure Spot virtual machines, both + 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01. :code:`
`:code:`
`For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. Possible values include: "Deallocate", "Delete". @@ -6978,12 +6968,12 @@ class VirtualMachineScaleSetIPConfiguration(SubResource): :type application_security_groups: list[~azure.mgmt.compute.v2019_12_01.models.SubResource] :param load_balancer_backend_address_pools: Specifies an array of references to backend address pools of load balancers. A scale set can reference backend address pools of one public and one - internal load balancer. Multiple scale sets cannot use the same load balancer. + internal load balancer. Multiple scale sets cannot use the same basic sku load balancer. :type load_balancer_backend_address_pools: list[~azure.mgmt.compute.v2019_12_01.models.SubResource] :param load_balancer_inbound_nat_pools: Specifies an array of references to inbound Nat pools of the load balancers. A scale set can reference inbound nat pools of one public and one - internal load balancer. Multiple scale sets cannot use the same load balancer. + internal load balancer. Multiple scale sets cannot use the same basic sku load balancer. :type load_balancer_inbound_nat_pools: list[~azure.mgmt.compute.v2019_12_01.models.SubResource] """ @@ -8462,8 +8452,8 @@ class VirtualMachineScaleSetVMProfile(msrest.serialization.Model): "Regular", "Low", "Spot". :type priority: str or ~azure.mgmt.compute.v2019_12_01.models.VirtualMachinePriorityTypes :param eviction_policy: Specifies the eviction policy for the Azure Spot virtual machine and - Azure Spot scale set. :code:`
`:code:`
`For Azure Spot virtual machines, the only - supported value is 'Deallocate' and the minimum api-version is 2019-03-01. + Azure Spot scale set. :code:`
`:code:`
`For Azure Spot virtual machines, both + 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01. :code:`
`:code:`
`For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. Possible values include: "Deallocate", "Delete". @@ -8705,8 +8695,8 @@ class VirtualMachineUpdate(UpdateResource): "Low", "Spot". :type priority: str or ~azure.mgmt.compute.v2019_12_01.models.VirtualMachinePriorityTypes :param eviction_policy: Specifies the eviction policy for the Azure Spot virtual machine and - Azure Spot scale set. :code:`
`:code:`
`For Azure Spot virtual machines, the only - supported value is 'Deallocate' and the minimum api-version is 2019-03-01. + Azure Spot scale set. :code:`
`:code:`
`For Azure Spot virtual machines, both + 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01. :code:`
`:code:`
`For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. Possible values include: "Deallocate", "Delete". 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 a85bcc9ad131..8bb5a9df1c66 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 @@ -1383,11 +1383,9 @@ def __init__( class DiffDiskSettings(msrest.serialization.Model): """Describes the parameters of ephemeral disk settings that can be specified for operating system disk. :code:`
`:code:`
` NOTE: The ephemeral disk settings can only be specified for managed disk. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar option: Specifies the ephemeral disk settings for operating system disk. Default value: - "Local". - :vartype option: str + :param option: Specifies the ephemeral disk settings for operating system disk. Possible values + include: "Local". + :type option: str or ~azure.mgmt.compute.v2019_12_01.models.DiffDiskOptions :param placement: Specifies the ephemeral disk placement for operating system disk.:code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **CacheDisk** :code:`
`:code:`
` **ResourceDisk** :code:`
`:code:`
` Default: **CacheDisk** if @@ -1399,24 +1397,20 @@ class DiffDiskSettings(msrest.serialization.Model): :type placement: str or ~azure.mgmt.compute.v2019_12_01.models.DiffDiskPlacement """ - _validation = { - 'option': {'constant': True}, - } - _attribute_map = { 'option': {'key': 'option', 'type': 'str'}, 'placement': {'key': 'placement', 'type': 'str'}, } - option = "Local" - def __init__( self, *, + option: Optional[Union[str, "DiffDiskOptions"]] = None, placement: Optional[Union[str, "DiffDiskPlacement"]] = None, **kwargs ): super(DiffDiskSettings, self).__init__(**kwargs) + self.option = option self.placement = placement @@ -3973,19 +3967,18 @@ def __init__( class OrchestrationServiceStateInput(msrest.serialization.Model): """The input for OrchestrationServiceState. - 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 service_name: Required. The name of the service. Default value: "AutomaticRepairs". - :vartype service_name: str + :param service_name: Required. The name of the service. Possible values include: + "AutomaticRepairs", "DummyOrchestrationServiceName". + :type service_name: str or ~azure.mgmt.compute.v2019_12_01.models.OrchestrationServiceNames :param action: Required. The action to be performed. Possible values include: "Resume", "Suspend". :type action: str or ~azure.mgmt.compute.v2019_12_01.models.OrchestrationServiceStateAction """ _validation = { - 'service_name': {'required': True, 'constant': True}, + 'service_name': {'required': True}, 'action': {'required': True}, } @@ -3994,15 +3987,15 @@ class OrchestrationServiceStateInput(msrest.serialization.Model): 'action': {'key': 'action', 'type': 'str'}, } - service_name = "AutomaticRepairs" - def __init__( self, *, + service_name: Union[str, "OrchestrationServiceNames"], action: Union[str, "OrchestrationServiceStateAction"], **kwargs ): super(OrchestrationServiceStateInput, self).__init__(**kwargs) + self.service_name = service_name self.action = action @@ -4011,15 +4004,16 @@ class OrchestrationServiceSummary(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar service_name: The name of the service. Default value: "AutomaticRepairs". - :vartype service_name: str + :ivar service_name: The name of the service. Possible values include: "AutomaticRepairs", + "DummyOrchestrationServiceName". + :vartype service_name: str or ~azure.mgmt.compute.v2019_12_01.models.OrchestrationServiceNames :ivar service_state: The current state of the service. Possible values include: "NotRunning", "Running", "Suspended". :vartype service_state: str or ~azure.mgmt.compute.v2019_12_01.models.OrchestrationServiceState """ _validation = { - 'service_name': {'readonly': True, 'constant': True}, + 'service_name': {'readonly': True}, 'service_state': {'readonly': True}, } @@ -4028,8 +4022,6 @@ class OrchestrationServiceSummary(msrest.serialization.Model): 'service_state': {'key': 'serviceState', 'type': 'str'}, } - service_name = "AutomaticRepairs" - def __init__( self, **kwargs @@ -6187,8 +6179,8 @@ class VirtualMachine(Resource): "Low", "Spot". :type priority: str or ~azure.mgmt.compute.v2019_12_01.models.VirtualMachinePriorityTypes :param eviction_policy: Specifies the eviction policy for the Azure Spot virtual machine and - Azure Spot scale set. :code:`
`:code:`
`For Azure Spot virtual machines, the only - supported value is 'Deallocate' and the minimum api-version is 2019-03-01. + Azure Spot scale set. :code:`
`:code:`
`For Azure Spot virtual machines, both + 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01. :code:`
`:code:`
`For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. Possible values include: "Deallocate", "Delete". @@ -7679,12 +7671,12 @@ class VirtualMachineScaleSetIPConfiguration(SubResource): :type application_security_groups: list[~azure.mgmt.compute.v2019_12_01.models.SubResource] :param load_balancer_backend_address_pools: Specifies an array of references to backend address pools of load balancers. A scale set can reference backend address pools of one public and one - internal load balancer. Multiple scale sets cannot use the same load balancer. + internal load balancer. Multiple scale sets cannot use the same basic sku load balancer. :type load_balancer_backend_address_pools: list[~azure.mgmt.compute.v2019_12_01.models.SubResource] :param load_balancer_inbound_nat_pools: Specifies an array of references to inbound Nat pools of the load balancers. A scale set can reference inbound nat pools of one public and one - internal load balancer. Multiple scale sets cannot use the same load balancer. + internal load balancer. Multiple scale sets cannot use the same basic sku load balancer. :type load_balancer_inbound_nat_pools: list[~azure.mgmt.compute.v2019_12_01.models.SubResource] """ @@ -9341,8 +9333,8 @@ class VirtualMachineScaleSetVMProfile(msrest.serialization.Model): "Regular", "Low", "Spot". :type priority: str or ~azure.mgmt.compute.v2019_12_01.models.VirtualMachinePriorityTypes :param eviction_policy: Specifies the eviction policy for the Azure Spot virtual machine and - Azure Spot scale set. :code:`
`:code:`
`For Azure Spot virtual machines, the only - supported value is 'Deallocate' and the minimum api-version is 2019-03-01. + Azure Spot scale set. :code:`
`:code:`
`For Azure Spot virtual machines, both + 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01. :code:`
`:code:`
`For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. Possible values include: "Deallocate", "Delete". @@ -9609,8 +9601,8 @@ class VirtualMachineUpdate(UpdateResource): "Low", "Spot". :type priority: str or ~azure.mgmt.compute.v2019_12_01.models.VirtualMachinePriorityTypes :param eviction_policy: Specifies the eviction policy for the Azure Spot virtual machine and - Azure Spot scale set. :code:`
`:code:`
`For Azure Spot virtual machines, the only - supported value is 'Deallocate' and the minimum api-version is 2019-03-01. + Azure Spot scale set. :code:`
`:code:`
`For Azure Spot virtual machines, both + 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01. :code:`
`:code:`
`For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. Possible values include: "Deallocate", "Delete". diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_availability_sets_operations.py index 85f8be2c3b72..760f9f15cf23 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_availability_sets_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -67,10 +67,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -88,14 +91,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailabilitySet') 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 @@ -133,10 +134,13 @@ def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -154,14 +158,12 @@ def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailabilitySetUpdate') 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 @@ -196,7 +198,9 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -216,7 +220,6 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,9 +252,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -268,9 +274,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -295,7 +300,8 @@ def list_by_subscription( # type: (...) -> Iterable["models.AvailabilitySetListResult"] """Lists all availability sets in a subscription. - :param expand: The expand expression to apply to the operation. + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AvailabilitySetListResult or the result of cls(response) @@ -303,11 +309,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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_subscription.metadata['url'] # type: ignore @@ -321,15 +334,11 @@ def prepare_request(next_link=None): if expand is not None: query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -372,11 +381,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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 @@ -389,15 +405,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -432,7 +444,7 @@ def list_available_sizes( ): # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes that can be used to create a new virtual machine in - an existing availability set. + an existing availability set. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -444,11 +456,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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_available_sizes.metadata['url'] # type: ignore @@ -462,15 +481,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_dedicated_host_groups_operations.py index 957d5b3410a7..c49668eaed55 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_dedicated_host_groups_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -69,10 +69,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -90,14 +93,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DedicatedHostGroup') 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 @@ -105,7 +106,6 @@ def create_or_update( 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('DedicatedHostGroup', pipeline_response) @@ -140,10 +140,13 @@ def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -161,14 +164,12 @@ def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DedicatedHostGroupUpdate') 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 @@ -203,7 +204,9 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -223,7 +226,6 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,9 +258,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -275,9 +280,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -301,7 +305,7 @@ def list_by_resource_group( ): # type: (...) -> Iterable["models.DedicatedHostGroupListResult"] """Lists all of the dedicated host groups in the specified resource group. Use the nextLink - property in the response to get the next page of dedicated host groups. + property in the response to get the next page of dedicated host groups. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -311,11 +315,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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 @@ -328,15 +339,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -369,7 +376,7 @@ def list_by_subscription( ): # type: (...) -> Iterable["models.DedicatedHostGroupListResult"] """Lists all of the dedicated host groups in the subscription. Use the nextLink property in the - response to get the next page of dedicated host groups. + response to get the next page of dedicated host groups. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DedicatedHostGroupListResult or the result of cls(response) @@ -377,11 +384,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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_subscription.metadata['url'] # type: ignore @@ -393,15 +407,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_dedicated_hosts_operations.py index 06fc0039d14d..a9f0a02df5d3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_dedicated_hosts_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -57,10 +57,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.DedicatedHost" cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -79,14 +82,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DedicatedHost') 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 @@ -94,7 +95,6 @@ def _create_or_update_initial( 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('DedicatedHost', pipeline_response) @@ -115,7 +115,7 @@ def begin_create_or_update( parameters, # type: "models.DedicatedHost" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DedicatedHost"] """Create or update a dedicated host . :param resource_group_name: The name of the resource group. @@ -187,10 +187,13 @@ def _update_initial( ): # type: (...) -> "models.DedicatedHost" cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -209,14 +212,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DedicatedHostUpdate') 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 @@ -240,7 +241,7 @@ def begin_update( parameters, # type: "models.DedicatedHostUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DedicatedHost"] """Update an dedicated host . :param resource_group_name: The name of the resource group. @@ -311,7 +312,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -332,7 +335,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -353,7 +355,7 @@ def begin_delete( host_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Delete a dedicated host. :param resource_group_name: The name of the resource group. @@ -434,9 +436,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -456,9 +461,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -483,7 +487,7 @@ def list_by_host_group( ): # type: (...) -> Iterable["models.DedicatedHostListResult"] """Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink - property in the response to get the next page of dedicated hosts. + property in the response to get the next page of dedicated hosts. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -495,11 +499,18 @@ def list_by_host_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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_host_group.metadata['url'] # type: ignore @@ -513,15 +524,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_galleries_operations.py index f30afb5b4f52..aa918a42b34d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_galleries_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.Gallery" cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery, 'Gallery') 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('Gallery', pipeline_response) @@ -115,13 +115,13 @@ def begin_create_or_update( gallery, # type: "models.Gallery" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Gallery"] """Create or update a Shared Image Gallery. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery. The allowed characters are alphabets - and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. + and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. :type gallery_name: str :param gallery: Parameters supplied to the create or update Shared Image Gallery operation. :type gallery: ~azure.mgmt.compute.v2019_12_01.models.Gallery @@ -184,10 +184,13 @@ def _update_initial( ): # type: (...) -> "models.Gallery" cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -205,14 +208,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery, 'GalleryUpdate') 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 @@ -235,13 +236,13 @@ def begin_update( gallery, # type: "models.GalleryUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Gallery"] """Update a Shared Image Gallery. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery. The allowed characters are alphabets - and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. + and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. :type gallery_name: str :param gallery: Parameters supplied to the update Shared Image Gallery operation. :type gallery: ~azure.mgmt.compute.v2019_12_01.models.GalleryUpdate @@ -314,9 +315,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -333,9 +337,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -360,9 +363,12 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -379,8 +385,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -400,7 +406,7 @@ def begin_delete( gallery_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Delete a Shared Image Gallery. :param resource_group_name: The name of the resource group. @@ -469,11 +475,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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 @@ -486,15 +499,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -534,11 +543,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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 @@ -550,15 +566,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_application_versions_operations.py index cd8282bab763..71ba90003b63 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_application_versions_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -58,10 +58,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.GalleryApplicationVersion" cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -81,14 +84,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_application_version, 'GalleryApplicationVersion') 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 @@ -96,7 +97,6 @@ def _create_or_update_initial( 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('GalleryApplicationVersion', pipeline_response) @@ -121,24 +121,24 @@ def begin_create_or_update( gallery_application_version, # type: "models.GalleryApplicationVersion" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GalleryApplicationVersion"] """Create or update a gallery Application Version. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. + Definition resides. :type gallery_name: str :param gallery_application_name: The name of the gallery Application Definition in which the - Application Version is to be created. + Application Version is to be created. :type gallery_application_name: str :param gallery_application_version_name: The name of the gallery Application Version to be - created. Needs to follow semantic version name pattern: The allowed characters are digit and - period. Digits must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. + created. Needs to follow semantic version name pattern: The allowed characters are digit and + period. Digits must be within the range of a 32-bit integer. Format: + :code:``.:code:``.:code:``. :type gallery_application_version_name: str :param gallery_application_version: Parameters supplied to the create or update gallery - Application Version operation. + Application Version operation. :type gallery_application_version: ~azure.mgmt.compute.v2019_12_01.models.GalleryApplicationVersion :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. @@ -203,10 +203,13 @@ def _update_initial( ): # type: (...) -> "models.GalleryApplicationVersion" cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -226,14 +229,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_application_version, 'GalleryApplicationVersionUpdate') 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 @@ -258,24 +259,24 @@ def begin_update( gallery_application_version, # type: "models.GalleryApplicationVersionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GalleryApplicationVersion"] """Update a gallery Application Version. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. + Definition resides. :type gallery_name: str :param gallery_application_name: The name of the gallery Application Definition in which the - Application Version is to be updated. + Application Version is to be updated. :type gallery_application_name: str :param gallery_application_version_name: The name of the gallery Application Version to be - updated. Needs to follow semantic version name pattern: The allowed characters are digit and - period. Digits must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. + updated. Needs to follow semantic version name pattern: The allowed characters are digit and + period. Digits must be within the range of a 32-bit integer. Format: + :code:``.:code:``.:code:``. :type gallery_application_version_name: str :param gallery_application_version: Parameters supplied to the update gallery Application - Version operation. + Version operation. :type gallery_application_version: ~azure.mgmt.compute.v2019_12_01.models.GalleryApplicationVersionUpdate :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. @@ -335,7 +336,7 @@ def get( gallery_name, # type: str gallery_application_name, # type: str gallery_application_version_name, # type: str - expand="ReplicationStatus", # type: Optional[str] + expand=None, # type: Optional[Union[str, "models.ReplicationStatusTypes"]] **kwargs # type: Any ): # type: (...) -> "models.GalleryApplicationVersion" @@ -353,16 +354,19 @@ def get( retrieved. :type gallery_application_version_name: str :param expand: The expand expression to apply on the operation. - :type expand: str + :type expand: str or ~azure.mgmt.compute.v2019_12_01.models.ReplicationStatusTypes :keyword callable cls: A custom type or function that will be passed the direct response :return: GalleryApplicationVersion, or the result of cls(response) :rtype: ~azure.mgmt.compute.v2019_12_01.models.GalleryApplicationVersion :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -383,9 +387,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -412,9 +415,12 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -433,8 +439,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -456,19 +462,19 @@ def begin_delete( gallery_application_version_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Delete a gallery Application Version. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. + Definition resides. :type gallery_name: str :param gallery_application_name: The name of the gallery Application Definition in which the - Application Version resides. + Application Version resides. :type gallery_application_name: str :param gallery_application_version_name: The name of the gallery Application Version to be - deleted. + deleted. :type gallery_application_version_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. @@ -531,10 +537,10 @@ def list_by_gallery_application( :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. + Definition resides. :type gallery_name: str :param gallery_application_name: The name of the Shared Application Gallery Application - Definition from which the Application Versions are to be listed. + Definition from which the Application Versions are to be listed. :type gallery_application_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GalleryApplicationVersionList or the result of cls(response) @@ -542,11 +548,18 @@ def list_by_gallery_application( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersionList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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_gallery_application.metadata['url'] # type: ignore @@ -561,15 +574,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_applications_operations.py index 07366638b0e0..24fdc771c531 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_applications_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -57,10 +57,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.GalleryApplication" cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -79,14 +82,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_application, 'GalleryApplication') 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 @@ -94,7 +95,6 @@ def _create_or_update_initial( 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('GalleryApplication', pipeline_response) @@ -118,20 +118,20 @@ def begin_create_or_update( gallery_application, # type: "models.GalleryApplication" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GalleryApplication"] """Create or update a gallery Application Definition. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition is to be created. + Definition is to be created. :type gallery_name: str :param gallery_application_name: The name of the gallery Application Definition to be created - or updated. The allowed characters are alphabets and numbers with dots, dashes, and periods - allowed in the middle. The maximum length is 80 characters. + or updated. The allowed characters are alphabets and numbers with dots, dashes, and periods + allowed in the middle. The maximum length is 80 characters. :type gallery_application_name: str :param gallery_application: Parameters supplied to the create or update gallery Application - operation. + operation. :type gallery_application: ~azure.mgmt.compute.v2019_12_01.models.GalleryApplication :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. @@ -194,10 +194,13 @@ def _update_initial( ): # type: (...) -> "models.GalleryApplication" cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -216,14 +219,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_application, 'GalleryApplicationUpdate') 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 @@ -247,17 +248,17 @@ def begin_update( gallery_application, # type: "models.GalleryApplicationUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GalleryApplication"] """Update a gallery Application Definition. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition is to be updated. + Definition is to be updated. :type gallery_name: str :param gallery_application_name: The name of the gallery Application Definition to be updated. - The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the - middle. The maximum length is 80 characters. + The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the + middle. The maximum length is 80 characters. :type gallery_application_name: str :param gallery_application: Parameters supplied to the update gallery Application operation. :type gallery_application: ~azure.mgmt.compute.v2019_12_01.models.GalleryApplicationUpdate @@ -336,9 +337,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -356,9 +360,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -384,9 +387,12 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -404,8 +410,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -426,13 +432,13 @@ def begin_delete( gallery_application_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Delete a gallery Application. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition is to be deleted. + Definition is to be deleted. :type gallery_name: str :param gallery_application_name: The name of the gallery Application Definition to be deleted. :type gallery_application_name: str @@ -495,7 +501,7 @@ def list_by_gallery( :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Application Gallery from which Application - Definitions are to be listed. + Definitions are to be listed. :type gallery_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GalleryApplicationList or the result of cls(response) @@ -503,11 +509,18 @@ def list_by_gallery( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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_gallery.metadata['url'] # type: ignore @@ -521,15 +534,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_image_versions_operations.py index 13cdc6f28f94..6297f645cc9c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_image_versions_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -58,10 +58,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.GalleryImageVersion" cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -81,14 +84,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_image_version, 'GalleryImageVersion') 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 @@ -96,7 +97,6 @@ def _create_or_update_initial( 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('GalleryImageVersion', pipeline_response) @@ -121,24 +121,24 @@ def begin_create_or_update( gallery_image_version, # type: "models.GalleryImageVersion" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GalleryImageVersion"] """Create or update a gallery Image Version. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. + resides. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition in which the Image Version - is to be created. + is to be created. :type gallery_image_name: str :param gallery_image_version_name: The name of the gallery Image Version to be created. Needs - to follow semantic version name pattern: The allowed characters are digit and period. Digits - must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. + to follow semantic version name pattern: The allowed characters are digit and period. Digits + must be within the range of a 32-bit integer. Format: + :code:``.:code:``.:code:``. :type gallery_image_version_name: str :param gallery_image_version: Parameters supplied to the create or update gallery Image Version - operation. + operation. :type gallery_image_version: ~azure.mgmt.compute.v2019_12_01.models.GalleryImageVersion :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. @@ -203,10 +203,13 @@ def _update_initial( ): # type: (...) -> "models.GalleryImageVersion" cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -226,14 +229,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_image_version, 'GalleryImageVersionUpdate') 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 @@ -258,24 +259,24 @@ def begin_update( gallery_image_version, # type: "models.GalleryImageVersionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GalleryImageVersion"] """Update a gallery Image Version. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. + resides. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition in which the Image Version - is to be updated. + is to be updated. :type gallery_image_name: str :param gallery_image_version_name: The name of the gallery Image Version to be updated. Needs - to follow semantic version name pattern: The allowed characters are digit and period. Digits - must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. + to follow semantic version name pattern: The allowed characters are digit and period. Digits + must be within the range of a 32-bit integer. Format: + :code:``.:code:``.:code:``. :type gallery_image_version_name: str :param gallery_image_version: Parameters supplied to the update gallery Image Version - operation. + operation. :type gallery_image_version: ~azure.mgmt.compute.v2019_12_01.models.GalleryImageVersionUpdate :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. @@ -335,7 +336,7 @@ def get( gallery_name, # type: str gallery_image_name, # type: str gallery_image_version_name, # type: str - expand="ReplicationStatus", # type: Optional[str] + expand=None, # type: Optional[Union[str, "models.ReplicationStatusTypes"]] **kwargs # type: Any ): # type: (...) -> "models.GalleryImageVersion" @@ -352,16 +353,19 @@ def get( :param gallery_image_version_name: The name of the gallery Image Version to be retrieved. :type gallery_image_version_name: str :param expand: The expand expression to apply on the operation. - :type expand: str + :type expand: str or ~azure.mgmt.compute.v2019_12_01.models.ReplicationStatusTypes :keyword callable cls: A custom type or function that will be passed the direct response :return: GalleryImageVersion, or the result of cls(response) :rtype: ~azure.mgmt.compute.v2019_12_01.models.GalleryImageVersion :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -382,9 +386,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -411,9 +414,12 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -432,8 +438,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -455,16 +461,16 @@ def begin_delete( gallery_image_version_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Delete a gallery Image Version. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. + resides. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition in which the Image Version - resides. + resides. :type gallery_image_name: str :param gallery_image_version_name: The name of the gallery Image Version to be deleted. :type gallery_image_version_name: str @@ -529,10 +535,10 @@ def list_by_gallery_image( :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. + resides. :type gallery_name: str :param gallery_image_name: The name of the Shared Image Gallery Image Definition from which the - Image Versions are to be listed. + Image Versions are to be listed. :type gallery_image_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GalleryImageVersionList or the result of cls(response) @@ -540,11 +546,18 @@ def list_by_gallery_image( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersionList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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_gallery_image.metadata['url'] # type: ignore @@ -559,15 +572,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_images_operations.py index 02e8f5f0c98b..12cab89fc5d4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_images_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -57,10 +57,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.GalleryImage" cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -79,14 +82,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_image, 'GalleryImage') 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 @@ -94,7 +95,6 @@ def _create_or_update_initial( 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('GalleryImage', pipeline_response) @@ -118,17 +118,17 @@ def begin_create_or_update( gallery_image, # type: "models.GalleryImage" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GalleryImage"] """Create or update a gallery Image Definition. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to - be created. + be created. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition to be created or updated. - The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the - middle. The maximum length is 80 characters. + The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the + middle. The maximum length is 80 characters. :type gallery_image_name: str :param gallery_image: Parameters supplied to the create or update gallery image operation. :type gallery_image: ~azure.mgmt.compute.v2019_12_01.models.GalleryImage @@ -193,10 +193,13 @@ def _update_initial( ): # type: (...) -> "models.GalleryImage" cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -215,14 +218,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(gallery_image, 'GalleryImageUpdate') 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 @@ -246,17 +247,17 @@ def begin_update( gallery_image, # type: "models.GalleryImageUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GalleryImage"] """Update a gallery Image Definition. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to - be updated. + be updated. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition to be updated. The allowed - characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - maximum length is 80 characters. + characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The + maximum length is 80 characters. :type gallery_image_name: str :param gallery_image: Parameters supplied to the update gallery image operation. :type gallery_image: ~azure.mgmt.compute.v2019_12_01.models.GalleryImageUpdate @@ -334,9 +335,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -354,9 +358,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -382,9 +385,12 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -402,8 +408,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -424,13 +430,13 @@ def begin_delete( gallery_image_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Delete a gallery image. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to - be deleted. + be deleted. :type gallery_name: str :param gallery_image_name: The name of the gallery Image Definition to be deleted. :type gallery_image_name: str @@ -493,7 +499,7 @@ def list_by_gallery( :param resource_group_name: The name of the resource group. :type resource_group_name: str :param gallery_name: The name of the Shared Image Gallery from which Image Definitions are to - be listed. + be listed. :type gallery_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GalleryImageList or the result of cls(response) @@ -501,11 +507,18 @@ def list_by_gallery( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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_gallery.metadata['url'] # type: ignore @@ -519,15 +532,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_images_operations.py index 81c6818bee2d..d9a180119898 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_images_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.Image" cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'Image') 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('Image', pipeline_response) @@ -112,7 +112,7 @@ def begin_create_or_update( parameters, # type: "models.Image" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Image"] """Create or update an image. :param resource_group_name: The name of the resource group. @@ -180,10 +180,13 @@ def _update_initial( ): # type: (...) -> "models.Image" cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -201,14 +204,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ImageUpdate') 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 @@ -216,7 +217,6 @@ def _update_initial( 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('Image', pipeline_response) @@ -236,7 +236,7 @@ def begin_update( parameters, # type: "models.ImageUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Image"] """Update an image. :param resource_group_name: The name of the resource group. @@ -303,7 +303,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -323,7 +325,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -343,7 +344,7 @@ def begin_delete( image_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes an Image. :param resource_group_name: The name of the resource group. @@ -418,9 +419,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -439,9 +443,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -474,11 +477,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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 @@ -491,15 +501,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -532,7 +538,7 @@ def list( ): # type: (...) -> Iterable["models.ImageListResult"] """Gets the list of Images in the subscription. Use nextLink property in the response to get the - next page of Images. Do this till nextLink is null to fetch all the Images. + next page of Images. Do this till nextLink is null to fetch all the Images. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ImageListResult or the result of cls(response) @@ -540,11 +546,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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 @@ -556,15 +569,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_log_analytics_operations.py index 3d739a511e90..57218b2d9891 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_log_analytics_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod @@ -52,12 +52,15 @@ def _export_request_rate_by_interval_initial( parameters, # type: "models.RequestRateByIntervalInput" **kwargs # type: Any ): - # type: (...) -> "models.LogAnalyticsOperationResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._export_request_rate_by_interval_initial.metadata['url'] # type: ignore @@ -74,14 +77,12 @@ def _export_request_rate_by_interval_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RequestRateByIntervalInput') 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 @@ -105,9 +106,9 @@ def begin_export_request_rate_by_interval( parameters, # type: "models.RequestRateByIntervalInput" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LogAnalyticsOperationResult"] """Export logs that show Api requests made by this subscription in the given time window to show - throttling activities. + throttling activities. :param location: The location upon which virtual-machine-sizes is queried. :type location: str @@ -168,12 +169,15 @@ def _export_throttled_requests_initial( parameters, # type: "models.LogAnalyticsInputBase" **kwargs # type: Any ): - # type: (...) -> "models.LogAnalyticsOperationResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._export_throttled_requests_initial.metadata['url'] # type: ignore @@ -190,14 +194,12 @@ def _export_throttled_requests_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LogAnalyticsInputBase') 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 @@ -221,9 +223,9 @@ def begin_export_throttled_requests( parameters, # type: "models.LogAnalyticsInputBase" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LogAnalyticsOperationResult"] """Export logs that show total throttled Api requests for this subscription in the given time - window. + window. :param location: The location upon which virtual-machine-sizes is queried. :type location: str diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_operations.py index 9ac7ba32b7cf..2fb09afc3f6f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -58,11 +58,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeOperationListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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 @@ -70,15 +77,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_proximity_placement_groups_operations.py index 679236939218..6e408f760eb6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_proximity_placement_groups_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -67,10 +67,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -88,14 +91,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ProximityPlacementGroup') 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 @@ -103,7 +104,6 @@ def create_or_update( 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('ProximityPlacementGroup', pipeline_response) @@ -138,10 +138,13 @@ def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -159,14 +162,12 @@ def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'UpdateResource') 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 @@ -201,7 +202,9 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -221,7 +224,6 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -258,9 +260,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -279,9 +284,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -311,11 +315,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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_subscription.metadata['url'] # type: ignore @@ -327,15 +338,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -378,11 +385,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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 @@ -395,15 +409,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_ssh_public_keys_operations.py index 7d8bbc37977a..a29cd3f62a97 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_ssh_public_keys_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -51,7 +51,7 @@ def list_by_subscription( ): # type: (...) -> Iterable["models.SshPublicKeysGroupListResult"] """Lists all of the SSH public keys in the subscription. Use the nextLink property in the response - to get the next page of SSH public keys. + to get the next page of SSH public keys. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SshPublicKeysGroupListResult or the result of cls(response) @@ -59,11 +59,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeysGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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_subscription.metadata['url'] # type: ignore @@ -75,15 +82,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -117,7 +120,7 @@ def list_by_resource_group( ): # type: (...) -> Iterable["models.SshPublicKeysGroupListResult"] """Lists all of the SSH public keys in the specified resource group. Use the nextLink property in - the response to get the next page of SSH public keys. + the response to get the next page of SSH public keys. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -127,11 +130,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeysGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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 @@ -144,15 +154,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -201,10 +207,13 @@ def create( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeyResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create.metadata['url'] # type: ignore @@ -222,14 +231,12 @@ def create( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SshPublicKeyResource') 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 @@ -237,7 +244,6 @@ def create( 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('SshPublicKeyResource', pipeline_response) @@ -272,10 +278,13 @@ def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeyResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -293,14 +302,12 @@ def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SshPublicKeyUpdateResource') 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 @@ -335,7 +342,9 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -355,7 +364,6 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -388,9 +396,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeyResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -407,9 +418,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -447,9 +457,12 @@ def generate_key_pair( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeyGenerateKeyPairResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.generate_key_pair.metadata['url'] # type: ignore @@ -466,9 +479,8 @@ def generate_key_pair( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_usage_operations.py index 7c70a4f2fabb..f194c135090a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_usage_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,7 +52,7 @@ def list( ): # type: (...) -> Iterable["models.ListUsagesResult"] """Gets, for the specified location, the current compute resource usage information as well as the - limits for compute resources under the subscription. + limits for compute resources under the subscription. :param location: The location for which resource usage is queried. :type location: str @@ -62,11 +62,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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 @@ -79,15 +86,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_extension_images_operations.py index 72721396a629..968d664d7526 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_extension_images_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -69,9 +69,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -90,9 +93,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -128,9 +130,12 @@ def list_types( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.list_types.metadata['url'] # type: ignore @@ -147,9 +152,8 @@ def list_types( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -197,9 +201,12 @@ def list_versions( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.list_versions.metadata['url'] # type: ignore @@ -223,9 +230,8 @@ def list_versions( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_extensions_operations.py index b9a4c8166b6c..467c5ff396f2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_extensions_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachineExtension" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -78,14 +81,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtension') 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 @@ -93,7 +94,6 @@ def _create_or_update_initial( 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('VirtualMachineExtension', pipeline_response) @@ -114,18 +114,18 @@ def begin_create_or_update( extension_parameters, # type: "models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineExtension"] """The operation to create or update the extension. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_name: The name of the virtual machine where the extension should be created or - updated. + updated. :type vm_name: str :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Create Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineExtension :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. @@ -188,10 +188,13 @@ def _update_initial( ): # type: (...) -> "models.VirtualMachineExtension" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -210,14 +213,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtensionUpdate') 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 @@ -241,7 +242,7 @@ def begin_update( extension_parameters, # type: "models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineExtension"] """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -251,7 +252,7 @@ def begin_update( :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Update Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineExtensionUpdate :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. @@ -313,7 +314,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -334,7 +337,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -355,7 +357,7 @@ def begin_delete( vm_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -436,9 +438,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -458,9 +463,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -499,9 +503,12 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -520,9 +527,8 @@ def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_images_operations.py index 83ef4e214cee..f1d1c3e8652c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_images_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -72,9 +72,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -94,9 +97,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -148,9 +150,12 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -175,9 +180,8 @@ def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -213,9 +217,12 @@ def list_offers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.list_offers.metadata['url'] # type: ignore @@ -232,9 +239,8 @@ def list_offers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -267,9 +273,12 @@ def list_publishers( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.list_publishers.metadata['url'] # type: ignore @@ -285,9 +294,8 @@ def list_publishers( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -326,9 +334,12 @@ def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.list_skus.metadata['url'] # type: ignore @@ -346,9 +357,8 @@ def list_skus( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_run_commands_operations.py index 0cda871c4531..a3ea89d142a6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_run_commands_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -61,11 +61,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json, text/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 @@ -78,15 +85,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -132,9 +135,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandDocument"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json, text/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -151,9 +157,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_extensions_operations.py index 87bb8117bda5..4c7caa19ee3a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -57,10 +57,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachineScaleSetExtension" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -79,14 +82,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineScaleSetExtension') 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 @@ -94,7 +95,6 @@ def _create_or_update_initial( 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('VirtualMachineScaleSetExtension', pipeline_response) @@ -115,18 +115,18 @@ def begin_create_or_update( extension_parameters, # type: "models.VirtualMachineScaleSetExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineScaleSetExtension"] """The operation to create or update an extension. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_scale_set_name: The name of the VM scale set where the extension should be create or - updated. + updated. :type vm_scale_set_name: str :param vmss_extension_name: The name of the VM scale set extension. :type vmss_extension_name: str :param extension_parameters: Parameters supplied to the Create VM scale set Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSetExtension :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. @@ -189,10 +189,13 @@ def _update_initial( ): # type: (...) -> "models.VirtualMachineScaleSetExtension" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -211,14 +214,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineScaleSetExtensionUpdate') 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 @@ -226,7 +227,6 @@ def _update_initial( 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('VirtualMachineScaleSetExtension', pipeline_response) @@ -247,7 +247,7 @@ def begin_update( extension_parameters, # type: "models.VirtualMachineScaleSetExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineScaleSetExtension"] """The operation to update an extension. :param resource_group_name: The name of the resource group. @@ -257,7 +257,7 @@ def begin_update( :param vmss_extension_name: The name of the VM scale set extension. :type vmss_extension_name: str :param extension_parameters: Parameters supplied to the Update VM scale set Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSetExtensionUpdate :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. @@ -319,7 +319,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -340,7 +342,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -361,7 +362,7 @@ def begin_delete( vmss_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -442,9 +443,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -464,9 +468,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -502,11 +505,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtensionListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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 @@ -520,15 +530,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index cf5f7b47d987..6aa20879d16a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod @@ -54,7 +54,9 @@ def _cancel_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -74,7 +76,6 @@ def _cancel_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -94,7 +95,7 @@ def begin_cancel( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Cancels the current virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -155,7 +156,9 @@ def _start_os_upgrade_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -175,7 +178,6 @@ def _start_os_upgrade_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -195,10 +197,10 @@ def begin_start_os_upgrade( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts a rolling upgrade to move all virtual machine scale set instances to the latest - available Platform Image OS version. Instances which are already running the latest available - OS version are not affected. + available Platform Image OS version. Instances which are already running the latest available + OS version are not affected. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -258,7 +260,9 @@ def _start_extension_upgrade_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -278,7 +282,6 @@ def _start_extension_upgrade_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -298,10 +301,10 @@ def begin_start_extension_upgrade( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to - the latest available extension version. Instances which are already running the latest - extension versions are not affected. + the latest available extension version. Instances which are already running the latest + extension versions are not affected. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -372,9 +375,12 @@ def get_latest( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RollingUpgradeStatusInfo"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get_latest.metadata['url'] # type: ignore @@ -391,9 +397,8 @@ def get_latest( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py index e5882c35a7e1..99983dfe0f7e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod @@ -57,10 +57,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachineExtension" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -80,14 +83,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtension') 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 @@ -95,7 +96,6 @@ def _create_or_update_initial( 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('VirtualMachineExtension', pipeline_response) @@ -117,7 +117,7 @@ def begin_create_or_update( extension_parameters, # type: "models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineExtension"] """The operation to create or update the VMSS VM extension. :param resource_group_name: The name of the resource group. @@ -129,7 +129,7 @@ def begin_create_or_update( :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Create Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineExtension :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. @@ -194,10 +194,13 @@ def _update_initial( ): # type: (...) -> "models.VirtualMachineExtension" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -217,14 +220,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtensionUpdate') 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 @@ -249,7 +250,7 @@ def begin_update( extension_parameters, # type: "models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineExtension"] """The operation to update the VMSS VM extension. :param resource_group_name: The name of the resource group. @@ -261,7 +262,7 @@ def begin_update( :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Update Virtual Machine Extension - operation. + operation. :type extension_parameters: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineExtensionUpdate :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. @@ -325,9 +326,12 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -346,8 +350,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -369,7 +373,7 @@ def begin_delete( vm_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to delete the VMSS VM extension. :param resource_group_name: The name of the resource group. @@ -456,9 +460,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -479,9 +486,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -523,9 +529,12 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -545,9 +554,8 @@ def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_vms_operations.py index be9496c57f6a..b8858b108f2c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -57,7 +57,9 @@ def _reimage_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") @@ -80,7 +82,6 @@ def _reimage_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_scale_set_vm_reimage_input is not None: body_content = self._serialize.body(vm_scale_set_vm_reimage_input, 'VirtualMachineReimageParameters') @@ -88,7 +89,6 @@ def _reimage_initial( body_content = None 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 @@ -109,7 +109,7 @@ def begin_reimage( vm_scale_set_vm_reimage_input=None, # type: Optional["models.VirtualMachineReimageParameters"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -177,7 +177,9 @@ def _reimage_all_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -198,7 +200,6 @@ def _reimage_all_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -219,9 +220,9 @@ def begin_reimage_all( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. - This operation is only supported for managed disks. + This operation is only supported for managed disks. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -285,7 +286,9 @@ def _deallocate_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -306,7 +309,6 @@ def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -327,10 +329,10 @@ def begin_deallocate( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and - releases the compute resources it uses. You are not billed for the compute resources of this - virtual machine once it is deallocated. + releases the compute resources it uses. You are not billed for the compute resources of this + virtual machine once it is deallocated. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -395,10 +397,13 @@ def _update_initial( ): # type: (...) -> "models.VirtualMachineScaleSetVM" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -417,14 +422,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSetVM') 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 @@ -432,7 +435,6 @@ def _update_initial( 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('VirtualMachineScaleSetVM', pipeline_response) @@ -453,13 +455,13 @@ def begin_update( parameters, # type: "models.VirtualMachineScaleSetVM" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineScaleSetVM"] """Updates a virtual machine of a VM scale set. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_scale_set_name: The name of the VM scale set where the extension should be create or - updated. + updated. :type vm_scale_set_name: str :param instance_id: The instance ID of the virtual machine. :type instance_id: str @@ -525,7 +527,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -546,7 +550,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -567,7 +570,7 @@ def begin_delete( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -648,9 +651,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -670,9 +676,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -711,9 +716,12 @@ def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -731,9 +739,8 @@ def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -766,11 +773,14 @@ def list( :type resource_group_name: str :param virtual_machine_scale_set_name: The name of the VM scale set. :type virtual_machine_scale_set_name: str - :param filter: The filter to apply to the operation. + :param filter: The filter to apply to the operation. Allowed values are + 'startswith(instanceView/statuses/code, 'PowerState') eq true', 'properties/latestModelApplied + eq true', 'properties/latestModelApplied eq false'. :type filter: str - :param select: The list parameters. + :param select: The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. :type select: str - :param expand: The expand expression to apply to the operation. + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetVMListResult or the result of cls(response) @@ -778,11 +788,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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 @@ -802,15 +819,11 @@ def prepare_request(next_link=None): query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -847,7 +860,9 @@ def _power_off_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -870,7 +885,6 @@ def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -892,10 +906,10 @@ def begin_power_off( skip_shutdown=False, # type: Optional[bool] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached - and you are getting charged for the resources. Instead, use deallocate to release resources and - avoid charges. + and you are getting charged for the resources. Instead, use deallocate to release resources and + avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -904,8 +918,8 @@ def begin_power_off( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param skip_shutdown: The parameter to request non-graceful VM shutdown. True value for this - flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this - flag is false if not specified. + flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this + flag is false if not specified. :type skip_shutdown: 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. @@ -964,7 +978,9 @@ def _restart_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -985,7 +1001,6 @@ def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1006,7 +1021,7 @@ def begin_restart( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Restarts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1071,7 +1086,9 @@ def _start_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -1092,7 +1109,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1113,7 +1129,7 @@ def begin_start( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1178,7 +1194,9 @@ def _redeploy_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -1199,7 +1217,6 @@ def _redeploy_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1220,9 +1237,9 @@ def begin_redeploy( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and - powers it back on. + powers it back on. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1286,7 +1303,9 @@ def _perform_maintenance_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -1307,7 +1326,6 @@ def _perform_maintenance_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1328,7 +1346,7 @@ def begin_perform_maintenance( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Performs maintenance on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1407,7 +1425,9 @@ def simulate_eviction( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -1428,7 +1448,6 @@ def simulate_eviction( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1450,12 +1469,15 @@ def _run_command_initial( parameters, # type: "models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> "models.RunCommandResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" # Construct URL url = self._run_command_initial.metadata['url'] # type: ignore @@ -1474,14 +1496,12 @@ def _run_command_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RunCommandInput') 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 @@ -1507,7 +1527,7 @@ def begin_run_command( parameters, # type: "models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RunCommandResult"] """Run command on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_sets_operations.py index ef2173090707..d5bbc4985b3b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_sets_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,10 +56,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachineScaleSet" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSet') 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 @@ -92,7 +93,6 @@ def _create_or_update_initial( 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('VirtualMachineScaleSet', pipeline_response) @@ -112,7 +112,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualMachineScaleSet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -180,10 +180,13 @@ def _update_initial( ): # type: (...) -> "models.VirtualMachineScaleSet" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -201,14 +204,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineScaleSetUpdate') 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 @@ -231,7 +232,7 @@ def begin_update( parameters, # type: "models.VirtualMachineScaleSetUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] """Update a VM scale set. :param resource_group_name: The name of the resource group. @@ -298,7 +299,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -318,7 +321,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -338,7 +340,7 @@ def begin_delete( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VM scale set. :param resource_group_name: The name of the resource group. @@ -410,9 +412,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -429,9 +434,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -457,7 +461,9 @@ def _deallocate_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") @@ -479,7 +485,6 @@ def _deallocate_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -487,7 +492,6 @@ def _deallocate_initial( body_content = None 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 @@ -507,10 +511,10 @@ def begin_deallocate( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and - releases the compute resources. You are not billed for the compute resources that this virtual - machine scale set deallocates. + releases the compute resources. You are not billed for the compute resources that this virtual + machine scale set deallocates. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -574,7 +578,9 @@ def _delete_instances_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") @@ -596,12 +602,10 @@ def _delete_instances_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -621,7 +625,7 @@ def begin_delete_instances( vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -696,9 +700,12 @@ def get_instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get_instance_view.metadata['url'] # type: ignore @@ -715,9 +722,8 @@ def get_instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -750,11 +756,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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 @@ -767,15 +780,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -808,8 +817,8 @@ def list_all( ): # type: (...) -> Iterable["models.VirtualMachineScaleSetListWithLinkResult"] """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource - group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this - till nextLink is null to fetch all the VM Scale Sets. + group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this + till nextLink is null to fetch all the VM Scale Sets. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineScaleSetListWithLinkResult or the result of cls(response) @@ -817,11 +826,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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_all.metadata['url'] # type: ignore @@ -833,15 +849,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -876,7 +888,7 @@ def list_skus( ): # type: (...) -> Iterable["models.VirtualMachineScaleSetListSkusResult"] """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM - instances allowed for each SKU. + instances allowed for each SKU. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -888,11 +900,18 @@ def list_skus( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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_skus.metadata['url'] # type: ignore @@ -906,15 +925,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -960,11 +975,18 @@ def get_os_upgrade_history( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListOSUpgradeHistory"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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.get_os_upgrade_history.metadata['url'] # type: ignore @@ -978,15 +1000,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1023,7 +1041,9 @@ def _power_off_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") @@ -1047,7 +1067,6 @@ def _power_off_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1055,7 +1074,6 @@ def _power_off_initial( body_content = None 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 @@ -1076,18 +1094,18 @@ def begin_power_off( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still - attached and you are getting charged for the resources. Instead, use deallocate to release - resources and avoid charges. + attached and you are getting charged for the resources. Instead, use deallocate to release + resources and avoid charges. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_scale_set_name: The name of the VM scale set. :type vm_scale_set_name: str :param skip_shutdown: The parameter to request non-graceful VM shutdown. True value for this - flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this - flag is false if not specified. + flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this + flag is false if not specified. :type skip_shutdown: bool :param vm_instance_i_ds: A list of virtual machine instance IDs from the VM scale set. :type vm_instance_i_ds: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSetVMInstanceIDs @@ -1148,7 +1166,9 @@ def _restart_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") @@ -1170,7 +1190,6 @@ def _restart_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1178,7 +1197,6 @@ def _restart_initial( body_content = None 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 @@ -1198,7 +1216,7 @@ def begin_restart( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Restarts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1263,7 +1281,9 @@ def _start_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") @@ -1285,7 +1305,6 @@ def _start_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1293,7 +1312,6 @@ def _start_initial( body_content = None 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 @@ -1313,7 +1331,7 @@ def begin_start( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1378,7 +1396,9 @@ def _redeploy_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") @@ -1400,7 +1420,6 @@ def _redeploy_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1408,7 +1427,6 @@ def _redeploy_initial( body_content = None 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 @@ -1428,9 +1446,9 @@ def begin_redeploy( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, - and powers them back on. + and powers them back on. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1494,7 +1512,9 @@ def _perform_maintenance_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") @@ -1516,7 +1536,6 @@ def _perform_maintenance_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1524,7 +1543,6 @@ def _perform_maintenance_initial( body_content = None 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 @@ -1544,11 +1562,11 @@ def begin_perform_maintenance( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances - which are not eligible for perform maintenance will be failed. Please refer to best practices - for more details: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual- - machine-scale-sets-maintenance-notifications. + which are not eligible for perform maintenance will be failed. Please refer to best practices + for more details: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual- + machine-scale-sets-maintenance-notifications. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1612,7 +1630,9 @@ def _update_instances_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") @@ -1634,12 +1654,10 @@ def _update_instances_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') 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 @@ -1659,7 +1677,7 @@ def begin_update_instances( vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. :param resource_group_name: The name of the resource group. @@ -1724,7 +1742,9 @@ def _reimage_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") @@ -1746,7 +1766,6 @@ def _reimage_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_scale_set_reimage_input is not None: body_content = self._serialize.body(vm_scale_set_reimage_input, 'VirtualMachineScaleSetReimageParameters') @@ -1754,7 +1773,6 @@ def _reimage_initial( body_content = None 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 @@ -1774,10 +1792,10 @@ def begin_reimage( vm_scale_set_reimage_input=None, # type: Optional["models.VirtualMachineScaleSetReimageParameters"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which - don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual - machine is reset to initial state. + don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual + machine is reset to initial state. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1841,7 +1859,9 @@ def _reimage_all_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") @@ -1863,7 +1883,6 @@ def _reimage_all_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if vm_instance_i_ds is not None: body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') @@ -1871,7 +1890,6 @@ def _reimage_all_initial( body_content = None 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 @@ -1891,9 +1909,9 @@ def begin_reimage_all( vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This - operation is only supported for managed disks. + operation is only supported for managed disks. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1972,9 +1990,12 @@ def force_recovery_service_fabric_platform_update_domain_walk( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RecoveryWalkResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.force_recovery_service_fabric_platform_update_domain_walk.metadata['url'] # type: ignore @@ -1992,9 +2013,8 @@ def force_recovery_service_fabric_platform_update_domain_walk( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -2033,8 +2053,11 @@ def convert_to_single_placement_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL @@ -2048,17 +2071,16 @@ def convert_to_single_placement_group( # 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') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VMScaleSetConvertToSinglePlacementGroupInput') 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 @@ -2080,7 +2102,9 @@ def _set_orchestration_service_state_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") @@ -2102,12 +2126,10 @@ def _set_orchestration_service_state_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'OrchestrationServiceStateInput') 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 @@ -2127,7 +2149,7 @@ def begin_set_orchestration_service_state( parameters, # type: "models.OrchestrationServiceStateInput" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Changes ServiceState property for a given service. :param resource_group_name: The name of the resource group. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_sizes_operations.py index 9777f22683da..bf92a4c9b341 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_sizes_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -52,7 +52,7 @@ def list( ): # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] """This API is deprecated. Use `Resources Skus `_. + us/rest/api/compute/resourceskus/list>`_. :param location: The location upon which virtual-machine-sizes is queried. :type location: str @@ -62,11 +62,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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 @@ -79,15 +86,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machines_operations.py index d2475b1f460a..a24398f33fbc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machines_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -63,11 +63,18 @@ def list_by_location( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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_location.metadata['url'] # type: ignore @@ -80,15 +87,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -122,12 +125,15 @@ def _capture_initial( parameters, # type: "models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._capture_initial.metadata['url'] # type: ignore @@ -145,14 +151,12 @@ def _capture_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineCaptureParameters') 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 @@ -177,9 +181,9 @@ def begin_capture( parameters, # type: "models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachineCaptureResult"] """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used - to create similar VMs. + to create similar VMs. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -246,10 +250,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.VirtualMachine" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -267,14 +274,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachine') 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 @@ -282,7 +287,6 @@ def _create_or_update_initial( 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('VirtualMachine', pipeline_response) @@ -302,9 +306,9 @@ def begin_create_or_update( parameters, # type: "models.VirtualMachine" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachine"] """The operation to create or update a virtual machine. Please note some properties can be set - only during virtual machine creation. + only during virtual machine creation. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -371,10 +375,13 @@ def _update_initial( ): # type: (...) -> "models.VirtualMachine" cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -392,14 +399,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualMachineUpdate') 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 @@ -407,7 +412,6 @@ def _update_initial( 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('VirtualMachine', pipeline_response) @@ -427,7 +431,7 @@ def begin_update( parameters, # type: "models.VirtualMachineUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualMachine"] """The operation to update a virtual machine. :param resource_group_name: The name of the resource group. @@ -494,7 +498,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -514,7 +520,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -534,7 +539,7 @@ def begin_delete( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to delete a virtual machine. :param resource_group_name: The name of the resource group. @@ -609,9 +614,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -630,9 +638,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -668,9 +675,12 @@ def instance_view( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineInstanceView"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self.instance_view.metadata['url'] # type: ignore @@ -687,9 +697,8 @@ def instance_view( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -714,7 +723,9 @@ def _convert_to_managed_disks_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -734,7 +745,6 @@ def _convert_to_managed_disks_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -754,9 +764,9 @@ def begin_convert_to_managed_disks( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop- - deallocated before invoking this operation. + deallocated before invoking this operation. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -816,7 +826,9 @@ def _deallocate_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -836,7 +848,6 @@ def _deallocate_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -856,9 +867,9 @@ def begin_deallocate( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Shuts down the virtual machine and releases the compute resources. You are not billed for the - compute resources that this virtual machine uses. + compute resources that this virtual machine uses. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -934,7 +945,9 @@ def generalize( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -954,7 +967,6 @@ def generalize( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -975,7 +987,7 @@ def list( ): # type: (...) -> Iterable["models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified resource group. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -985,11 +997,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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 @@ -1002,15 +1021,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1044,10 +1059,10 @@ def list_all( ): # type: (...) -> Iterable["models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified subscription. Use the nextLink property in - the response to get the next page of virtual machines. + the response to get the next page of virtual machines. :param status_only: statusOnly=true enables fetching run time status of all Virtual Machines in - the subscription. + the subscription. :type status_only: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachineListResult or the result of cls(response) @@ -1055,11 +1070,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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_all.metadata['url'] # type: ignore @@ -1073,15 +1095,11 @@ def prepare_request(next_link=None): if status_only is not None: query_parameters['statusOnly'] = self._serialize.query("status_only", status_only, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1116,7 +1134,7 @@ def list_available_sizes( ): # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes to which the specified virtual machine can be - resized. + resized. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1128,11 +1146,18 @@ def list_available_sizes( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + 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_available_sizes.metadata['url'] # type: ignore @@ -1146,15 +1171,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1190,7 +1211,9 @@ def _power_off_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -1212,7 +1235,6 @@ def _power_off_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1233,17 +1255,17 @@ def begin_power_off( skip_shutdown=False, # type: Optional[bool] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with - the same provisioned resources. You are still charged for this virtual machine. + the same provisioned resources. You are still charged for this virtual machine. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param vm_name: The name of the virtual machine. :type vm_name: str :param skip_shutdown: The parameter to request non-graceful VM shutdown. True value for this - flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this - flag is false if not specified. + flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this + flag is false if not specified. :type skip_shutdown: 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. @@ -1300,9 +1322,12 @@ def _reapply_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" + accept = "application/json" # Construct URL url = self._reapply_initial.metadata['url'] # type: ignore @@ -1319,8 +1344,8 @@ def _reapply_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1340,7 +1365,7 @@ def begin_reapply( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to reapply a virtual machine's state. :param resource_group_name: The name of the resource group. @@ -1401,7 +1426,9 @@ def _restart_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -1421,7 +1448,6 @@ def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1441,7 +1467,7 @@ def begin_restart( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to restart a virtual machine. :param resource_group_name: The name of the resource group. @@ -1502,7 +1528,9 @@ def _start_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -1522,7 +1550,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1542,7 +1569,7 @@ def begin_start( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to start a virtual machine. :param resource_group_name: The name of the resource group. @@ -1603,7 +1630,9 @@ def _redeploy_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -1623,7 +1652,6 @@ def _redeploy_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1643,7 +1671,7 @@ def begin_redeploy( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Shuts down the virtual machine, moves it to a new node, and powers it back on. :param resource_group_name: The name of the resource group. @@ -1705,7 +1733,9 @@ def _reimage_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") @@ -1727,7 +1757,6 @@ def _reimage_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: body_content = self._serialize.body(parameters, 'VirtualMachineReimageParameters') @@ -1735,7 +1764,6 @@ def _reimage_initial( body_content = None 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 @@ -1755,7 +1783,7 @@ def begin_reimage( parameters=None, # type: Optional["models.VirtualMachineReimageParameters"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Reimages the virtual machine which has an ephemeral OS disk back to its initial state. :param resource_group_name: The name of the resource group. @@ -1819,7 +1847,9 @@ def _perform_maintenance_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -1839,7 +1869,6 @@ def _perform_maintenance_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1859,7 +1888,7 @@ def begin_perform_maintenance( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """The operation to perform maintenance on a virtual machine. :param resource_group_name: The name of the resource group. @@ -1932,7 +1961,9 @@ def simulate_eviction( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -1952,7 +1983,6 @@ def simulate_eviction( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1973,12 +2003,15 @@ def _run_command_initial( parameters, # type: "models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> "models.RunCommandResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" # Construct URL url = self._run_command_initial.metadata['url'] # type: ignore @@ -1996,14 +2029,12 @@ def _run_command_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RunCommandInput') 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 @@ -2028,7 +2059,7 @@ def begin_run_command( parameters, # type: "models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RunCommandResult"] """Run command on the VM. :param resource_group_name: The name of the resource group. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/__init__.py new file mode 100644 index 000000000000..cdc7f7a1709a --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/__init__.py @@ -0,0 +1,16 @@ +# 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 ._compute_management_client import ComputeManagementClient +__all__ = ['ComputeManagementClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass 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 new file mode 100644 index 000000000000..e4349e9e25cc --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_compute_management_client.py @@ -0,0 +1,85 @@ +# 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 + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + 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 . import models + + +class ComputeManagementClient(object): + """Compute Client. + + :ivar disks: DisksOperations operations + :vartype disks: azure.mgmt.compute.v2020_05_01.operations.DisksOperations + :ivar snapshots: SnapshotsOperations operations + :vartype snapshots: azure.mgmt.compute.v2020_05_01.operations.SnapshotsOperations + :ivar disk_encryption_sets: DiskEncryptionSetsOperations operations + :vartype disk_encryption_sets: azure.mgmt.compute.v2020_05_01.operations.DiskEncryptionSetsOperations + :ivar disk_accesses: DiskAccessesOperations operations + :vartype disk_accesses: azure.mgmt.compute.v2020_05_01.operations.DiskAccessesOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = ComputeManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + 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) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> ComputeManagementClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_configuration.py new file mode 100644 index 000000000000..c73a911e4b9a --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_configuration.py @@ -0,0 +1,70 @@ +# 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 + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class ComputeManagementClientConfiguration(Configuration): + """Configuration for ComputeManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(ComputeManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-05-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-compute/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) 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 new file mode 100644 index 000000000000..d76b82acbb70 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_metadata.json @@ -0,0 +1,63 @@ +{ + "chosen_version": "2020-05-01", + "total_api_version_list": ["2020-05-01"], + "client": { + "name": "ComputeManagementClient", + "filename": "_compute_management_client", + "description": "Compute Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true + }, + "global_parameters": { + "sync_method": { + "credential": { + "method_signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "method_signature": "subscription_id, # type: str", + "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + "docstring_type": "str", + "required": true + } + }, + "async_method": { + "credential": { + "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "method_signature": "subscription_id, # type: str", + "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id" + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null + }, + "operation_groups": { + "disks": "DisksOperations", + "snapshots": "SnapshotsOperations", + "disk_encryption_sets": "DiskEncryptionSetsOperations", + "disk_accesses": "DiskAccessesOperations" + }, + "operation_mixins": { + }, + "sync_imports": "None", + "async_imports": "None" +} \ No newline at end of file diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/__init__.py new file mode 100644 index 000000000000..9e9459635989 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/__init__.py @@ -0,0 +1,10 @@ +# 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 ._compute_management_client import ComputeManagementClient +__all__ = ['ComputeManagementClient'] 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 new file mode 100644 index 000000000000..d0f08ca2041e --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/_compute_management_client.py @@ -0,0 +1,79 @@ +# 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, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + 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 .. import models + + +class ComputeManagementClient(object): + """Compute Client. + + :ivar disks: DisksOperations operations + :vartype disks: azure.mgmt.compute.v2020_05_01.aio.operations.DisksOperations + :ivar snapshots: SnapshotsOperations operations + :vartype snapshots: azure.mgmt.compute.v2020_05_01.aio.operations.SnapshotsOperations + :ivar disk_encryption_sets: DiskEncryptionSetsOperations operations + :vartype disk_encryption_sets: azure.mgmt.compute.v2020_05_01.aio.operations.DiskEncryptionSetsOperations + :ivar disk_accesses: DiskAccessesOperations operations + :vartype disk_accesses: azure.mgmt.compute.v2020_05_01.aio.operations.DiskAccessesOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = ComputeManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + 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) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "ComputeManagementClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/_configuration.py new file mode 100644 index 000000000000..c36d4da4899c --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/_configuration.py @@ -0,0 +1,66 @@ +# 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, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class ComputeManagementClientConfiguration(Configuration): + """Configuration for ComputeManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(ComputeManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-05-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-compute/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/__init__.py new file mode 100644 index 000000000000..22cffb20eb1d --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/__init__.py @@ -0,0 +1,19 @@ +# 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 ._disks_operations import DisksOperations +from ._snapshots_operations import SnapshotsOperations +from ._disk_encryption_sets_operations import DiskEncryptionSetsOperations +from ._disk_accesses_operations import DiskAccessesOperations + +__all__ = [ + 'DisksOperations', + 'SnapshotsOperations', + 'DiskEncryptionSetsOperations', + 'DiskAccessesOperations', +] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disk_accesses_operations.py new file mode 100644 index 000000000000..8785efa72929 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disk_accesses_operations.py @@ -0,0 +1,652 @@ +# 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 + +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_05_01.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-05-01" + 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_05_01.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_05_01.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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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-05-01" + 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_05_01.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_05_01.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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_05_01.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-05-01" + 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-05-01" + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_05_01.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-05-01" + 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_05_01.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-05-01" + 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_05_01.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-05-01" + 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disk_encryption_sets_operations.py new file mode 100644 index 000000000000..9de6decb3cd9 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disk_encryption_sets_operations.py @@ -0,0 +1,594 @@ +# 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 + +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_05_01.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-05-01" + 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_05_01.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_05_01.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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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-05-01" + 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_05_01.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_05_01.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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_05_01.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-05-01" + 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-05-01" + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_05_01.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-05-01" + 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_05_01.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-05-01" + 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disks_operations.py new file mode 100644 index 000000000000..cfda150cca3a --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disks_operations.py @@ -0,0 +1,815 @@ +# 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 + +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_05_01.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-05-01" + 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_05_01.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_05_01.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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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-05-01" + 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_05_01.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_05_01.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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_05_01.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-05-01" + 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-05-01" + + # 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_05_01.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-05-01" + 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_05_01.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-05-01" + 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-05-01" + 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_05_01.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_05_01.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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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-05-01" + + # 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_snapshots_operations.py new file mode 100644 index 000000000000..cf511f8bc5e8 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_snapshots_operations.py @@ -0,0 +1,815 @@ +# 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 + +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_05_01.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-05-01" + 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_05_01.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_05_01.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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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-05-01" + 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_05_01.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_05_01.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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_05_01.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-05-01" + 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-05-01" + + # 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_05_01.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-05-01" + 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_05_01.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-05-01" + 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-05-01" + 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_05_01.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_05_01.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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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-05-01" + + # 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01/models/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/models/__init__.py new file mode 100644 index 000000000000..dc6664b20a1b --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/models/__init__.py @@ -0,0 +1,145 @@ +# 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. +# -------------------------------------------------------------------------- + +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 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 DiskList + from ._models_py3 import DiskSku + from ._models_py3 import DiskUpdate + from ._models_py3 import Encryption + from ._models_py3 import EncryptionSetIdentity + from ._models_py3 import EncryptionSettingsCollection + from ._models_py3 import EncryptionSettingsElement + from ._models_py3 import GrantAccessData + from ._models_py3 import ImageDiskReference + from ._models_py3 import InnerError + from ._models_py3 import KeyVaultAndKeyReference + from ._models_py3 import KeyVaultAndSecretReference + from ._models_py3 import PrivateEndpoint + from ._models_py3 import PrivateEndpointConnection + from ._models_py3 import PrivateLinkResource + from ._models_py3 import PrivateLinkResourceListResult + from ._models_py3 import PrivateLinkServiceConnectionState + from ._models_py3 import Resource + from ._models_py3 import ShareInfoElement + 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 +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 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 DiskList # type: ignore + from ._models import DiskSku # type: ignore + from ._models import DiskUpdate # type: ignore + from ._models import Encryption # type: ignore + from ._models import EncryptionSetIdentity # type: ignore + from ._models import EncryptionSettingsCollection # type: ignore + from ._models import EncryptionSettingsElement # type: ignore + from ._models import GrantAccessData # type: ignore + from ._models import ImageDiskReference # type: ignore + from ._models import InnerError # type: ignore + from ._models import KeyVaultAndKeyReference # type: ignore + from ._models import KeyVaultAndSecretReference # type: ignore + from ._models import PrivateEndpoint # type: ignore + from ._models import PrivateEndpointConnection # type: ignore + from ._models import PrivateLinkResource # type: ignore + from ._models import PrivateLinkResourceListResult # type: ignore + from ._models import PrivateLinkServiceConnectionState # type: ignore + from ._models import Resource # type: ignore + from ._models import ShareInfoElement # 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 ._compute_management_client_enums import ( + AccessLevel, + DiskCreateOption, + DiskEncryptionSetIdentityType, + DiskState, + DiskStorageAccountTypes, + EncryptionType, + HyperVGeneration, + NetworkAccessPolicy, + OperatingSystemTypes, + PrivateEndpointConnectionProvisioningState, + PrivateEndpointServiceConnectionStatus, + SnapshotStorageAccountTypes, +) + +__all__ = [ + 'AccessUri', + 'ApiError', + 'ApiErrorBase', + 'CreationData', + 'Disk', + 'DiskAccess', + 'DiskAccessList', + 'DiskAccessUpdate', + 'DiskEncryptionSet', + 'DiskEncryptionSetList', + 'DiskEncryptionSetUpdate', + 'DiskList', + 'DiskSku', + 'DiskUpdate', + 'Encryption', + 'EncryptionSetIdentity', + 'EncryptionSettingsCollection', + 'EncryptionSettingsElement', + 'GrantAccessData', + 'ImageDiskReference', + 'InnerError', + 'KeyVaultAndKeyReference', + 'KeyVaultAndSecretReference', + 'PrivateEndpoint', + 'PrivateEndpointConnection', + 'PrivateLinkResource', + 'PrivateLinkResourceListResult', + 'PrivateLinkServiceConnectionState', + 'Resource', + 'ShareInfoElement', + 'Snapshot', + 'SnapshotList', + 'SnapshotSku', + 'SnapshotUpdate', + 'SourceVault', + 'AccessLevel', + 'DiskCreateOption', + 'DiskEncryptionSetIdentityType', + 'DiskState', + 'DiskStorageAccountTypes', + 'EncryptionType', + 'HyperVGeneration', + 'NetworkAccessPolicy', + 'OperatingSystemTypes', + 'PrivateEndpointConnectionProvisioningState', + 'PrivateEndpointServiceConnectionStatus', + 'SnapshotStorageAccountTypes', +] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/models/_compute_management_client_enums.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/models/_compute_management_client_enums.py new file mode 100644 index 000000000000..6df8178a7185 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/models/_compute_management_client_enums.py @@ -0,0 +1,126 @@ +# 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 enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class AccessLevel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + NONE = "None" + READ = "Read" + WRITE = "Write" + +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. + """ + + SYSTEM_ASSIGNED = "SystemAssigned" + +class DiskState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The 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 HyperVGeneration(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The hypervisor generation of the Virtual Machine. Applicable to OS disks only. + """ + + 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 OperatingSystemTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """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 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. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/models/_models.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/models/_models.py new file mode 100644 index 000000000000..0b234723c7f7 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/models/_models.py @@ -0,0 +1,1467 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import 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. + + :param details: The Api error details. + :type details: list[~azure.mgmt.compute.v2020_05_01.models.ApiErrorBase] + :param innererror: The Api inner error. + :type innererror: ~azure.mgmt.compute.v2020_05_01.models.InnerError + :param code: The error code. + :type code: str + :param target: The target of the particular error. + :type target: str + :param message: The error message. + :type message: str + """ + + _attribute_map = { + 'details': {'key': 'details', 'type': '[ApiErrorBase]'}, + 'innererror': {'key': 'innererror', 'type': 'InnerError'}, + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiError, self).__init__(**kwargs) + self.details = kwargs.get('details', None) + self.innererror = kwargs.get('innererror', None) + self.code = kwargs.get('code', None) + self.target = kwargs.get('target', None) + self.message = kwargs.get('message', None) + + +class ApiErrorBase(msrest.serialization.Model): + """Api error base. + + :param code: The error code. + :type code: str + :param target: The target of the particular error. + :type target: str + :param message: The error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiErrorBase, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.target = kwargs.get('target', None) + 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_05_01.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_05_01.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_05_01.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 + """ + + _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'}, + } + + 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) + + +class Resource(msrest.serialization.Model): + """The 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. + + :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] + """ + + _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}'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs['location'] + self.tags = kwargs.get('tags', None) + + +class Disk(Resource): + """Disk 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: 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_05_01.models.DiskSku + :param zones: The Logical zone list for Disk. + :type zones: list[str] + :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_05_01.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_05_01.models.HyperVGeneration + :param creation_data: Disk source information. CreationData information cannot be changed after + the disk has been created. + :type creation_data: ~azure.mgmt.compute.v2020_05_01.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_05_01.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_05_01.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_05_01.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_05_01.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_05_01.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}, + '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 = { + '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'}, + 'managed_by_extended': {'key': 'managedByExtended', 'type': '[str]'}, + 'sku': {'key': 'sku', 'type': 'DiskSku'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'time_created': {'key': 'properties.timeCreated', 'type': 'iso-8601'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, + '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'}, + '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'}, + } + + def __init__( + self, + **kwargs + ): + 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.time_created = None + self.os_type = kwargs.get('os_type', None) + self.hyper_v_generation = kwargs.get('hyper_v_generation', 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.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) + + +class DiskAccess(Resource): + """disk access 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 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_05_01.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 = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'private_endpoint_connections': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'time_created': {'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}'}, + '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(DiskAccess, self).__init__(**kwargs) + self.private_endpoint_connections = None + self.provisioning_state = None + self.time_created = None + + +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 disk access resources. + :type value: list[~azure.mgmt.compute.v2020_05_01.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 + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DiskAccess]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DiskAccessList, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class DiskAccessUpdate(msrest.serialization.Model): + """Used for updating a disk access resource. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(DiskAccessUpdate, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +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 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_05_01.models.EncryptionSetIdentity + :param encryption_type: The type of key used to encrypt the data of the disk. Possible values + include: "EncryptionAtRestWithPlatformKey", "EncryptionAtRestWithCustomerKey", + "EncryptionAtRestWithPlatformAndCustomerKeys". + :type encryption_type: str or ~azure.mgmt.compute.v2020_05_01.models.EncryptionType + :param active_key: The key vault key which is currently used by this disk encryption set. + :type active_key: ~azure.mgmt.compute.v2020_05_01.models.KeyVaultAndKeyReference + :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_05_01.models.KeyVaultAndKeyReference] + :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}'}, + 'identity': {'key': 'identity', 'type': 'EncryptionSetIdentity'}, + 'encryption_type': {'key': 'properties.encryptionType', 'type': 'str'}, + 'active_key': {'key': 'properties.activeKey', 'type': 'KeyVaultAndKeyReference'}, + 'previous_keys': {'key': 'properties.previousKeys', 'type': '[KeyVaultAndKeyReference]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + 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 + + +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 disk encryption sets. + :type value: list[~azure.mgmt.compute.v2020_05_01.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 = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DiskEncryptionSet]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DiskEncryptionSetList, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class DiskEncryptionSetUpdate(msrest.serialization.Model): + """disk encryption set update resource. + + :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: "EncryptionAtRestWithPlatformKey", "EncryptionAtRestWithCustomerKey", + "EncryptionAtRestWithPlatformAndCustomerKeys". + :type encryption_type: str or ~azure.mgmt.compute.v2020_05_01.models.EncryptionType + :param active_key: Key Vault Key Url and vault id of KeK, KeK is optional and when provided is + used to unwrap the encryptionKey. + :type active_key: ~azure.mgmt.compute.v2020_05_01.models.KeyVaultAndKeyReference + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'encryption_type': {'key': 'properties.encryptionType', 'type': 'str'}, + 'active_key': {'key': 'properties.activeKey', 'type': 'KeyVaultAndKeyReference'}, + } + + def __init__( + self, + **kwargs + ): + 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 DiskList(msrest.serialization.Model): + """The List Disks operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of disks. + :type value: list[~azure.mgmt.compute.v2020_05_01.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 = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Disk]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DiskList, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +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. + + :param name: The sku name. Possible values include: "Standard_LRS", "Premium_LRS", + "StandardSSD_LRS", "UltraSSD_LRS". + :type name: str or ~azure.mgmt.compute.v2020_05_01.models.DiskStorageAccountTypes + :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(DiskSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = None + + +class DiskUpdate(msrest.serialization.Model): + """Disk update resource. + + :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_05_01.models.DiskSku + :param os_type: the Operating System type. Possible values include: "Windows", "Linux". + :type os_type: str or ~azure.mgmt.compute.v2020_05_01.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_05_01.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_05_01.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_05_01.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': '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'}, + } + + def __init__( + self, + **kwargs + ): + 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) + + +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_05_01.models.EncryptionType + """ + + _attribute_map = { + 'disk_encryption_set_id': {'key': 'diskEncryptionSetId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Encryption, self).__init__(**kwargs) + self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) + self.type = kwargs.get('type', 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. Possible values include: "SystemAssigned". + :type type: str or ~azure.mgmt.compute.v2020_05_01.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, + **kwargs + ): + super(EncryptionSetIdentity, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + 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. + + :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_05_01.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 = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'encryption_settings': {'key': 'encryptionSettings', 'type': '[EncryptionSettingsElement]'}, + 'encryption_settings_version': {'key': 'encryptionSettingsVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + 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 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_05_01.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_05_01.models.KeyVaultAndKeyReference + """ + + _attribute_map = { + 'disk_encryption_key': {'key': 'diskEncryptionKey', 'type': 'KeyVaultAndSecretReference'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyVaultAndKeyReference'}, + } + + def __init__( + self, + **kwargs + ): + 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 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_05_01.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 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 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_05_01.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, + **kwargs + ): + super(KeyVaultAndKeyReference, self).__init__(**kwargs) + self.source_vault = kwargs['source_vault'] + self.key_url = kwargs['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_05_01.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, + **kwargs + ): + super(KeyVaultAndSecretReference, self).__init__(**kwargs) + self.source_vault = kwargs['source_vault'] + self.secret_url = kwargs['secret_url'] + + +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 id: The ARM identifier for Private Endpoint. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None + + +class PrivateEndpointConnection(msrest.serialization.Model): + """The Private Endpoint Connection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: private endpoint connection Id. + :vartype id: str + :ivar name: private endpoint connection name. + :vartype name: str + :ivar type: private endpoint connection type. + :vartype type: str + :param private_endpoint: The resource of private end point. + :type private_endpoint: ~azure.mgmt.compute.v2020_05_01.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_05_01.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_05_01.models.PrivateEndpointConnectionProvisioningState + """ + + _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'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + 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 PrivateLinkResource(msrest.serialization.Model): + """A private link resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :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': {'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(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 PrivateLinkResourceListResult(msrest.serialization.Model): + """A list of private link resources. + + :param value: Array of private link resources. + :type value: list[~azure.mgmt.compute.v2020_05_01.models.PrivateLinkResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResourceListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class PrivateLinkServiceConnectionState(msrest.serialization.Model): + """A collection of information about the state of the connection between service consumer and provider. + + :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_05_01.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 + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + 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 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 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. + :type sku: ~azure.mgmt.compute.v2020_05_01.models.SnapshotSku + :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_05_01.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_05_01.models.HyperVGeneration + :param creation_data: Disk source information. CreationData information cannot be changed after + the disk has been created. + :type creation_data: ~azure.mgmt.compute.v2020_05_01.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 be Azure Disk + Encryption, can contain multiple encryption settings per disk or snapshot. + :type encryption_settings_collection: + ~azure.mgmt.compute.v2020_05_01.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_05_01.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_05_01.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}, + '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'}, + 'time_created': {'key': 'properties.timeCreated', 'type': 'iso-8601'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, + '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'}, + '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.time_created = None + self.os_type = kwargs.get('os_type', None) + self.hyper_v_generation = kwargs.get('hyper_v_generation', 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.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_05_01.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. + + 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_05_01.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. + :type sku: ~azure.mgmt.compute.v2020_05_01.models.SnapshotSku + :param os_type: the Operating System type. Possible values include: "Windows", "Linux". + :type os_type: str or ~azure.mgmt.compute.v2020_05_01.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_05_01.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_05_01.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_05_01.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) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/models/_models_py3.py new file mode 100644 index 000000000000..85a2d73db4bf --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/models/_models_py3.py @@ -0,0 +1,1617 @@ +# 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 Dict, List, Optional, Union + +import msrest.serialization + +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. + + :param details: The Api error details. + :type details: list[~azure.mgmt.compute.v2020_05_01.models.ApiErrorBase] + :param innererror: The Api inner error. + :type innererror: ~azure.mgmt.compute.v2020_05_01.models.InnerError + :param code: The error code. + :type code: str + :param target: The target of the particular error. + :type target: str + :param message: The error message. + :type message: str + """ + + _attribute_map = { + 'details': {'key': 'details', 'type': '[ApiErrorBase]'}, + 'innererror': {'key': 'innererror', 'type': 'InnerError'}, + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + details: Optional[List["ApiErrorBase"]] = None, + innererror: Optional["InnerError"] = None, + code: Optional[str] = None, + target: Optional[str] = None, + message: Optional[str] = None, + **kwargs + ): + super(ApiError, self).__init__(**kwargs) + self.details = details + self.innererror = innererror + self.code = code + self.target = target + self.message = message + + +class ApiErrorBase(msrest.serialization.Model): + """Api error base. + + :param code: The error code. + :type code: str + :param target: The target of the particular error. + :type target: str + :param message: The error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + target: Optional[str] = None, + message: Optional[str] = None, + **kwargs + ): + super(ApiErrorBase, self).__init__(**kwargs) + self.code = code + self.target = target + 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_05_01.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_05_01.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_05_01.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 + """ + + _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'}, + } + + 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, + **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 + + +class Resource(msrest.serialization.Model): + """The 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. + + :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] + """ + + _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}'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + + +class Disk(Resource): + """Disk 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: 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_05_01.models.DiskSku + :param zones: The Logical zone list for Disk. + :type zones: list[str] + :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_05_01.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_05_01.models.HyperVGeneration + :param creation_data: Disk source information. CreationData information cannot be changed after + the disk has been created. + :type creation_data: ~azure.mgmt.compute.v2020_05_01.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_05_01.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_05_01.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_05_01.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_05_01.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_05_01.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}, + '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 = { + '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'}, + 'managed_by_extended': {'key': 'managedByExtended', 'type': '[str]'}, + 'sku': {'key': 'sku', 'type': 'DiskSku'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'time_created': {'key': 'properties.timeCreated', 'type': 'iso-8601'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, + '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'}, + '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'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + sku: Optional["DiskSku"] = None, + zones: Optional[List[str]] = None, + os_type: Optional[Union[str, "OperatingSystemTypes"]] = None, + hyper_v_generation: Optional[Union[str, "HyperVGeneration"]] = 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, + **kwargs + ): + 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.time_created = None + self.os_type = os_type + self.hyper_v_generation = hyper_v_generation + 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.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 + + +class DiskAccess(Resource): + """disk access 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 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_05_01.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 = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'private_endpoint_connections': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'time_created': {'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}'}, + '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, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(DiskAccess, self).__init__(location=location, tags=tags, **kwargs) + self.private_endpoint_connections = None + self.provisioning_state = None + self.time_created = None + + +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 disk access resources. + :type value: list[~azure.mgmt.compute.v2020_05_01.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 + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DiskAccess]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["DiskAccess"], + next_link: Optional[str] = None, + **kwargs + ): + super(DiskAccessList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class DiskAccessUpdate(msrest.serialization.Model): + """Used for updating a disk access resource. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(DiskAccessUpdate, self).__init__(**kwargs) + self.tags = tags + + +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 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_05_01.models.EncryptionSetIdentity + :param encryption_type: The type of key used to encrypt the data of the disk. Possible values + include: "EncryptionAtRestWithPlatformKey", "EncryptionAtRestWithCustomerKey", + "EncryptionAtRestWithPlatformAndCustomerKeys". + :type encryption_type: str or ~azure.mgmt.compute.v2020_05_01.models.EncryptionType + :param active_key: The key vault key which is currently used by this disk encryption set. + :type active_key: ~azure.mgmt.compute.v2020_05_01.models.KeyVaultAndKeyReference + :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_05_01.models.KeyVaultAndKeyReference] + :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}'}, + 'identity': {'key': 'identity', 'type': 'EncryptionSetIdentity'}, + 'encryption_type': {'key': 'properties.encryptionType', 'type': 'str'}, + 'active_key': {'key': 'properties.activeKey', 'type': 'KeyVaultAndKeyReference'}, + 'previous_keys': {'key': 'properties.previousKeys', 'type': '[KeyVaultAndKeyReference]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + identity: Optional["EncryptionSetIdentity"] = None, + encryption_type: Optional[Union[str, "EncryptionType"]] = None, + active_key: Optional["KeyVaultAndKeyReference"] = None, + **kwargs + ): + 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 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 disk encryption sets. + :type value: list[~azure.mgmt.compute.v2020_05_01.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 = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DiskEncryptionSet]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["DiskEncryptionSet"], + next_link: Optional[str] = None, + **kwargs + ): + super(DiskEncryptionSetList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class DiskEncryptionSetUpdate(msrest.serialization.Model): + """disk encryption set update resource. + + :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: "EncryptionAtRestWithPlatformKey", "EncryptionAtRestWithCustomerKey", + "EncryptionAtRestWithPlatformAndCustomerKeys". + :type encryption_type: str or ~azure.mgmt.compute.v2020_05_01.models.EncryptionType + :param active_key: Key Vault Key Url and vault id of KeK, KeK is optional and when provided is + used to unwrap the encryptionKey. + :type active_key: ~azure.mgmt.compute.v2020_05_01.models.KeyVaultAndKeyReference + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'encryption_type': {'key': 'properties.encryptionType', 'type': 'str'}, + 'active_key': {'key': 'properties.activeKey', 'type': 'KeyVaultAndKeyReference'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + encryption_type: Optional[Union[str, "EncryptionType"]] = None, + active_key: Optional["KeyVaultAndKeyReference"] = None, + **kwargs + ): + super(DiskEncryptionSetUpdate, self).__init__(**kwargs) + self.tags = tags + self.encryption_type = encryption_type + self.active_key = active_key + + +class DiskList(msrest.serialization.Model): + """The List Disks operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of disks. + :type value: list[~azure.mgmt.compute.v2020_05_01.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 = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Disk]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["Disk"], + next_link: Optional[str] = None, + **kwargs + ): + super(DiskList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +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. + + :param name: The sku name. Possible values include: "Standard_LRS", "Premium_LRS", + "StandardSSD_LRS", "UltraSSD_LRS". + :type name: str or ~azure.mgmt.compute.v2020_05_01.models.DiskStorageAccountTypes + :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, "DiskStorageAccountTypes"]] = None, + **kwargs + ): + super(DiskSku, self).__init__(**kwargs) + self.name = name + self.tier = None + + +class DiskUpdate(msrest.serialization.Model): + """Disk update resource. + + :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_05_01.models.DiskSku + :param os_type: the Operating System type. Possible values include: "Windows", "Linux". + :type os_type: str or ~azure.mgmt.compute.v2020_05_01.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_05_01.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_05_01.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_05_01.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': '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'}, + } + + def __init__( + self, + *, + 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, + **kwargs + ): + 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 + + +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_05_01.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 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. Possible values include: "SystemAssigned". + :type type: str or ~azure.mgmt.compute.v2020_05_01.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. + + :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_05_01.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 = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'encryption_settings': {'key': 'encryptionSettings', 'type': '[EncryptionSettingsElement]'}, + 'encryption_settings_version': {'key': 'encryptionSettingsVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + enabled: bool, + encryption_settings: Optional[List["EncryptionSettingsElement"]] = None, + encryption_settings_version: Optional[str] = None, + **kwargs + ): + super(EncryptionSettingsCollection, self).__init__(**kwargs) + self.enabled = enabled + self.encryption_settings = encryption_settings + self.encryption_settings_version = encryption_settings_version + + +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_05_01.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_05_01.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 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_05_01.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 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 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_05_01.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_05_01.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 PrivateEndpoint(msrest.serialization.Model): + """The Private Endpoint resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ARM identifier for Private Endpoint. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None + + +class PrivateEndpointConnection(msrest.serialization.Model): + """The Private Endpoint Connection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: private endpoint connection Id. + :vartype id: str + :ivar name: private endpoint connection name. + :vartype name: str + :ivar type: private endpoint connection type. + :vartype type: str + :param private_endpoint: The resource of private end point. + :type private_endpoint: ~azure.mgmt.compute.v2020_05_01.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_05_01.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_05_01.models.PrivateEndpointConnectionProvisioningState + """ + + _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'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + private_endpoint: Optional["PrivateEndpoint"] = None, + private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, + **kwargs + ): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + self.provisioning_state = None + + +class PrivateLinkResource(msrest.serialization.Model): + """A private link resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :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': {'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, + *, + required_zone_names: Optional[List[str]] = None, + **kwargs + ): + 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 PrivateLinkResourceListResult(msrest.serialization.Model): + """A list of private link resources. + + :param value: Array of private link resources. + :type value: list[~azure.mgmt.compute.v2020_05_01.models.PrivateLinkResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__( + self, + *, + value: Optional[List["PrivateLinkResource"]] = None, + **kwargs + ): + super(PrivateLinkResourceListResult, self).__init__(**kwargs) + self.value = value + + +class PrivateLinkServiceConnectionState(msrest.serialization.Model): + """A collection of information about the state of the connection between service consumer and provider. + + :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_05_01.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 + """ + + _attribute_map = { + '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(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + self.actions_required = actions_required + + +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 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. + :type sku: ~azure.mgmt.compute.v2020_05_01.models.SnapshotSku + :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_05_01.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_05_01.models.HyperVGeneration + :param creation_data: Disk source information. CreationData information cannot be changed after + the disk has been created. + :type creation_data: ~azure.mgmt.compute.v2020_05_01.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 be Azure Disk + Encryption, can contain multiple encryption settings per disk or snapshot. + :type encryption_settings_collection: + ~azure.mgmt.compute.v2020_05_01.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_05_01.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_05_01.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}, + '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'}, + 'time_created': {'key': 'properties.timeCreated', 'type': 'iso-8601'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, + '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'}, + '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, + os_type: Optional[Union[str, "OperatingSystemTypes"]] = None, + hyper_v_generation: Optional[Union[str, "HyperVGeneration"]] = 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.time_created = None + self.os_type = os_type + self.hyper_v_generation = hyper_v_generation + 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.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_05_01.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. + + 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_05_01.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. + :type sku: ~azure.mgmt.compute.v2020_05_01.models.SnapshotSku + :param os_type: the Operating System type. Possible values include: "Windows", "Linux". + :type os_type: str or ~azure.mgmt.compute.v2020_05_01.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_05_01.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_05_01.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_05_01.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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/__init__.py new file mode 100644 index 000000000000..22cffb20eb1d --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/__init__.py @@ -0,0 +1,19 @@ +# 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 ._disks_operations import DisksOperations +from ._snapshots_operations import SnapshotsOperations +from ._disk_encryption_sets_operations import DiskEncryptionSetsOperations +from ._disk_accesses_operations import DiskAccessesOperations + +__all__ = [ + 'DisksOperations', + 'SnapshotsOperations', + 'DiskEncryptionSetsOperations', + 'DiskAccessesOperations', +] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disk_accesses_operations.py new file mode 100644 index 000000000000..43706935e19a --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disk_accesses_operations.py @@ -0,0 +1,666 @@ +# 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 + +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_05_01.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-05-01" + 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_05_01.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_05_01.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 + + if polling is True: polling_method = ARMPolling(lro_delay, **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-05-01" + 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_05_01.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_05_01.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 + + if polling is True: polling_method = ARMPolling(lro_delay, **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_05_01.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-05-01" + 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-05-01" + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_05_01.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-05-01" + 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_05_01.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-05-01" + 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_05_01.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-05-01" + 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disk_encryption_sets_operations.py new file mode 100644 index 000000000000..f3a012417c0c --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disk_encryption_sets_operations.py @@ -0,0 +1,607 @@ +# 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 + +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_05_01.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-05-01" + 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_05_01.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_05_01.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 + + if polling is True: polling_method = ARMPolling(lro_delay, **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-05-01" + 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_05_01.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_05_01.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 + + if polling is True: polling_method = ARMPolling(lro_delay, **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_05_01.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-05-01" + 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-05-01" + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_05_01.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-05-01" + 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_05_01.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-05-01" + 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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disks_operations.py new file mode 100644 index 000000000000..74facb9c7ba9 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disks_operations.py @@ -0,0 +1,832 @@ +# 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 + +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_05_01.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-05-01" + 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_05_01.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_05_01.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 + + if polling is True: polling_method = ARMPolling(lro_delay, **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-05-01" + 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_05_01.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_05_01.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 + + if polling is True: polling_method = ARMPolling(lro_delay, **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_05_01.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-05-01" + 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-05-01" + + # 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_05_01.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-05-01" + 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_05_01.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-05-01" + 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-05-01" + 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_05_01.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_05_01.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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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-05-01" + + # 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_snapshots_operations.py new file mode 100644 index 000000000000..ab723b84a4cc --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_snapshots_operations.py @@ -0,0 +1,832 @@ +# 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 + +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_05_01.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-05-01" + 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_05_01.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_05_01.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 + + if polling is True: polling_method = ARMPolling(lro_delay, **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-05-01" + 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_05_01.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_05_01.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 + + if polling is True: polling_method = ARMPolling(lro_delay, **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_05_01.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-05-01" + 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-05-01" + + # 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_05_01.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-05-01" + 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_05_01.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-05-01" + 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-05-01" + 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_05_01.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_05_01.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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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-05-01" + + # 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/py.typed b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/__init__.py new file mode 100644 index 000000000000..cdc7f7a1709a --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/__init__.py @@ -0,0 +1,16 @@ +# 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 ._compute_management_client import ComputeManagementClient +__all__ = ['ComputeManagementClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass 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 new file mode 100644 index 000000000000..7d4c6c501c3b --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_compute_management_client.py @@ -0,0 +1,165 @@ +# 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 + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + +from ._configuration import ComputeManagementClientConfiguration +from .operations import Operations +from .operations import AvailabilitySetsOperations +from .operations import ProximityPlacementGroupsOperations +from .operations import DedicatedHostGroupsOperations +from .operations import DedicatedHostsOperations +from .operations import SshPublicKeysOperations +from .operations import VirtualMachineExtensionImagesOperations +from .operations import VirtualMachineExtensionsOperations +from .operations import VirtualMachineImagesOperations +from .operations import UsageOperations +from .operations import VirtualMachinesOperations +from .operations import VirtualMachineSizesOperations +from .operations import ImagesOperations +from .operations import VirtualMachineScaleSetsOperations +from .operations import VirtualMachineScaleSetExtensionsOperations +from .operations import VirtualMachineScaleSetRollingUpgradesOperations +from .operations import VirtualMachineScaleSetVMExtensionsOperations +from .operations import VirtualMachineScaleSetVMsOperations +from .operations import LogAnalyticsOperations +from .operations import VirtualMachineRunCommandsOperations +from . import models + + +class ComputeManagementClient(object): + """Compute Client. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.compute.v2020_06_01.operations.Operations + :ivar availability_sets: AvailabilitySetsOperations operations + :vartype availability_sets: azure.mgmt.compute.v2020_06_01.operations.AvailabilitySetsOperations + :ivar proximity_placement_groups: ProximityPlacementGroupsOperations operations + :vartype proximity_placement_groups: azure.mgmt.compute.v2020_06_01.operations.ProximityPlacementGroupsOperations + :ivar dedicated_host_groups: DedicatedHostGroupsOperations operations + :vartype dedicated_host_groups: azure.mgmt.compute.v2020_06_01.operations.DedicatedHostGroupsOperations + :ivar dedicated_hosts: DedicatedHostsOperations operations + :vartype dedicated_hosts: azure.mgmt.compute.v2020_06_01.operations.DedicatedHostsOperations + :ivar ssh_public_keys: SshPublicKeysOperations operations + :vartype ssh_public_keys: azure.mgmt.compute.v2020_06_01.operations.SshPublicKeysOperations + :ivar virtual_machine_extension_images: VirtualMachineExtensionImagesOperations operations + :vartype virtual_machine_extension_images: azure.mgmt.compute.v2020_06_01.operations.VirtualMachineExtensionImagesOperations + :ivar virtual_machine_extensions: VirtualMachineExtensionsOperations operations + :vartype virtual_machine_extensions: azure.mgmt.compute.v2020_06_01.operations.VirtualMachineExtensionsOperations + :ivar virtual_machine_images: VirtualMachineImagesOperations operations + :vartype virtual_machine_images: azure.mgmt.compute.v2020_06_01.operations.VirtualMachineImagesOperations + :ivar usage: UsageOperations operations + :vartype usage: azure.mgmt.compute.v2020_06_01.operations.UsageOperations + :ivar virtual_machines: VirtualMachinesOperations operations + :vartype virtual_machines: azure.mgmt.compute.v2020_06_01.operations.VirtualMachinesOperations + :ivar virtual_machine_sizes: VirtualMachineSizesOperations operations + :vartype virtual_machine_sizes: azure.mgmt.compute.v2020_06_01.operations.VirtualMachineSizesOperations + :ivar images: ImagesOperations operations + :vartype images: azure.mgmt.compute.v2020_06_01.operations.ImagesOperations + :ivar virtual_machine_scale_sets: VirtualMachineScaleSetsOperations operations + :vartype virtual_machine_scale_sets: azure.mgmt.compute.v2020_06_01.operations.VirtualMachineScaleSetsOperations + :ivar virtual_machine_scale_set_extensions: VirtualMachineScaleSetExtensionsOperations operations + :vartype virtual_machine_scale_set_extensions: azure.mgmt.compute.v2020_06_01.operations.VirtualMachineScaleSetExtensionsOperations + :ivar virtual_machine_scale_set_rolling_upgrades: VirtualMachineScaleSetRollingUpgradesOperations operations + :vartype virtual_machine_scale_set_rolling_upgrades: azure.mgmt.compute.v2020_06_01.operations.VirtualMachineScaleSetRollingUpgradesOperations + :ivar virtual_machine_scale_set_vm_extensions: VirtualMachineScaleSetVMExtensionsOperations operations + :vartype virtual_machine_scale_set_vm_extensions: azure.mgmt.compute.v2020_06_01.operations.VirtualMachineScaleSetVMExtensionsOperations + :ivar virtual_machine_scale_set_vms: VirtualMachineScaleSetVMsOperations operations + :vartype virtual_machine_scale_set_vms: azure.mgmt.compute.v2020_06_01.operations.VirtualMachineScaleSetVMsOperations + :ivar log_analytics: LogAnalyticsOperations operations + :vartype log_analytics: azure.mgmt.compute.v2020_06_01.operations.LogAnalyticsOperations + :ivar virtual_machine_run_commands: VirtualMachineRunCommandsOperations operations + :vartype virtual_machine_run_commands: azure.mgmt.compute.v2020_06_01.operations.VirtualMachineRunCommandsOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = ComputeManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + 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( + self._client, self._config, self._serialize, self._deserialize) + self.availability_sets = AvailabilitySetsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.proximity_placement_groups = ProximityPlacementGroupsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.dedicated_host_groups = DedicatedHostGroupsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.dedicated_hosts = DedicatedHostsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.ssh_public_keys = SshPublicKeysOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_machine_extension_images = VirtualMachineExtensionImagesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_machine_extensions = VirtualMachineExtensionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_machine_images = VirtualMachineImagesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.usage = UsageOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_machines = VirtualMachinesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_machine_sizes = VirtualMachineSizesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.images = ImagesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_machine_scale_sets = VirtualMachineScaleSetsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_machine_scale_set_extensions = VirtualMachineScaleSetExtensionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_machine_scale_set_rolling_upgrades = VirtualMachineScaleSetRollingUpgradesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_machine_scale_set_vm_extensions = VirtualMachineScaleSetVMExtensionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_machine_scale_set_vms = VirtualMachineScaleSetVMsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.log_analytics = LogAnalyticsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_machine_run_commands = VirtualMachineRunCommandsOperations( + self._client, self._config, self._serialize, self._deserialize) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> ComputeManagementClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_configuration.py new file mode 100644 index 000000000000..da0a0d93973b --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_configuration.py @@ -0,0 +1,70 @@ +# 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 + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class ComputeManagementClientConfiguration(Configuration): + """Configuration for ComputeManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(ComputeManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-06-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-compute/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) 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 new file mode 100644 index 000000000000..5317d08e1be7 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_metadata.json @@ -0,0 +1,79 @@ +{ + "chosen_version": "2020-06-01", + "total_api_version_list": ["2020-06-01"], + "client": { + "name": "ComputeManagementClient", + "filename": "_compute_management_client", + "description": "Compute Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true + }, + "global_parameters": { + "sync_method": { + "credential": { + "method_signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "method_signature": "subscription_id, # type: str", + "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + "docstring_type": "str", + "required": true + } + }, + "async_method": { + "credential": { + "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "method_signature": "subscription_id, # type: str", + "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id" + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null + }, + "operation_groups": { + "operations": "Operations", + "availability_sets": "AvailabilitySetsOperations", + "proximity_placement_groups": "ProximityPlacementGroupsOperations", + "dedicated_host_groups": "DedicatedHostGroupsOperations", + "dedicated_hosts": "DedicatedHostsOperations", + "ssh_public_keys": "SshPublicKeysOperations", + "virtual_machine_extension_images": "VirtualMachineExtensionImagesOperations", + "virtual_machine_extensions": "VirtualMachineExtensionsOperations", + "virtual_machine_images": "VirtualMachineImagesOperations", + "usage": "UsageOperations", + "virtual_machines": "VirtualMachinesOperations", + "virtual_machine_sizes": "VirtualMachineSizesOperations", + "images": "ImagesOperations", + "virtual_machine_scale_sets": "VirtualMachineScaleSetsOperations", + "virtual_machine_scale_set_extensions": "VirtualMachineScaleSetExtensionsOperations", + "virtual_machine_scale_set_rolling_upgrades": "VirtualMachineScaleSetRollingUpgradesOperations", + "virtual_machine_scale_set_vm_extensions": "VirtualMachineScaleSetVMExtensionsOperations", + "virtual_machine_scale_set_vms": "VirtualMachineScaleSetVMsOperations", + "log_analytics": "LogAnalyticsOperations", + "virtual_machine_run_commands": "VirtualMachineRunCommandsOperations" + }, + "operation_mixins": { + }, + "sync_imports": "None", + "async_imports": "None" +} \ No newline at end of file diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/__init__.py new file mode 100644 index 000000000000..9e9459635989 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/__init__.py @@ -0,0 +1,10 @@ +# 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 ._compute_management_client import ComputeManagementClient +__all__ = ['ComputeManagementClient'] 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 new file mode 100644 index 000000000000..83afd173f469 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/_compute_management_client.py @@ -0,0 +1,159 @@ +# 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, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import ComputeManagementClientConfiguration +from .operations import Operations +from .operations import AvailabilitySetsOperations +from .operations import ProximityPlacementGroupsOperations +from .operations import DedicatedHostGroupsOperations +from .operations import DedicatedHostsOperations +from .operations import SshPublicKeysOperations +from .operations import VirtualMachineExtensionImagesOperations +from .operations import VirtualMachineExtensionsOperations +from .operations import VirtualMachineImagesOperations +from .operations import UsageOperations +from .operations import VirtualMachinesOperations +from .operations import VirtualMachineSizesOperations +from .operations import ImagesOperations +from .operations import VirtualMachineScaleSetsOperations +from .operations import VirtualMachineScaleSetExtensionsOperations +from .operations import VirtualMachineScaleSetRollingUpgradesOperations +from .operations import VirtualMachineScaleSetVMExtensionsOperations +from .operations import VirtualMachineScaleSetVMsOperations +from .operations import LogAnalyticsOperations +from .operations import VirtualMachineRunCommandsOperations +from .. import models + + +class ComputeManagementClient(object): + """Compute Client. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.compute.v2020_06_01.aio.operations.Operations + :ivar availability_sets: AvailabilitySetsOperations operations + :vartype availability_sets: azure.mgmt.compute.v2020_06_01.aio.operations.AvailabilitySetsOperations + :ivar proximity_placement_groups: ProximityPlacementGroupsOperations operations + :vartype proximity_placement_groups: azure.mgmt.compute.v2020_06_01.aio.operations.ProximityPlacementGroupsOperations + :ivar dedicated_host_groups: DedicatedHostGroupsOperations operations + :vartype dedicated_host_groups: azure.mgmt.compute.v2020_06_01.aio.operations.DedicatedHostGroupsOperations + :ivar dedicated_hosts: DedicatedHostsOperations operations + :vartype dedicated_hosts: azure.mgmt.compute.v2020_06_01.aio.operations.DedicatedHostsOperations + :ivar ssh_public_keys: SshPublicKeysOperations operations + :vartype ssh_public_keys: azure.mgmt.compute.v2020_06_01.aio.operations.SshPublicKeysOperations + :ivar virtual_machine_extension_images: VirtualMachineExtensionImagesOperations operations + :vartype virtual_machine_extension_images: azure.mgmt.compute.v2020_06_01.aio.operations.VirtualMachineExtensionImagesOperations + :ivar virtual_machine_extensions: VirtualMachineExtensionsOperations operations + :vartype virtual_machine_extensions: azure.mgmt.compute.v2020_06_01.aio.operations.VirtualMachineExtensionsOperations + :ivar virtual_machine_images: VirtualMachineImagesOperations operations + :vartype virtual_machine_images: azure.mgmt.compute.v2020_06_01.aio.operations.VirtualMachineImagesOperations + :ivar usage: UsageOperations operations + :vartype usage: azure.mgmt.compute.v2020_06_01.aio.operations.UsageOperations + :ivar virtual_machines: VirtualMachinesOperations operations + :vartype virtual_machines: azure.mgmt.compute.v2020_06_01.aio.operations.VirtualMachinesOperations + :ivar virtual_machine_sizes: VirtualMachineSizesOperations operations + :vartype virtual_machine_sizes: azure.mgmt.compute.v2020_06_01.aio.operations.VirtualMachineSizesOperations + :ivar images: ImagesOperations operations + :vartype images: azure.mgmt.compute.v2020_06_01.aio.operations.ImagesOperations + :ivar virtual_machine_scale_sets: VirtualMachineScaleSetsOperations operations + :vartype virtual_machine_scale_sets: azure.mgmt.compute.v2020_06_01.aio.operations.VirtualMachineScaleSetsOperations + :ivar virtual_machine_scale_set_extensions: VirtualMachineScaleSetExtensionsOperations operations + :vartype virtual_machine_scale_set_extensions: azure.mgmt.compute.v2020_06_01.aio.operations.VirtualMachineScaleSetExtensionsOperations + :ivar virtual_machine_scale_set_rolling_upgrades: VirtualMachineScaleSetRollingUpgradesOperations operations + :vartype virtual_machine_scale_set_rolling_upgrades: azure.mgmt.compute.v2020_06_01.aio.operations.VirtualMachineScaleSetRollingUpgradesOperations + :ivar virtual_machine_scale_set_vm_extensions: VirtualMachineScaleSetVMExtensionsOperations operations + :vartype virtual_machine_scale_set_vm_extensions: azure.mgmt.compute.v2020_06_01.aio.operations.VirtualMachineScaleSetVMExtensionsOperations + :ivar virtual_machine_scale_set_vms: VirtualMachineScaleSetVMsOperations operations + :vartype virtual_machine_scale_set_vms: azure.mgmt.compute.v2020_06_01.aio.operations.VirtualMachineScaleSetVMsOperations + :ivar log_analytics: LogAnalyticsOperations operations + :vartype log_analytics: azure.mgmt.compute.v2020_06_01.aio.operations.LogAnalyticsOperations + :ivar virtual_machine_run_commands: VirtualMachineRunCommandsOperations operations + :vartype virtual_machine_run_commands: azure.mgmt.compute.v2020_06_01.aio.operations.VirtualMachineRunCommandsOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = ComputeManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + 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( + self._client, self._config, self._serialize, self._deserialize) + self.availability_sets = AvailabilitySetsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.proximity_placement_groups = ProximityPlacementGroupsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.dedicated_host_groups = DedicatedHostGroupsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.dedicated_hosts = DedicatedHostsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.ssh_public_keys = SshPublicKeysOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_machine_extension_images = VirtualMachineExtensionImagesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_machine_extensions = VirtualMachineExtensionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_machine_images = VirtualMachineImagesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.usage = UsageOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_machines = VirtualMachinesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_machine_sizes = VirtualMachineSizesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.images = ImagesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_machine_scale_sets = VirtualMachineScaleSetsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_machine_scale_set_extensions = VirtualMachineScaleSetExtensionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_machine_scale_set_rolling_upgrades = VirtualMachineScaleSetRollingUpgradesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_machine_scale_set_vm_extensions = VirtualMachineScaleSetVMExtensionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_machine_scale_set_vms = VirtualMachineScaleSetVMsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.log_analytics = LogAnalyticsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_machine_run_commands = VirtualMachineRunCommandsOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "ComputeManagementClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/_configuration.py new file mode 100644 index 000000000000..366e07b06b21 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/_configuration.py @@ -0,0 +1,66 @@ +# 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, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class ComputeManagementClientConfiguration(Configuration): + """Configuration for ComputeManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(ComputeManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-06-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-compute/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/__init__.py new file mode 100644 index 000000000000..059428308b09 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/__init__.py @@ -0,0 +1,51 @@ +# 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 ._operations import Operations +from ._availability_sets_operations import AvailabilitySetsOperations +from ._proximity_placement_groups_operations import ProximityPlacementGroupsOperations +from ._dedicated_host_groups_operations import DedicatedHostGroupsOperations +from ._dedicated_hosts_operations import DedicatedHostsOperations +from ._ssh_public_keys_operations import SshPublicKeysOperations +from ._virtual_machine_extension_images_operations import VirtualMachineExtensionImagesOperations +from ._virtual_machine_extensions_operations import VirtualMachineExtensionsOperations +from ._virtual_machine_images_operations import VirtualMachineImagesOperations +from ._usage_operations import UsageOperations +from ._virtual_machines_operations import VirtualMachinesOperations +from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations +from ._images_operations import ImagesOperations +from ._virtual_machine_scale_sets_operations import VirtualMachineScaleSetsOperations +from ._virtual_machine_scale_set_extensions_operations import VirtualMachineScaleSetExtensionsOperations +from ._virtual_machine_scale_set_rolling_upgrades_operations import VirtualMachineScaleSetRollingUpgradesOperations +from ._virtual_machine_scale_set_vm_extensions_operations import VirtualMachineScaleSetVMExtensionsOperations +from ._virtual_machine_scale_set_vms_operations import VirtualMachineScaleSetVMsOperations +from ._log_analytics_operations import LogAnalyticsOperations +from ._virtual_machine_run_commands_operations import VirtualMachineRunCommandsOperations + +__all__ = [ + 'Operations', + 'AvailabilitySetsOperations', + 'ProximityPlacementGroupsOperations', + 'DedicatedHostGroupsOperations', + 'DedicatedHostsOperations', + 'SshPublicKeysOperations', + 'VirtualMachineExtensionImagesOperations', + 'VirtualMachineExtensionsOperations', + 'VirtualMachineImagesOperations', + 'UsageOperations', + 'VirtualMachinesOperations', + 'VirtualMachineSizesOperations', + 'ImagesOperations', + 'VirtualMachineScaleSetsOperations', + 'VirtualMachineScaleSetExtensionsOperations', + 'VirtualMachineScaleSetRollingUpgradesOperations', + 'VirtualMachineScaleSetVMExtensionsOperations', + 'VirtualMachineScaleSetVMsOperations', + 'LogAnalyticsOperations', + 'VirtualMachineRunCommandsOperations', +] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_availability_sets_operations.py new file mode 100644 index 000000000000..fe5d5207ccb4 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_availability_sets_operations.py @@ -0,0 +1,502 @@ +# 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 + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AvailabilitySetsOperations: + """AvailabilitySetsOperations 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_06_01.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( + self, + resource_group_name: str, + availability_set_name: str, + parameters: "models.AvailabilitySet", + **kwargs + ) -> "models.AvailabilitySet": + """Create or update an availability set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param availability_set_name: The name of the availability set. + :type availability_set_name: str + :param parameters: Parameters supplied to the Create Availability Set operation. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.AvailabilitySet + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AvailabilitySet, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.AvailabilitySet + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'availabilitySetName': self._serialize.url("availability_set_name", availability_set_name, 'str'), + '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') + + # 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(parameters, 'AvailabilitySet') + 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AvailabilitySet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + availability_set_name: str, + parameters: "models.AvailabilitySetUpdate", + **kwargs + ) -> "models.AvailabilitySet": + """Update an availability set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param availability_set_name: The name of the availability set. + :type availability_set_name: str + :param parameters: Parameters supplied to the Update Availability Set operation. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.AvailabilitySetUpdate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AvailabilitySet, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.AvailabilitySet + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'availabilitySetName': self._serialize.url("availability_set_name", availability_set_name, 'str'), + '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') + + # 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(parameters, 'AvailabilitySetUpdate') + 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AvailabilitySet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + availability_set_name: str, + **kwargs + ) -> None: + """Delete an availability set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param availability_set_name: The name of the availability set. + :type availability_set_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-06-01" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'availabilitySetName': self._serialize.url("availability_set_name", availability_set_name, 'str'), + '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') + + # 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, 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + availability_set_name: str, + **kwargs + ) -> "models.AvailabilitySet": + """Retrieves information about an availability set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param availability_set_name: The name of the availability set. + :type availability_set_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AvailabilitySet, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.AvailabilitySet + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'availabilitySetName': self._serialize.url("availability_set_name", availability_set_name, 'str'), + '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') + + # 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('AvailabilitySet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}'} # type: ignore + + def list_by_subscription( + self, + expand: Optional[str] = None, + **kwargs + ) -> AsyncIterable["models.AvailabilitySetListResult"]: + """Lists all availability sets in a subscription. + + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AvailabilitySetListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.AvailabilitySetListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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_subscription.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') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, '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('AvailabilitySetListResult', 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_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/availabilitySets'} # type: ignore + + def list( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["models.AvailabilitySetListResult"]: + """Lists all availability sets in 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 AvailabilitySetListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.AvailabilitySetListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + '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('AvailabilitySetListResult', 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets'} # type: ignore + + def list_available_sizes( + self, + resource_group_name: str, + availability_set_name: str, + **kwargs + ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + """Lists all available virtual machine sizes that can be used to create a new virtual machine in + an existing availability set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param availability_set_name: The name of the availability set. + :type availability_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 VirtualMachineSizeListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineSizeListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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_available_sizes.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'availabilitySetName': self._serialize.url("availability_set_name", availability_set_name, 'str'), + '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('VirtualMachineSizeListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return 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_available_sizes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/vmSizes'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_dedicated_host_groups_operations.py new file mode 100644 index 000000000000..c48dbb60b127 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_dedicated_host_groups_operations.py @@ -0,0 +1,435 @@ +# 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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DedicatedHostGroupsOperations: + """DedicatedHostGroupsOperations 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_06_01.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( + self, + resource_group_name: str, + host_group_name: str, + parameters: "models.DedicatedHostGroup", + **kwargs + ) -> "models.DedicatedHostGroup": + """Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host + Groups please see [Dedicated Host Documentation] + (https://go.microsoft.com/fwlink/?linkid=2082596). + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param host_group_name: The name of the dedicated host group. + :type host_group_name: str + :param parameters: Parameters supplied to the Create Dedicated Host Group. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.DedicatedHostGroup + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DedicatedHostGroup, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.DedicatedHostGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + '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') + + # 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(parameters, 'DedicatedHostGroup') + 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, 201]: + 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('DedicatedHostGroup', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DedicatedHostGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + host_group_name: str, + parameters: "models.DedicatedHostGroupUpdate", + **kwargs + ) -> "models.DedicatedHostGroup": + """Update an dedicated host group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param host_group_name: The name of the dedicated host group. + :type host_group_name: str + :param parameters: Parameters supplied to the Update Dedicated Host Group operation. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.DedicatedHostGroupUpdate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DedicatedHostGroup, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.DedicatedHostGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + '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') + + # 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(parameters, 'DedicatedHostGroupUpdate') + 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DedicatedHostGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + host_group_name: str, + **kwargs + ) -> None: + """Delete a dedicated host group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param host_group_name: The name of the dedicated host group. + :type host_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-06-01" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + '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') + + # 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, 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + host_group_name: str, + expand: Optional[str] = "instanceView", + **kwargs + ) -> "models.DedicatedHostGroup": + """Retrieves information about a dedicated host group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param host_group_name: The name of the dedicated host group. + :type host_group_name: str + :param expand: The expand expression to apply on the operation. The response shows the list of + instance view of the dedicated hosts under the dedicated host group. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DedicatedHostGroup, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.DedicatedHostGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + '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] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + 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('DedicatedHostGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["models.DedicatedHostGroupListResult"]: + """Lists all of the dedicated host groups in the specified resource group. Use the nextLink + property in the response to get the next page of dedicated host groups. + + :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 DedicatedHostGroupListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.DedicatedHostGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + '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('DedicatedHostGroupListResult', 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/hostGroups'} # type: ignore + + def list_by_subscription( + self, + **kwargs + ) -> AsyncIterable["models.DedicatedHostGroupListResult"]: + """Lists all of the dedicated host groups in the subscription. Use the nextLink property in the + response to get the next page of dedicated host groups. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DedicatedHostGroupListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.DedicatedHostGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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_subscription.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('DedicatedHostGroupListResult', 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_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/hostGroups'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_dedicated_hosts_operations.py new file mode 100644 index 000000000000..bd1d309c92f0 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_dedicated_hosts_operations.py @@ -0,0 +1,544 @@ +# 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 + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DedicatedHostsOperations: + """DedicatedHostsOperations 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_06_01.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, + host_group_name: str, + host_name: str, + parameters: "models.DedicatedHost", + **kwargs + ) -> "models.DedicatedHost": + cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + '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') + + # 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(parameters, 'DedicatedHost') + 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, 201]: + 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('DedicatedHost', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DedicatedHost', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + host_group_name: str, + host_name: str, + parameters: "models.DedicatedHost", + **kwargs + ) -> AsyncLROPoller["models.DedicatedHost"]: + """Create or update a dedicated host . + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param host_group_name: The name of the dedicated host group. + :type host_group_name: str + :param host_name: The name of the dedicated host . + :type host_name: str + :param parameters: Parameters supplied to the Create Dedicated Host. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.DedicatedHost + :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 DedicatedHost or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_06_01.models.DedicatedHost] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + 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, + host_group_name=host_group_name, + host_name=host_name, + parameters=parameters, + 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('DedicatedHost', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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/hostGroups/{hostGroupName}/hosts/{hostName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + host_group_name: str, + host_name: str, + parameters: "models.DedicatedHostUpdate", + **kwargs + ) -> "models.DedicatedHost": + cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + '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') + + # 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(parameters, 'DedicatedHostUpdate') + 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DedicatedHost', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + host_group_name: str, + host_name: str, + parameters: "models.DedicatedHostUpdate", + **kwargs + ) -> AsyncLROPoller["models.DedicatedHost"]: + """Update an dedicated host . + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param host_group_name: The name of the dedicated host group. + :type host_group_name: str + :param host_name: The name of the dedicated host . + :type host_name: str + :param parameters: Parameters supplied to the Update Dedicated Host operation. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.DedicatedHostUpdate + :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 DedicatedHost or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_06_01.models.DedicatedHost] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + 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, + host_group_name=host_group_name, + host_name=host_name, + parameters=parameters, + 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('DedicatedHost', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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/hostGroups/{hostGroupName}/hosts/{hostName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + host_group_name: str, + host_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-06-01" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + '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') + + # 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/hostGroups/{hostGroupName}/hosts/{hostName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + host_group_name: str, + host_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Delete a dedicated host. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param host_group_name: The name of the dedicated host group. + :type host_group_name: str + :param host_name: The name of the dedicated host. + :type host_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, + host_group_name=host_group_name, + host_name=host_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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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/hostGroups/{hostGroupName}/hosts/{hostName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + host_group_name: str, + host_name: str, + expand: Optional[str] = "instanceView", + **kwargs + ) -> "models.DedicatedHost": + """Retrieves information about a dedicated host. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param host_group_name: The name of the dedicated host group. + :type host_group_name: str + :param host_name: The name of the dedicated host. + :type host_name: str + :param expand: The expand expression to apply on the operation. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DedicatedHost, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.DedicatedHost + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + '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] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + 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('DedicatedHost', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}'} # type: ignore + + def list_by_host_group( + self, + resource_group_name: str, + host_group_name: str, + **kwargs + ) -> AsyncIterable["models.DedicatedHostListResult"]: + """Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink + property in the response to get the next page of dedicated hosts. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param host_group_name: The name of the dedicated host group. + :type host_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 DedicatedHostListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.DedicatedHostListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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_host_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + '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('DedicatedHostListResult', 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_host_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_images_operations.py new file mode 100644 index 000000000000..ec64eb20c490 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_images_operations.py @@ -0,0 +1,588 @@ +# 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 + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ImagesOperations: + """ImagesOperations 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_06_01.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, + image_name: str, + parameters: "models.Image", + **kwargs + ) -> "models.Image": + cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + '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') + + # 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(parameters, 'Image') + 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, 201]: + 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('Image', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Image', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + image_name: str, + parameters: "models.Image", + **kwargs + ) -> AsyncLROPoller["models.Image"]: + """Create or update an image. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param image_name: The name of the image. + :type image_name: str + :param parameters: Parameters supplied to the Create Image operation. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.Image + :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 Image or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_06_01.models.Image] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + 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, + image_name=image_name, + parameters=parameters, + 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('Image', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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/images/{imageName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + image_name: str, + parameters: "models.ImageUpdate", + **kwargs + ) -> "models.Image": + cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + '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') + + # 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(parameters, 'ImageUpdate') + 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, 201]: + 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('Image', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Image', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + image_name: str, + parameters: "models.ImageUpdate", + **kwargs + ) -> AsyncLROPoller["models.Image"]: + """Update an image. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param image_name: The name of the image. + :type image_name: str + :param parameters: Parameters supplied to the Update Image operation. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.ImageUpdate + :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 Image or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_06_01.models.Image] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + 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, + image_name=image_name, + parameters=parameters, + 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('Image', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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/images/{imageName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + image_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-06-01" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + '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') + + # 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/images/{imageName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + image_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes an Image. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param image_name: The name of the image. + :type image_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, + image_name=image_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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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/images/{imageName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + image_name: str, + expand: Optional[str] = None, + **kwargs + ) -> "models.Image": + """Gets an image. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param image_name: The name of the image. + :type image_name: str + :param expand: The expand expression to apply on the operation. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Image, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.Image + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + '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] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + 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('Image', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["models.ImageListResult"]: + """Gets the list of images 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 ImageListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.ImageListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + '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('ImageListResult', 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/images'} # type: ignore + + def list( + self, + **kwargs + ) -> AsyncIterable["models.ImageListResult"]: + """Gets the list of Images in the subscription. Use nextLink property in the response to get the + next page of Images. Do this till nextLink is null to fetch all the Images. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ImageListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.ImageListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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('ImageListResult', 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/images'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_log_analytics_operations.py new file mode 100644 index 000000000000..dc01813d8e6d --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_log_analytics_operations.py @@ -0,0 +1,273 @@ +# 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, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +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 + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class LogAnalyticsOperations: + """LogAnalyticsOperations 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_06_01.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 _export_request_rate_by_interval_initial( + self, + location: str, + parameters: "models.RequestRateByIntervalInput", + **kwargs + ) -> Optional["models.LogAnalyticsOperationResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._export_request_rate_by_interval_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + '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') + + # 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(parameters, 'RequestRateByIntervalInput') + 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('LogAnalyticsOperationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _export_request_rate_by_interval_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getRequestRateByInterval'} # type: ignore + + async def begin_export_request_rate_by_interval( + self, + location: str, + parameters: "models.RequestRateByIntervalInput", + **kwargs + ) -> AsyncLROPoller["models.LogAnalyticsOperationResult"]: + """Export logs that show Api requests made by this subscription in the given time window to show + throttling activities. + + :param location: The location upon which virtual-machine-sizes is queried. + :type location: str + :param parameters: Parameters supplied to the LogAnalytics getRequestRateByInterval Api. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.RequestRateByIntervalInput + :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 LogAnalyticsOperationResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_06_01.models.LogAnalyticsOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] + 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._export_request_rate_by_interval_initial( + location=location, + parameters=parameters, + 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('LogAnalyticsOperationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_export_request_rate_by_interval.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getRequestRateByInterval'} # type: ignore + + async def _export_throttled_requests_initial( + self, + location: str, + parameters: "models.LogAnalyticsInputBase", + **kwargs + ) -> Optional["models.LogAnalyticsOperationResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._export_throttled_requests_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + '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') + + # 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(parameters, 'LogAnalyticsInputBase') + 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('LogAnalyticsOperationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _export_throttled_requests_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getThrottledRequests'} # type: ignore + + async def begin_export_throttled_requests( + self, + location: str, + parameters: "models.LogAnalyticsInputBase", + **kwargs + ) -> AsyncLROPoller["models.LogAnalyticsOperationResult"]: + """Export logs that show total throttled Api requests for this subscription in the given time + window. + + :param location: The location upon which virtual-machine-sizes is queried. + :type location: str + :param parameters: Parameters supplied to the LogAnalytics getThrottledRequests Api. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.LogAnalyticsInputBase + :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 LogAnalyticsOperationResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_06_01.models.LogAnalyticsOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] + 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._export_throttled_requests_initial( + location=location, + parameters=parameters, + 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('LogAnalyticsOperationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_export_throttled_requests.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getThrottledRequests'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_operations.py new file mode 100644 index 000000000000..06b729ce9567 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_operations.py @@ -0,0 +1,104 @@ +# 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 + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations 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_06_01.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 + + def list( + self, + **kwargs + ) -> AsyncIterable["models.ComputeOperationListResult"]: + """Gets a list of compute operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ComputeOperationListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.ComputeOperationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeOperationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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 + # 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('ComputeOperationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return 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': '/providers/Microsoft.Compute/operations'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_proximity_placement_groups_operations.py new file mode 100644 index 000000000000..99189268556d --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_proximity_placement_groups_operations.py @@ -0,0 +1,431 @@ +# 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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ProximityPlacementGroupsOperations: + """ProximityPlacementGroupsOperations 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_06_01.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( + self, + resource_group_name: str, + proximity_placement_group_name: str, + parameters: "models.ProximityPlacementGroup", + **kwargs + ) -> "models.ProximityPlacementGroup": + """Create or update a proximity placement group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param proximity_placement_group_name: The name of the proximity placement group. + :type proximity_placement_group_name: str + :param parameters: Parameters supplied to the Create Proximity Placement Group operation. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.ProximityPlacementGroup + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProximityPlacementGroup, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.ProximityPlacementGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'proximityPlacementGroupName': self._serialize.url("proximity_placement_group_name", proximity_placement_group_name, 'str'), + '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') + + # 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(parameters, 'ProximityPlacementGroup') + 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, 201]: + 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('ProximityPlacementGroup', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ProximityPlacementGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + proximity_placement_group_name: str, + parameters: "models.UpdateResource", + **kwargs + ) -> "models.ProximityPlacementGroup": + """Update a proximity placement group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param proximity_placement_group_name: The name of the proximity placement group. + :type proximity_placement_group_name: str + :param parameters: Parameters supplied to the Update Proximity Placement Group operation. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.UpdateResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProximityPlacementGroup, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.ProximityPlacementGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'proximityPlacementGroupName': self._serialize.url("proximity_placement_group_name", proximity_placement_group_name, 'str'), + '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') + + # 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(parameters, 'UpdateResource') + 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ProximityPlacementGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + proximity_placement_group_name: str, + **kwargs + ) -> None: + """Delete a proximity placement group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param proximity_placement_group_name: The name of the proximity placement group. + :type proximity_placement_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-06-01" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'proximityPlacementGroupName': self._serialize.url("proximity_placement_group_name", proximity_placement_group_name, 'str'), + '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') + + # 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]: + 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + proximity_placement_group_name: str, + include_colocation_status: Optional[str] = None, + **kwargs + ) -> "models.ProximityPlacementGroup": + """Retrieves information about a proximity placement group . + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param proximity_placement_group_name: The name of the proximity placement group. + :type proximity_placement_group_name: str + :param include_colocation_status: includeColocationStatus=true enables fetching the colocation + status of all the resources in the proximity placement group. + :type include_colocation_status: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProximityPlacementGroup, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.ProximityPlacementGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'proximityPlacementGroupName': self._serialize.url("proximity_placement_group_name", proximity_placement_group_name, 'str'), + '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] + if include_colocation_status is not None: + query_parameters['includeColocationStatus'] = self._serialize.query("include_colocation_status", include_colocation_status, 'str') + 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('ProximityPlacementGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}'} # type: ignore + + def list_by_subscription( + self, + **kwargs + ) -> AsyncIterable["models.ProximityPlacementGroupListResult"]: + """Lists all proximity placement groups in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProximityPlacementGroupListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.ProximityPlacementGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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_subscription.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('ProximityPlacementGroupListResult', 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_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/proximityPlacementGroups'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["models.ProximityPlacementGroupListResult"]: + """Lists all proximity placement groups in 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 ProximityPlacementGroupListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.ProximityPlacementGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + '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('ProximityPlacementGroupListResult', 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/proximityPlacementGroups'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_ssh_public_keys_operations.py new file mode 100644 index 000000000000..364ce8d32574 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_ssh_public_keys_operations.py @@ -0,0 +1,487 @@ +# 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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SshPublicKeysOperations: + """SshPublicKeysOperations 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_06_01.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 + + def list_by_subscription( + self, + **kwargs + ) -> AsyncIterable["models.SshPublicKeysGroupListResult"]: + """Lists all of the SSH public keys in the subscription. Use the nextLink property in the response + to get the next page of SSH public keys. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SshPublicKeysGroupListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.SshPublicKeysGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeysGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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_subscription.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('SshPublicKeysGroupListResult', 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_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/sshPublicKeys'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["models.SshPublicKeysGroupListResult"]: + """Lists all of the SSH public keys in the specified resource group. Use the nextLink property in + the response to get the next page of SSH public keys. + + :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 SshPublicKeysGroupListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.SshPublicKeysGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeysGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + '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('SshPublicKeysGroupListResult', 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/sshPublicKeys'} # type: ignore + + async def create( + self, + resource_group_name: str, + ssh_public_key_name: str, + parameters: "models.SshPublicKeyResource", + **kwargs + ) -> "models.SshPublicKeyResource": + """Creates a new SSH public key resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ssh_public_key_name: The name of the SSH public key. + :type ssh_public_key_name: str + :param parameters: Parameters supplied to create the SSH public key. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.SshPublicKeyResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SshPublicKeyResource, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.SshPublicKeyResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeyResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sshPublicKeyName': self._serialize.url("ssh_public_key_name", ssh_public_key_name, 'str'), + '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') + + # 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(parameters, 'SshPublicKeyResource') + 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, 201]: + 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('SshPublicKeyResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SshPublicKeyResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + ssh_public_key_name: str, + parameters: "models.SshPublicKeyUpdateResource", + **kwargs + ) -> "models.SshPublicKeyResource": + """Updates a new SSH public key resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ssh_public_key_name: The name of the SSH public key. + :type ssh_public_key_name: str + :param parameters: Parameters supplied to update the SSH public key. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.SshPublicKeyUpdateResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SshPublicKeyResource, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.SshPublicKeyResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeyResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sshPublicKeyName': self._serialize.url("ssh_public_key_name", ssh_public_key_name, 'str'), + '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') + + # 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(parameters, 'SshPublicKeyUpdateResource') + 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SshPublicKeyResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + ssh_public_key_name: str, + **kwargs + ) -> None: + """Delete an SSH public key. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ssh_public_key_name: The name of the SSH public key. + :type ssh_public_key_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-06-01" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sshPublicKeyName': self._serialize.url("ssh_public_key_name", ssh_public_key_name, 'str'), + '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') + + # 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, 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + ssh_public_key_name: str, + **kwargs + ) -> "models.SshPublicKeyResource": + """Retrieves information about an SSH public key. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ssh_public_key_name: The name of the SSH public key. + :type ssh_public_key_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SshPublicKeyResource, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.SshPublicKeyResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeyResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sshPublicKeyName': self._serialize.url("ssh_public_key_name", ssh_public_key_name, 'str'), + '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') + + # 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('SshPublicKeyResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}'} # type: ignore + + async def generate_key_pair( + self, + resource_group_name: str, + ssh_public_key_name: str, + **kwargs + ) -> "models.SshPublicKeyGenerateKeyPairResult": + """Generates and returns a public/private key pair and populates the SSH public key resource with + the public key. The length of the key will be 3072 bits. This operation can only be performed + once per SSH public key resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ssh_public_key_name: The name of the SSH public key. + :type ssh_public_key_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SshPublicKeyGenerateKeyPairResult, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.SshPublicKeyGenerateKeyPairResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeyGenerateKeyPairResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.generate_key_pair.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sshPublicKeyName': self._serialize.url("ssh_public_key_name", ssh_public_key_name, 'str'), + '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SshPublicKeyGenerateKeyPairResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + generate_key_pair.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}/generateKeyPair'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_usage_operations.py new file mode 100644 index 000000000000..f468d6482324 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_usage_operations.py @@ -0,0 +1,113 @@ +# 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 + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class UsageOperations: + """UsageOperations 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_06_01.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 + + def list( + self, + location: str, + **kwargs + ) -> AsyncIterable["models.ListUsagesResult"]: + """Gets, for the specified location, the current compute resource usage information as well as the + limits for compute resources under the subscription. + + :param location: The location for which resource usage is queried. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListUsagesResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.ListUsagesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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 = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + '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('ListUsagesResult', 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/locations/{location}/usages'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_extension_images_operations.py new file mode 100644 index 000000000000..93e06b6a292f --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -0,0 +1,242 @@ +# 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, Callable, Dict, Generic, List, Optional, TypeVar +import warnings + +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 + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VirtualMachineExtensionImagesOperations: + """VirtualMachineExtensionImagesOperations 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_06_01.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, + location: str, + publisher_name: str, + type: str, + version: str, + **kwargs + ) -> "models.VirtualMachineExtensionImage": + """Gets a virtual machine extension image. + + :param location: The name of a supported Azure region. + :type location: str + :param publisher_name: + :type publisher_name: str + :param type: + :type type: str + :param version: + :type version: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualMachineExtensionImage, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtensionImage + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), + 'type': self._serialize.url("type", type, 'str'), + 'version': self._serialize.url("version", version, 'str'), + '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') + + # 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('VirtualMachineExtensionImage', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}'} # type: ignore + + async def list_types( + self, + location: str, + publisher_name: str, + **kwargs + ) -> List["models.VirtualMachineExtensionImage"]: + """Gets a list of virtual machine extension image types. + + :param location: The name of a supported Azure region. + :type location: str + :param publisher_name: + :type publisher_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VirtualMachineExtensionImage, or the result of cls(response) + :rtype: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtensionImage] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_types.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), + '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') + + # 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('[VirtualMachineExtensionImage]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_types.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types'} # type: ignore + + async def list_versions( + self, + location: str, + publisher_name: str, + type: str, + filter: Optional[str] = None, + top: Optional[int] = None, + orderby: Optional[str] = None, + **kwargs + ) -> List["models.VirtualMachineExtensionImage"]: + """Gets a list of virtual machine extension image versions. + + :param location: The name of a supported Azure region. + :type location: str + :param publisher_name: + :type publisher_name: str + :param type: + :type type: str + :param filter: The filter to apply on the operation. + :type filter: str + :param top: + :type top: int + :param orderby: + :type orderby: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VirtualMachineExtensionImage, or the result of cls(response) + :rtype: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtensionImage] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_versions.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), + 'type': self._serialize.url("type", type, 'str'), + '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] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + 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('[VirtualMachineExtensionImage]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_versions.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_extensions_operations.py new file mode 100644 index 000000000000..8c92337d23c8 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_extensions_operations.py @@ -0,0 +1,534 @@ +# 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, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +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 + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VirtualMachineExtensionsOperations: + """VirtualMachineExtensionsOperations 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_06_01.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, + vm_name: str, + vm_extension_name: str, + extension_parameters: "models.VirtualMachineExtension", + **kwargs + ) -> "models.VirtualMachineExtension": + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + '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') + + # 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(extension_parameters, 'VirtualMachineExtension') + 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, 201]: + 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('VirtualMachineExtension', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualMachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + vm_name: str, + vm_extension_name: str, + extension_parameters: "models.VirtualMachineExtension", + **kwargs + ) -> AsyncLROPoller["models.VirtualMachineExtension"]: + """The operation to create or update the extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine where the extension should be created or + updated. + :type vm_name: str + :param vm_extension_name: The name of the virtual machine extension. + :type vm_extension_name: str + :param extension_parameters: Parameters supplied to the Create Virtual Machine Extension + operation. + :type extension_parameters: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtension + :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 VirtualMachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + 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, + vm_name=vm_name, + vm_extension_name=vm_extension_name, + extension_parameters=extension_parameters, + 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('VirtualMachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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/virtualMachines/{vmName}/extensions/{vmExtensionName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + vm_name: str, + vm_extension_name: str, + extension_parameters: "models.VirtualMachineExtensionUpdate", + **kwargs + ) -> "models.VirtualMachineExtension": + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + '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') + + # 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(extension_parameters, 'VirtualMachineExtensionUpdate') + 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualMachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + vm_name: str, + vm_extension_name: str, + extension_parameters: "models.VirtualMachineExtensionUpdate", + **kwargs + ) -> AsyncLROPoller["models.VirtualMachineExtension"]: + """The operation to update the extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine where the extension should be updated. + :type vm_name: str + :param vm_extension_name: The name of the virtual machine extension. + :type vm_extension_name: str + :param extension_parameters: Parameters supplied to the Update Virtual Machine Extension + operation. + :type extension_parameters: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtensionUpdate + :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 VirtualMachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + 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, + vm_name=vm_name, + vm_extension_name=vm_extension_name, + extension_parameters=extension_parameters, + 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('VirtualMachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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/virtualMachines/{vmName}/extensions/{vmExtensionName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + vm_name: str, + vm_extension_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-06-01" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + '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') + + # 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/virtualMachines/{vmName}/extensions/{vmExtensionName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + vm_name: str, + vm_extension_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """The operation to delete the extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine where the extension should be deleted. + :type vm_name: str + :param vm_extension_name: The name of the virtual machine extension. + :type vm_extension_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, + vm_name=vm_name, + vm_extension_name=vm_extension_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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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/virtualMachines/{vmName}/extensions/{vmExtensionName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + vm_name: str, + vm_extension_name: str, + expand: Optional[str] = None, + **kwargs + ) -> "models.VirtualMachineExtension": + """The operation to get the extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine containing the extension. + :type vm_name: str + :param vm_extension_name: The name of the virtual machine extension. + :type vm_extension_name: str + :param expand: The expand expression to apply on the operation. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualMachineExtension, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtension + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + '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] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + 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('VirtualMachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}'} # type: ignore + + async def list( + self, + resource_group_name: str, + vm_name: str, + expand: Optional[str] = None, + **kwargs + ) -> "models.VirtualMachineExtensionsListResult": + """The operation to get all extensions of a Virtual Machine. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine containing the extension. + :type vm_name: str + :param expand: The expand expression to apply on the operation. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualMachineExtensionsListResult, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtensionsListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + 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('VirtualMachineExtensionsListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_images_operations.py new file mode 100644 index 000000000000..3f040b69572b --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_images_operations.py @@ -0,0 +1,367 @@ +# 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, Callable, Dict, Generic, List, Optional, TypeVar +import warnings + +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 + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VirtualMachineImagesOperations: + """VirtualMachineImagesOperations 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_06_01.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, + location: str, + publisher_name: str, + offer: str, + skus: str, + version: str, + **kwargs + ) -> "models.VirtualMachineImage": + """Gets a virtual machine image. + + :param location: The name of a supported Azure region. + :type location: str + :param publisher_name: A valid image publisher. + :type publisher_name: str + :param offer: A valid image publisher offer. + :type offer: str + :param skus: A valid image SKU. + :type skus: str + :param version: A valid image SKU version. + :type version: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualMachineImage, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineImage + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), + 'offer': self._serialize.url("offer", offer, 'str'), + 'skus': self._serialize.url("skus", skus, 'str'), + 'version': self._serialize.url("version", version, 'str'), + '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') + + # 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('VirtualMachineImage', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}'} # type: ignore + + async def list( + self, + location: str, + publisher_name: str, + offer: str, + skus: str, + expand: Optional[str] = None, + top: Optional[int] = None, + orderby: Optional[str] = None, + **kwargs + ) -> List["models.VirtualMachineImageResource"]: + """Gets a list of all virtual machine image versions for the specified location, publisher, offer, + and SKU. + + :param location: The name of a supported Azure region. + :type location: str + :param publisher_name: A valid image publisher. + :type publisher_name: str + :param offer: A valid image publisher offer. + :type offer: str + :param skus: A valid image SKU. + :type skus: str + :param expand: The expand expression to apply on the operation. + :type expand: str + :param top: + :type top: int + :param orderby: + :type orderby: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VirtualMachineImageResource, or the result of cls(response) + :rtype: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineImageResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), + 'offer': self._serialize.url("offer", offer, 'str'), + 'skus': self._serialize.url("skus", skus, 'str'), + '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] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + 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('[VirtualMachineImageResource]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions'} # type: ignore + + async def list_offers( + self, + location: str, + publisher_name: str, + **kwargs + ) -> List["models.VirtualMachineImageResource"]: + """Gets a list of virtual machine image offers for the specified location and publisher. + + :param location: The name of a supported Azure region. + :type location: str + :param publisher_name: A valid image publisher. + :type publisher_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VirtualMachineImageResource, or the result of cls(response) + :rtype: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineImageResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_offers.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), + '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') + + # 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('[VirtualMachineImageResource]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_offers.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers'} # type: ignore + + async def list_publishers( + self, + location: str, + **kwargs + ) -> List["models.VirtualMachineImageResource"]: + """Gets a list of virtual machine image publishers for the specified Azure location. + + :param location: The name of a supported Azure region. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VirtualMachineImageResource, or the result of cls(response) + :rtype: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineImageResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_publishers.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + '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') + + # 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('[VirtualMachineImageResource]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_publishers.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers'} # type: ignore + + async def list_skus( + self, + location: str, + publisher_name: str, + offer: str, + **kwargs + ) -> List["models.VirtualMachineImageResource"]: + """Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. + + :param location: The name of a supported Azure region. + :type location: str + :param publisher_name: A valid image publisher. + :type publisher_name: str + :param offer: A valid image publisher offer. + :type offer: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VirtualMachineImageResource, or the result of cls(response) + :rtype: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineImageResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_skus.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), + 'offer': self._serialize.url("offer", offer, 'str'), + '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') + + # 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('[VirtualMachineImageResource]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_run_commands_operations.py new file mode 100644 index 000000000000..241fb7b4594f --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -0,0 +1,170 @@ +# 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 + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VirtualMachineRunCommandsOperations: + """VirtualMachineRunCommandsOperations 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_06_01.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 + + def list( + self, + location: str, + **kwargs + ) -> AsyncIterable["models.RunCommandListResult"]: + """Lists all available run commands for a subscription in a location. + + :param location: The location upon which run commands is queried. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RunCommandListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.RunCommandListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json, text/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 = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + '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('RunCommandListResult', 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/locations/{location}/runCommands'} # type: ignore + + async def get( + self, + location: str, + command_id: str, + **kwargs + ) -> "models.RunCommandDocument": + """Gets specific run command for a subscription in a location. + + :param location: The location upon which run commands is queried. + :type location: str + :param command_id: The command id. + :type command_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RunCommandDocument, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.RunCommandDocument + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandDocument"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json, text/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'commandId': self._serialize.url("command_id", command_id, 'str'), + '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') + + # 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('RunCommandDocument', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands/{commandId}'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py new file mode 100644 index 000000000000..f37cedac99f6 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -0,0 +1,550 @@ +# 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 + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VirtualMachineScaleSetExtensionsOperations: + """VirtualMachineScaleSetExtensionsOperations 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_06_01.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, + vm_scale_set_name: str, + vmss_extension_name: str, + extension_parameters: "models.VirtualMachineScaleSetExtension", + **kwargs + ) -> "models.VirtualMachineScaleSetExtension": + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + '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') + + # 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(extension_parameters, 'VirtualMachineScaleSetExtension') + 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, 201]: + 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('VirtualMachineScaleSetExtension', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualMachineScaleSetExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + vm_scale_set_name: str, + vmss_extension_name: str, + extension_parameters: "models.VirtualMachineScaleSetExtension", + **kwargs + ) -> AsyncLROPoller["models.VirtualMachineScaleSetExtension"]: + """The operation to create or update an extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set where the extension should be create or + updated. + :type vm_scale_set_name: str + :param vmss_extension_name: The name of the VM scale set extension. + :type vmss_extension_name: str + :param extension_parameters: Parameters supplied to the Create VM scale set Extension + operation. + :type extension_parameters: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetExtension + :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 VirtualMachineScaleSetExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetExtension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + 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, + vm_scale_set_name=vm_scale_set_name, + vmss_extension_name=vmss_extension_name, + extension_parameters=extension_parameters, + 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('VirtualMachineScaleSetExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + vm_scale_set_name: str, + vmss_extension_name: str, + extension_parameters: "models.VirtualMachineScaleSetExtensionUpdate", + **kwargs + ) -> "models.VirtualMachineScaleSetExtension": + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + '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') + + # 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(extension_parameters, 'VirtualMachineScaleSetExtensionUpdate') + 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, 201]: + 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('VirtualMachineScaleSetExtension', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualMachineScaleSetExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + vm_scale_set_name: str, + vmss_extension_name: str, + extension_parameters: "models.VirtualMachineScaleSetExtensionUpdate", + **kwargs + ) -> AsyncLROPoller["models.VirtualMachineScaleSetExtension"]: + """The operation to update an extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set where the extension should be updated. + :type vm_scale_set_name: str + :param vmss_extension_name: The name of the VM scale set extension. + :type vmss_extension_name: str + :param extension_parameters: Parameters supplied to the Update VM scale set Extension + operation. + :type extension_parameters: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetExtensionUpdate + :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 VirtualMachineScaleSetExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetExtension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + 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, + vm_scale_set_name=vm_scale_set_name, + vmss_extension_name=vmss_extension_name, + extension_parameters=extension_parameters, + 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('VirtualMachineScaleSetExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + vm_scale_set_name: str, + vmss_extension_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-06-01" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + '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') + + # 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/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + vm_scale_set_name: str, + vmss_extension_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """The operation to delete the extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set where the extension should be deleted. + :type vm_scale_set_name: str + :param vmss_extension_name: The name of the VM scale set extension. + :type vmss_extension_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, + vm_scale_set_name=vm_scale_set_name, + vmss_extension_name=vmss_extension_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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + vm_scale_set_name: str, + vmss_extension_name: str, + expand: Optional[str] = None, + **kwargs + ) -> "models.VirtualMachineScaleSetExtension": + """The operation to get the extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set containing the extension. + :type vm_scale_set_name: str + :param vmss_extension_name: The name of the VM scale set extension. + :type vmss_extension_name: str + :param expand: The expand expression to apply on the operation. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualMachineScaleSetExtension, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetExtension + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + '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] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + 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('VirtualMachineScaleSetExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}'} # type: ignore + + def list( + self, + resource_group_name: str, + vm_scale_set_name: str, + **kwargs + ) -> AsyncIterable["models.VirtualMachineScaleSetExtensionListResult"]: + """Gets a list of all extensions in a VM scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set containing the extension. + :type vm_scale_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 VirtualMachineScaleSetExtensionListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetExtensionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtensionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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('VirtualMachineScaleSetExtensionListResult', 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py new file mode 100644 index 000000000000..d69cfe207219 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -0,0 +1,405 @@ +# 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, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +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 + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VirtualMachineScaleSetRollingUpgradesOperations: + """VirtualMachineScaleSetRollingUpgradesOperations 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_06_01.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 _cancel_initial( + self, + resource_group_name: str, + vm_scale_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-06-01" + + # Construct URL + url = self._cancel_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # 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, {}) + + _cancel_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/cancel'} # type: ignore + + async def begin_cancel( + self, + resource_group_name: str, + vm_scale_set_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Cancels the current virtual machine scale set rolling upgrade. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_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._cancel_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/cancel'} # type: ignore + + async def _start_os_upgrade_initial( + self, + resource_group_name: str, + vm_scale_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-06-01" + + # Construct URL + url = self._start_os_upgrade_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # 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, {}) + + _start_os_upgrade_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osRollingUpgrade'} # type: ignore + + async def begin_start_os_upgrade( + self, + resource_group_name: str, + vm_scale_set_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Starts a rolling upgrade to move all virtual machine scale set instances to the latest + available Platform Image OS version. Instances which are already running the latest available + OS version are not affected. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_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._start_os_upgrade_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_start_os_upgrade.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osRollingUpgrade'} # type: ignore + + async def _start_extension_upgrade_initial( + self, + resource_group_name: str, + vm_scale_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-06-01" + + # Construct URL + url = self._start_extension_upgrade_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # 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, {}) + + _start_extension_upgrade_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensionRollingUpgrade'} # type: ignore + + async def begin_start_extension_upgrade( + self, + resource_group_name: str, + vm_scale_set_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to + the latest available extension version. Instances which are already running the latest + extension versions are not affected. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_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._start_extension_upgrade_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_start_extension_upgrade.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensionRollingUpgrade'} # type: ignore + + async def get_latest( + self, + resource_group_name: str, + vm_scale_set_name: str, + **kwargs + ) -> "models.RollingUpgradeStatusInfo": + """Gets the status of the latest virtual machine scale set rolling upgrade. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RollingUpgradeStatusInfo, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.RollingUpgradeStatusInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RollingUpgradeStatusInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_latest.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # 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('RollingUpgradeStatusInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_latest.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/latest'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py new file mode 100644 index 000000000000..5492e715e7ea --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -0,0 +1,561 @@ +# 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, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +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 + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VirtualMachineScaleSetVMExtensionsOperations: + """VirtualMachineScaleSetVMExtensionsOperations 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_06_01.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, + vm_scale_set_name: str, + instance_id: str, + vm_extension_name: str, + extension_parameters: "models.VirtualMachineExtension", + **kwargs + ) -> "models.VirtualMachineExtension": + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + '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') + + # 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(extension_parameters, 'VirtualMachineExtension') + 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, 201]: + 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('VirtualMachineExtension', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualMachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + vm_extension_name: str, + extension_parameters: "models.VirtualMachineExtension", + **kwargs + ) -> AsyncLROPoller["models.VirtualMachineExtension"]: + """The operation to create or update the VMSS VM extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: str + :param vm_extension_name: The name of the virtual machine extension. + :type vm_extension_name: str + :param extension_parameters: Parameters supplied to the Create Virtual Machine Extension + operation. + :type extension_parameters: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtension + :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 VirtualMachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + 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, + vm_scale_set_name=vm_scale_set_name, + instance_id=instance_id, + vm_extension_name=vm_extension_name, + extension_parameters=extension_parameters, + 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('VirtualMachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + vm_extension_name: str, + extension_parameters: "models.VirtualMachineExtensionUpdate", + **kwargs + ) -> "models.VirtualMachineExtension": + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + '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') + + # 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(extension_parameters, 'VirtualMachineExtensionUpdate') + 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualMachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + vm_extension_name: str, + extension_parameters: "models.VirtualMachineExtensionUpdate", + **kwargs + ) -> AsyncLROPoller["models.VirtualMachineExtension"]: + """The operation to update the VMSS VM extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: str + :param vm_extension_name: The name of the virtual machine extension. + :type vm_extension_name: str + :param extension_parameters: Parameters supplied to the Update Virtual Machine Extension + operation. + :type extension_parameters: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtensionUpdate + :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 VirtualMachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + 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, + vm_scale_set_name=vm_scale_set_name, + instance_id=instance_id, + vm_extension_name=vm_extension_name, + extension_parameters=extension_parameters, + 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('VirtualMachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + vm_extension_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-06-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + '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') + + # 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/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + vm_extension_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """The operation to delete the VMSS VM extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: str + :param vm_extension_name: The name of the virtual machine extension. + :type vm_extension_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, + vm_scale_set_name=vm_scale_set_name, + instance_id=instance_id, + vm_extension_name=vm_extension_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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + vm_extension_name: str, + expand: Optional[str] = None, + **kwargs + ) -> "models.VirtualMachineExtension": + """The operation to get the VMSS VM extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: str + :param vm_extension_name: The name of the virtual machine extension. + :type vm_extension_name: str + :param expand: The expand expression to apply on the operation. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualMachineExtension, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtension + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + '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] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + 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('VirtualMachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}'} # type: ignore + + async def list( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + expand: Optional[str] = None, + **kwargs + ) -> "models.VirtualMachineExtensionsListResult": + """The operation to get all extensions of an instance in Virtual Machine Scaleset. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: str + :param expand: The expand expression to apply on the operation. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualMachineExtensionsListResult, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtensionsListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + '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] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + 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('VirtualMachineExtensionsListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vms_operations.py new file mode 100644 index 000000000000..1f507ea53e09 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -0,0 +1,1629 @@ +# 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 + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VirtualMachineScaleSetVMsOperations: + """VirtualMachineScaleSetVMsOperations 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_06_01.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 _reimage_initial( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + vm_scale_set_vm_reimage_input: Optional["models.VirtualMachineReimageParameters"] = None, + **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-06-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._reimage_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if vm_scale_set_vm_reimage_input is not None: + body_content = self._serialize.body(vm_scale_set_vm_reimage_input, 'VirtualMachineReimageParameters') + else: + body_content = None + 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) + + if cls: + return cls(pipeline_response, None, {}) + + _reimage_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimage'} # type: ignore + + async def begin_reimage( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + vm_scale_set_vm_reimage_input: Optional["models.VirtualMachineReimageParameters"] = None, + **kwargs + ) -> AsyncLROPoller[None]: + """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: str + :param vm_scale_set_vm_reimage_input: Parameters for the Reimaging Virtual machine in ScaleSet. + :type vm_scale_set_vm_reimage_input: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineReimageParameters + :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._reimage_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + instance_id=instance_id, + vm_scale_set_vm_reimage_input=vm_scale_set_vm_reimage_input, + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_reimage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimage'} # type: ignore + + async def _reimage_all_initial( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: 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-06-01" + + # Construct URL + url = self._reimage_all_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + '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') + + # 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, {}) + + _reimage_all_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimageall'} # type: ignore + + async def begin_reimage_all( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. + This operation is only supported for managed disks. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: 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._reimage_all_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + instance_id=instance_id, + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_reimage_all.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimageall'} # type: ignore + + async def _deallocate_initial( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: 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-06-01" + + # Construct URL + url = self._deallocate_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + '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') + + # 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, {}) + + _deallocate_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate'} # type: ignore + + async def begin_deallocate( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and + releases the compute resources it uses. You are not billed for the compute resources of this + virtual machine once it is deallocated. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: 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._deallocate_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + instance_id=instance_id, + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_deallocate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + parameters: "models.VirtualMachineScaleSetVM", + **kwargs + ) -> "models.VirtualMachineScaleSetVM": + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + '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') + + # 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(parameters, 'VirtualMachineScaleSetVM') + 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('VirtualMachineScaleSetVM', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('VirtualMachineScaleSetVM', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + parameters: "models.VirtualMachineScaleSetVM", + **kwargs + ) -> AsyncLROPoller["models.VirtualMachineScaleSetVM"]: + """Updates a virtual machine of a VM scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set where the extension should be create or + updated. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: str + :param parameters: Parameters supplied to the Update Virtual Machine Scale Sets VM operation. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVM + :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 VirtualMachineScaleSetVM or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVM] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + 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, + vm_scale_set_name=vm_scale_set_name, + instance_id=instance_id, + parameters=parameters, + 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('VirtualMachineScaleSetVM', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: 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-06-01" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + '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') + + # 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/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a virtual machine from a VM scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: 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, + vm_scale_set_name=vm_scale_set_name, + instance_id=instance_id, + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'} # type: ignore + + async def get( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + expand: Optional[str] = "instanceView", + **kwargs + ) -> "models.VirtualMachineScaleSetVM": + """Gets a virtual machine from a VM scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: str + :param expand: The expand expression to apply on the operation. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualMachineScaleSetVM, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVM + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + '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] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + 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('VirtualMachineScaleSetVM', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'} # type: ignore + + async def get_instance_view( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + **kwargs + ) -> "models.VirtualMachineScaleSetVMInstanceView": + """Gets the status of a virtual machine from a VM scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualMachineScaleSetVMInstanceView, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMInstanceView + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_view.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + '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') + + # 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('VirtualMachineScaleSetVMInstanceView', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_view.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/instanceView'} # type: ignore + + def list( + self, + resource_group_name: str, + virtual_machine_scale_set_name: str, + filter: Optional[str] = None, + select: Optional[str] = None, + expand: Optional[str] = None, + **kwargs + ) -> AsyncIterable["models.VirtualMachineScaleSetVMListResult"]: + """Gets a list of all virtual machines in a VM scale sets. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the VM scale set. + :type virtual_machine_scale_set_name: str + :param filter: The filter to apply to the operation. Allowed values are + 'startswith(instanceView/statuses/code, 'PowerState') eq true', 'properties/latestModelApplied + eq true', 'properties/latestModelApplied eq false'. + :type filter: str + :param select: The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. + :type select: str + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualMachineScaleSetVMListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), + '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] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if select is not None: + query_parameters['$select'] = self._serialize.query("select", select, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + 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('VirtualMachineScaleSetVMListResult', 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines'} # type: ignore + + async def _power_off_initial( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + skip_shutdown: Optional[bool] = False, + **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-06-01" + + # Construct URL + url = self._power_off_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + '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] + if skip_shutdown is not None: + query_parameters['skipShutdown'] = self._serialize.query("skip_shutdown", skip_shutdown, 'bool') + 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, {}) + + _power_off_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff'} # type: ignore + + async def begin_power_off( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + skip_shutdown: Optional[bool] = False, + **kwargs + ) -> AsyncLROPoller[None]: + """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached + and you are getting charged for the resources. Instead, use deallocate to release resources and + avoid charges. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: str + :param skip_shutdown: The parameter to request non-graceful VM shutdown. True value for this + flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this + flag is false if not specified. + :type skip_shutdown: 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. + :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._power_off_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + instance_id=instance_id, + skip_shutdown=skip_shutdown, + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_power_off.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff'} # type: ignore + + async def _restart_initial( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: 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-06-01" + + # Construct URL + url = self._restart_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + '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') + + # 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, {}) + + _restart_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart'} # type: ignore + + async def begin_restart( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Restarts a virtual machine in a VM scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: 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._restart_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + instance_id=instance_id, + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart'} # type: ignore + + async def _start_initial( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: 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-06-01" + + # Construct URL + url = self._start_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + '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') + + # 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, {}) + + _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start'} # type: ignore + + async def begin_start( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Starts a virtual machine in a VM scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: 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._start_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + instance_id=instance_id, + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start'} # type: ignore + + async def _redeploy_initial( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: 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-06-01" + + # Construct URL + url = self._redeploy_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + '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') + + # 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, {}) + + _redeploy_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/redeploy'} # type: ignore + + async def begin_redeploy( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and + powers it back on. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: 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._redeploy_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + instance_id=instance_id, + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_redeploy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/redeploy'} # type: ignore + + async def retrieve_boot_diagnostics_data( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + sas_uri_expiration_time_in_minutes: Optional[int] = None, + **kwargs + ) -> "models.RetrieveBootDiagnosticsDataResult": + """The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale + set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: str + :param sas_uri_expiration_time_in_minutes: Expiration duration in minutes for the SAS URIs with + a value between 1 to 1440 minutes. :code:`
`:code:`
`NOTE: If not specified, SAS URIs + will be generated with a default expiration duration of 120 minutes. + :type sas_uri_expiration_time_in_minutes: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RetrieveBootDiagnosticsDataResult, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.RetrieveBootDiagnosticsDataResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RetrieveBootDiagnosticsDataResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.retrieve_boot_diagnostics_data.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + '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] + if sas_uri_expiration_time_in_minutes is not None: + query_parameters['sasUriExpirationTimeInMinutes'] = self._serialize.query("sas_uri_expiration_time_in_minutes", sas_uri_expiration_time_in_minutes, 'int') + 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.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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RetrieveBootDiagnosticsDataResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + retrieve_boot_diagnostics_data.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/retrieveBootDiagnosticsData'} # type: ignore + + async def _perform_maintenance_initial( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: 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-06-01" + + # Construct URL + url = self._perform_maintenance_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + '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') + + # 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, {}) + + _perform_maintenance_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/performMaintenance'} # type: ignore + + async def begin_perform_maintenance( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Performs maintenance on a virtual machine in a VM scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: 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._perform_maintenance_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + instance_id=instance_id, + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_perform_maintenance.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/performMaintenance'} # type: ignore + + async def simulate_eviction( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + **kwargs + ) -> None: + """The operation to simulate the eviction of spot virtual machine in a VM scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-06-01" + + # Construct URL + url = self.simulate_eviction.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + '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') + + # 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 [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, {}) + + simulate_eviction.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/simulateEviction'} # type: ignore + + async def _run_command_initial( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + parameters: "models.RunCommandInput", + **kwargs + ) -> Optional["models.RunCommandResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" + + # Construct URL + url = self._run_command_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + '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') + + # 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(parameters, 'RunCommandInput') + 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('RunCommandResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _run_command_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/runCommand'} # type: ignore + + async def begin_run_command( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + parameters: "models.RunCommandInput", + **kwargs + ) -> AsyncLROPoller["models.RunCommandResult"]: + """Run command on a virtual machine in a VM scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: str + :param parameters: Parameters supplied to the Run command operation. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.RunCommandInput + :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 RunCommandResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_06_01.models.RunCommandResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] + 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._run_command_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + instance_id=instance_id, + parameters=parameters, + 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('RunCommandResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_run_command.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/runCommand'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_sets_operations.py new file mode 100644 index 000000000000..9dd0892a6f1a --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -0,0 +1,2166 @@ +# 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 + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VirtualMachineScaleSetsOperations: + """VirtualMachineScaleSetsOperations 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_06_01.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, + vm_scale_set_name: str, + parameters: "models.VirtualMachineScaleSet", + **kwargs + ) -> "models.VirtualMachineScaleSet": + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # 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(parameters, 'VirtualMachineScaleSet') + 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, 201]: + 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('VirtualMachineScaleSet', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualMachineScaleSet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + vm_scale_set_name: str, + parameters: "models.VirtualMachineScaleSet", + **kwargs + ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: + """Create or update a VM scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set to create or update. + :type vm_scale_set_name: str + :param parameters: The scale set object. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSet + :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 VirtualMachineScaleSet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + 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, + vm_scale_set_name=vm_scale_set_name, + parameters=parameters, + 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('VirtualMachineScaleSet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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/virtualMachineScaleSets/{vmScaleSetName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + vm_scale_set_name: str, + parameters: "models.VirtualMachineScaleSetUpdate", + **kwargs + ) -> "models.VirtualMachineScaleSet": + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # 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(parameters, 'VirtualMachineScaleSetUpdate') + 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualMachineScaleSet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + vm_scale_set_name: str, + parameters: "models.VirtualMachineScaleSetUpdate", + **kwargs + ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: + """Update a VM scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set to create or update. + :type vm_scale_set_name: str + :param parameters: The scale set object. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetUpdate + :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 VirtualMachineScaleSet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + 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, + vm_scale_set_name=vm_scale_set_name, + parameters=parameters, + 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('VirtualMachineScaleSet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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/virtualMachineScaleSets/{vmScaleSetName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + vm_scale_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-06-01" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # 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/virtualMachineScaleSets/{vmScaleSetName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + vm_scale_set_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a VM scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_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, + vm_scale_set_name=vm_scale_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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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/virtualMachineScaleSets/{vmScaleSetName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + vm_scale_set_name: str, + **kwargs + ) -> "models.VirtualMachineScaleSet": + """Display information about a virtual machine scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualMachineScaleSet, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSet + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # 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('VirtualMachineScaleSet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'} # type: ignore + + async def _deallocate_initial( + self, + resource_group_name: str, + vm_scale_set_name: str, + vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + **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-06-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._deallocate_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if vm_instance_i_ds is not None: + body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') + else: + body_content = None + 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) + + if cls: + return cls(pipeline_response, None, {}) + + _deallocate_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate'} # type: ignore + + async def begin_deallocate( + self, + resource_group_name: str, + vm_scale_set_name: str, + vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + **kwargs + ) -> AsyncLROPoller[None]: + """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and + releases the compute resources. You are not billed for the compute resources that this virtual + machine scale set deallocates. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param vm_instance_i_ds: A list of virtual machine instance IDs from the VM scale set. + :type vm_instance_i_ds: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMInstanceIDs + :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._deallocate_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + vm_instance_i_ds=vm_instance_i_ds, + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_deallocate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate'} # type: ignore + + async def _delete_instances_initial( + self, + resource_group_name: str, + vm_scale_set_name: str, + vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + **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-06-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._delete_instances_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') + 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) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_instances_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete'} # type: ignore + + async def begin_delete_instances( + self, + resource_group_name: str, + vm_scale_set_name: str, + vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes virtual machines in a VM scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param vm_instance_i_ds: A list of virtual machine instance IDs from the VM scale set. + :type vm_instance_i_ds: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMInstanceRequiredIDs + :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_instances_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + vm_instance_i_ds=vm_instance_i_ds, + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_instances.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete'} # type: ignore + + async def get_instance_view( + self, + resource_group_name: str, + vm_scale_set_name: str, + **kwargs + ) -> "models.VirtualMachineScaleSetInstanceView": + """Gets the status of a VM scale set instance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualMachineScaleSetInstanceView, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetInstanceView + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_view.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # 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('VirtualMachineScaleSetInstanceView', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_view.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/instanceView'} # type: ignore + + def list( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["models.VirtualMachineScaleSetListResult"]: + """Gets a list of all VM scale 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 VirtualMachineScaleSetListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + '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('VirtualMachineScaleSetListResult', 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets'} # type: ignore + + def list_all( + self, + **kwargs + ) -> AsyncIterable["models.VirtualMachineScaleSetListWithLinkResult"]: + """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource + group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this + till nextLink is null to fetch all the VM Scale Sets. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualMachineScaleSetListWithLinkResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetListWithLinkResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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_all.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('VirtualMachineScaleSetListWithLinkResult', 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_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets'} # type: ignore + + def list_skus( + self, + resource_group_name: str, + vm_scale_set_name: str, + **kwargs + ) -> AsyncIterable["models.VirtualMachineScaleSetListSkusResult"]: + """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM + instances allowed for each SKU. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_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 VirtualMachineScaleSetListSkusResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetListSkusResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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_skus.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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('VirtualMachineScaleSetListSkusResult', 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_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/skus'} # type: ignore + + def get_os_upgrade_history( + self, + resource_group_name: str, + vm_scale_set_name: str, + **kwargs + ) -> AsyncIterable["models.VirtualMachineScaleSetListOSUpgradeHistory"]: + """Gets list of OS upgrades on a VM scale set instance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_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 VirtualMachineScaleSetListOSUpgradeHistory or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetListOSUpgradeHistory] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListOSUpgradeHistory"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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.get_os_upgrade_history.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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('VirtualMachineScaleSetListOSUpgradeHistory', 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 + ) + get_os_upgrade_history.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osUpgradeHistory'} # type: ignore + + async def _power_off_initial( + self, + resource_group_name: str, + vm_scale_set_name: str, + skip_shutdown: Optional[bool] = False, + vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + **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-06-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._power_off_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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] + if skip_shutdown is not None: + query_parameters['skipShutdown'] = self._serialize.query("skip_shutdown", skip_shutdown, 'bool') + 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') + + body_content_kwargs = {} # type: Dict[str, Any] + if vm_instance_i_ds is not None: + body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') + else: + body_content = None + 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) + + if cls: + return cls(pipeline_response, None, {}) + + _power_off_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff'} # type: ignore + + async def begin_power_off( + self, + resource_group_name: str, + vm_scale_set_name: str, + skip_shutdown: Optional[bool] = False, + vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + **kwargs + ) -> AsyncLROPoller[None]: + """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still + attached and you are getting charged for the resources. Instead, use deallocate to release + resources and avoid charges. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param skip_shutdown: The parameter to request non-graceful VM shutdown. True value for this + flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this + flag is false if not specified. + :type skip_shutdown: bool + :param vm_instance_i_ds: A list of virtual machine instance IDs from the VM scale set. + :type vm_instance_i_ds: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMInstanceIDs + :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._power_off_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + skip_shutdown=skip_shutdown, + vm_instance_i_ds=vm_instance_i_ds, + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_power_off.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff'} # type: ignore + + async def _restart_initial( + self, + resource_group_name: str, + vm_scale_set_name: str, + vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + **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-06-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._restart_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if vm_instance_i_ds is not None: + body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') + else: + body_content = None + 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) + + if cls: + return cls(pipeline_response, None, {}) + + _restart_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart'} # type: ignore + + async def begin_restart( + self, + resource_group_name: str, + vm_scale_set_name: str, + vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + **kwargs + ) -> AsyncLROPoller[None]: + """Restarts one or more virtual machines in a VM scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param vm_instance_i_ds: A list of virtual machine instance IDs from the VM scale set. + :type vm_instance_i_ds: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMInstanceIDs + :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._restart_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + vm_instance_i_ds=vm_instance_i_ds, + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart'} # type: ignore + + async def _start_initial( + self, + resource_group_name: str, + vm_scale_set_name: str, + vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + **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-06-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._start_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if vm_instance_i_ds is not None: + body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') + else: + body_content = None + 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) + + if cls: + return cls(pipeline_response, None, {}) + + _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start'} # type: ignore + + async def begin_start( + self, + resource_group_name: str, + vm_scale_set_name: str, + vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + **kwargs + ) -> AsyncLROPoller[None]: + """Starts one or more virtual machines in a VM scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param vm_instance_i_ds: A list of virtual machine instance IDs from the VM scale set. + :type vm_instance_i_ds: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMInstanceIDs + :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._start_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + vm_instance_i_ds=vm_instance_i_ds, + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start'} # type: ignore + + async def _redeploy_initial( + self, + resource_group_name: str, + vm_scale_set_name: str, + vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + **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-06-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._redeploy_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if vm_instance_i_ds is not None: + body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') + else: + body_content = None + 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) + + if cls: + return cls(pipeline_response, None, {}) + + _redeploy_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/redeploy'} # type: ignore + + async def begin_redeploy( + self, + resource_group_name: str, + vm_scale_set_name: str, + vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + **kwargs + ) -> AsyncLROPoller[None]: + """Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, + and powers them back on. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param vm_instance_i_ds: A list of virtual machine instance IDs from the VM scale set. + :type vm_instance_i_ds: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMInstanceIDs + :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._redeploy_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + vm_instance_i_ds=vm_instance_i_ds, + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_redeploy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/redeploy'} # type: ignore + + async def _perform_maintenance_initial( + self, + resource_group_name: str, + vm_scale_set_name: str, + vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + **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-06-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._perform_maintenance_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if vm_instance_i_ds is not None: + body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') + else: + body_content = None + 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) + + if cls: + return cls(pipeline_response, None, {}) + + _perform_maintenance_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/performMaintenance'} # type: ignore + + async def begin_perform_maintenance( + self, + resource_group_name: str, + vm_scale_set_name: str, + vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + **kwargs + ) -> AsyncLROPoller[None]: + """Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances + which are not eligible for perform maintenance will be failed. Please refer to best practices + for more details: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual- + machine-scale-sets-maintenance-notifications. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param vm_instance_i_ds: A list of virtual machine instance IDs from the VM scale set. + :type vm_instance_i_ds: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMInstanceIDs + :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._perform_maintenance_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + vm_instance_i_ds=vm_instance_i_ds, + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_perform_maintenance.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/performMaintenance'} # type: ignore + + async def _update_instances_initial( + self, + resource_group_name: str, + vm_scale_set_name: str, + vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + **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-06-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._update_instances_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') + 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) + + if cls: + return cls(pipeline_response, None, {}) + + _update_instances_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade'} # type: ignore + + async def begin_update_instances( + self, + resource_group_name: str, + vm_scale_set_name: str, + vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + **kwargs + ) -> AsyncLROPoller[None]: + """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param vm_instance_i_ds: A list of virtual machine instance IDs from the VM scale set. + :type vm_instance_i_ds: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMInstanceRequiredIDs + :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._update_instances_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + vm_instance_i_ds=vm_instance_i_ds, + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_instances.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade'} # type: ignore + + async def _reimage_initial( + self, + resource_group_name: str, + vm_scale_set_name: str, + vm_scale_set_reimage_input: Optional["models.VirtualMachineScaleSetReimageParameters"] = None, + **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-06-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._reimage_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if vm_scale_set_reimage_input is not None: + body_content = self._serialize.body(vm_scale_set_reimage_input, 'VirtualMachineScaleSetReimageParameters') + else: + body_content = None + 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) + + if cls: + return cls(pipeline_response, None, {}) + + _reimage_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage'} # type: ignore + + async def begin_reimage( + self, + resource_group_name: str, + vm_scale_set_name: str, + vm_scale_set_reimage_input: Optional["models.VirtualMachineScaleSetReimageParameters"] = None, + **kwargs + ) -> AsyncLROPoller[None]: + """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which + don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual + machine is reset to initial state. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param vm_scale_set_reimage_input: Parameters for Reimaging VM ScaleSet. + :type vm_scale_set_reimage_input: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetReimageParameters + :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._reimage_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + vm_scale_set_reimage_input=vm_scale_set_reimage_input, + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_reimage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage'} # type: ignore + + async def _reimage_all_initial( + self, + resource_group_name: str, + vm_scale_set_name: str, + vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + **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-06-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._reimage_all_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if vm_instance_i_ds is not None: + body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') + else: + body_content = None + 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) + + if cls: + return cls(pipeline_response, None, {}) + + _reimage_all_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimageall'} # type: ignore + + async def begin_reimage_all( + self, + resource_group_name: str, + vm_scale_set_name: str, + vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + **kwargs + ) -> AsyncLROPoller[None]: + """Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This + operation is only supported for managed disks. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param vm_instance_i_ds: A list of virtual machine instance IDs from the VM scale set. + :type vm_instance_i_ds: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMInstanceIDs + :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._reimage_all_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + vm_instance_i_ds=vm_instance_i_ds, + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_reimage_all.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimageall'} # type: ignore + + async def force_recovery_service_fabric_platform_update_domain_walk( + self, + resource_group_name: str, + vm_scale_set_name: str, + platform_update_domain: int, + **kwargs + ) -> "models.RecoveryWalkResponse": + """Manual platform update domain walk to update virtual machines in a service fabric virtual + machine scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param platform_update_domain: The platform update domain for which a manual recovery walk is + requested. + :type platform_update_domain: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RecoveryWalkResponse, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.RecoveryWalkResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RecoveryWalkResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.force_recovery_service_fabric_platform_update_domain_walk.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + query_parameters['platformUpdateDomain'] = self._serialize.query("platform_update_domain", platform_update_domain, 'int') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RecoveryWalkResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + force_recovery_service_fabric_platform_update_domain_walk.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/forceRecoveryServiceFabricPlatformUpdateDomainWalk'} # type: ignore + + async def convert_to_single_placement_group( + self, + resource_group_name: str, + vm_scale_set_name: str, + parameters: "models.VMScaleSetConvertToSinglePlacementGroupInput", + **kwargs + ) -> None: + """Converts SinglePlacementGroup property to false for a existing virtual machine scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the virtual machine scale set to create or update. + :type vm_scale_set_name: str + :param parameters: The input object for ConvertToSinglePlacementGroup API. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.VMScaleSetConvertToSinglePlacementGroupInput + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-06-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.convert_to_single_placement_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'VMScaleSetConvertToSinglePlacementGroupInput') + 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]: + 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, {}) + + convert_to_single_placement_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/convertToSinglePlacementGroup'} # type: ignore + + async def _set_orchestration_service_state_initial( + self, + resource_group_name: str, + vm_scale_set_name: str, + parameters: "models.OrchestrationServiceStateInput", + **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-06-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._set_orchestration_service_state_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'OrchestrationServiceStateInput') + 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) + + if cls: + return cls(pipeline_response, None, {}) + + _set_orchestration_service_state_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/setOrchestrationServiceState'} # type: ignore + + async def begin_set_orchestration_service_state( + self, + resource_group_name: str, + vm_scale_set_name: str, + parameters: "models.OrchestrationServiceStateInput", + **kwargs + ) -> AsyncLROPoller[None]: + """Changes ServiceState property for a given service. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the virtual machine scale set to create or update. + :type vm_scale_set_name: str + :param parameters: The input object for SetOrchestrationServiceState API. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.OrchestrationServiceStateInput + :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._set_orchestration_service_state_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + parameters=parameters, + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_set_orchestration_service_state.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/setOrchestrationServiceState'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_sizes_operations.py new file mode 100644 index 000000000000..97afe7a81142 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_sizes_operations.py @@ -0,0 +1,113 @@ +# 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 + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VirtualMachineSizesOperations: + """VirtualMachineSizesOperations 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_06_01.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 + + def list( + self, + location: str, + **kwargs + ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + """This API is deprecated. Use `Resources Skus `_. + + :param location: The location upon which virtual-machine-sizes is queried. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualMachineSizeListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineSizeListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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 = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + '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('VirtualMachineSizeListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return 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/locations/{location}/vmSizes'} # type: ignore 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 new file mode 100644 index 000000000000..1ff6ac5c324e --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machines_operations.py @@ -0,0 +1,2253 @@ +# 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 + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VirtualMachinesOperations: + """VirtualMachinesOperations 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_06_01.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 + + def list_by_location( + self, + location: str, + **kwargs + ) -> AsyncIterable["models.VirtualMachineListResult"]: + """Gets all the virtual machines under the specified subscription for the specified location. + + :param location: The location for which virtual machines under the subscription are queried. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualMachineListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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_location.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + '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('VirtualMachineListResult', 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_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/virtualMachines'} # type: ignore + + async def _capture_initial( + self, + resource_group_name: str, + vm_name: str, + parameters: "models.VirtualMachineCaptureParameters", + **kwargs + ) -> Optional["models.VirtualMachineCaptureResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._capture_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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') + + # 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(parameters, 'VirtualMachineCaptureParameters') + 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('VirtualMachineCaptureResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _capture_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture'} # type: ignore + + async def begin_capture( + self, + resource_group_name: str, + vm_name: str, + parameters: "models.VirtualMachineCaptureParameters", + **kwargs + ) -> AsyncLROPoller["models.VirtualMachineCaptureResult"]: + """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used + to create similar VMs. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :param parameters: Parameters supplied to the Capture Virtual Machine operation. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineCaptureParameters + :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 VirtualMachineCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineCaptureResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] + 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._capture_initial( + resource_group_name=resource_group_name, + vm_name=vm_name, + parameters=parameters, + 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('VirtualMachineCaptureResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_capture.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + vm_name: str, + parameters: "models.VirtualMachine", + **kwargs + ) -> "models.VirtualMachine": + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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') + + # 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(parameters, 'VirtualMachine') + 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, 201]: + 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('VirtualMachine', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualMachine', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + vm_name: str, + parameters: "models.VirtualMachine", + **kwargs + ) -> AsyncLROPoller["models.VirtualMachine"]: + """The operation to create or update a virtual machine. Please note some properties can be set + only during virtual machine creation. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :param parameters: Parameters supplied to the Create Virtual Machine operation. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachine + :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 VirtualMachine or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + 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, + vm_name=vm_name, + parameters=parameters, + 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('VirtualMachine', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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/virtualMachines/{vmName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + vm_name: str, + parameters: "models.VirtualMachineUpdate", + **kwargs + ) -> "models.VirtualMachine": + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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') + + # 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(parameters, 'VirtualMachineUpdate') + 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, 201]: + 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('VirtualMachine', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualMachine', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + vm_name: str, + parameters: "models.VirtualMachineUpdate", + **kwargs + ) -> AsyncLROPoller["models.VirtualMachine"]: + """The operation to update a virtual machine. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :param parameters: Parameters supplied to the Update Virtual Machine operation. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineUpdate + :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 VirtualMachine or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + 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, + vm_name=vm_name, + parameters=parameters, + 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('VirtualMachine', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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/virtualMachines/{vmName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + vm_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-06-01" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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') + + # 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/virtualMachines/{vmName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + vm_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """The operation to delete a virtual machine. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_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, + vm_name=vm_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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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/virtualMachines/{vmName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + vm_name: str, + expand: Optional[str] = "instanceView", + **kwargs + ) -> "models.VirtualMachine": + """Retrieves information about the model view or the instance view of a virtual machine. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :param expand: The expand expression to apply on the operation. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualMachine, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachine + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + 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('VirtualMachine', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'} # type: ignore + + async def instance_view( + self, + resource_group_name: str, + vm_name: str, + **kwargs + ) -> "models.VirtualMachineInstanceView": + """Retrieves information about the run-time state of a virtual machine. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualMachineInstanceView, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineInstanceView + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineInstanceView"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.instance_view.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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') + + # 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('VirtualMachineInstanceView', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + instance_view.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/instanceView'} # type: ignore + + async def _convert_to_managed_disks_initial( + self, + resource_group_name: str, + vm_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-06-01" + + # Construct URL + url = self._convert_to_managed_disks_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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') + + # 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, {}) + + _convert_to_managed_disks_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/convertToManagedDisks'} # type: ignore + + async def begin_convert_to_managed_disks( + self, + resource_group_name: str, + vm_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop- + deallocated before invoking this operation. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_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._convert_to_managed_disks_initial( + resource_group_name=resource_group_name, + vm_name=vm_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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_convert_to_managed_disks.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/convertToManagedDisks'} # type: ignore + + async def _deallocate_initial( + self, + resource_group_name: str, + vm_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-06-01" + + # Construct URL + url = self._deallocate_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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') + + # 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, {}) + + _deallocate_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/deallocate'} # type: ignore + + async def begin_deallocate( + self, + resource_group_name: str, + vm_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Shuts down the virtual machine and releases the compute resources. You are not billed for the + compute resources that this virtual machine uses. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_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._deallocate_initial( + resource_group_name=resource_group_name, + vm_name=vm_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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_deallocate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/deallocate'} # type: ignore + + async def generalize( + self, + resource_group_name: str, + vm_name: str, + **kwargs + ) -> None: + """Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the + virtual machine before performing this operation. :code:`
`For Windows, please refer to + `Create a managed image of a generalized VM in Azure `_.:code:`
`For Linux, please refer + to `How to create an image of a virtual machine or VHD `_. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-06-01" + + # Construct URL + url = self.generalize.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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') + + # 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]: + 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, {}) + + generalize.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/generalize'} # type: ignore + + def list( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["models.VirtualMachineListResult"]: + """Lists all of the virtual machines in the specified resource group. Use the nextLink property in + the response to get the next page of virtual machines. + + :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 VirtualMachineListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + '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('VirtualMachineListResult', 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines'} # type: ignore + + def list_all( + self, + status_only: Optional[str] = None, + **kwargs + ) -> AsyncIterable["models.VirtualMachineListResult"]: + """Lists all of the virtual machines in the specified subscription. Use the nextLink property in + the response to get the next page of virtual machines. + + :param status_only: statusOnly=true enables fetching run time status of all Virtual Machines in + the subscription. + :type status_only: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualMachineListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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_all.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') + if status_only is not None: + query_parameters['statusOnly'] = self._serialize.query("status_only", status_only, '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('VirtualMachineListResult', 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_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines'} # type: ignore + + def list_available_sizes( + self, + resource_group_name: str, + vm_name: str, + **kwargs + ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + """Lists all available virtual machine sizes to which the specified virtual machine can be + resized. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualMachineSizeListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineSizeListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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_available_sizes.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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('VirtualMachineSizeListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return 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_available_sizes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/vmSizes'} # type: ignore + + async def _power_off_initial( + self, + resource_group_name: str, + vm_name: str, + skip_shutdown: Optional[bool] = False, + **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-06-01" + + # Construct URL + url = self._power_off_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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] + if skip_shutdown is not None: + query_parameters['skipShutdown'] = self._serialize.query("skip_shutdown", skip_shutdown, 'bool') + 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, {}) + + _power_off_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff'} # type: ignore + + async def begin_power_off( + self, + resource_group_name: str, + vm_name: str, + skip_shutdown: Optional[bool] = False, + **kwargs + ) -> AsyncLROPoller[None]: + """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with + the same provisioned resources. You are still charged for this virtual machine. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :param skip_shutdown: The parameter to request non-graceful VM shutdown. True value for this + flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this + flag is false if not specified. + :type skip_shutdown: 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. + :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._power_off_initial( + resource_group_name=resource_group_name, + vm_name=vm_name, + skip_shutdown=skip_shutdown, + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_power_off.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff'} # type: ignore + + async def _reapply_initial( + self, + resource_group_name: str, + vm_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-06-01" + accept = "application/json" + + # Construct URL + url = self._reapply_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + 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, {}) + + _reapply_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/reapply'} # type: ignore + + async def begin_reapply( + self, + resource_group_name: str, + vm_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """The operation to reapply a virtual machine's state. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_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._reapply_initial( + resource_group_name=resource_group_name, + vm_name=vm_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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_reapply.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/reapply'} # type: ignore + + async def _restart_initial( + self, + resource_group_name: str, + vm_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-06-01" + + # Construct URL + url = self._restart_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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') + + # 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, {}) + + _restart_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/restart'} # type: ignore + + async def begin_restart( + self, + resource_group_name: str, + vm_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """The operation to restart a virtual machine. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_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._restart_initial( + resource_group_name=resource_group_name, + vm_name=vm_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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/restart'} # type: ignore + + async def _start_initial( + self, + resource_group_name: str, + vm_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-06-01" + + # Construct URL + url = self._start_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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') + + # 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, {}) + + _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/start'} # type: ignore + + async def begin_start( + self, + resource_group_name: str, + vm_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """The operation to start a virtual machine. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_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._start_initial( + resource_group_name=resource_group_name, + vm_name=vm_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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/start'} # type: ignore + + async def _redeploy_initial( + self, + resource_group_name: str, + vm_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-06-01" + + # Construct URL + url = self._redeploy_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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') + + # 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, {}) + + _redeploy_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/redeploy'} # type: ignore + + async def begin_redeploy( + self, + resource_group_name: str, + vm_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Shuts down the virtual machine, moves it to a new node, and powers it back on. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_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._redeploy_initial( + resource_group_name=resource_group_name, + vm_name=vm_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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_redeploy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/redeploy'} # type: ignore + + async def _reimage_initial( + self, + resource_group_name: str, + vm_name: str, + parameters: Optional["models.VirtualMachineReimageParameters"] = None, + **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-06-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._reimage_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if parameters is not None: + body_content = self._serialize.body(parameters, 'VirtualMachineReimageParameters') + else: + body_content = None + 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) + + if cls: + return cls(pipeline_response, None, {}) + + _reimage_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/reimage'} # type: ignore + + async def begin_reimage( + self, + resource_group_name: str, + vm_name: str, + parameters: Optional["models.VirtualMachineReimageParameters"] = None, + **kwargs + ) -> AsyncLROPoller[None]: + """Reimages the virtual machine which has an ephemeral OS disk back to its initial state. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :param parameters: Parameters supplied to the Reimage Virtual Machine operation. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineReimageParameters + :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._reimage_initial( + resource_group_name=resource_group_name, + vm_name=vm_name, + parameters=parameters, + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_reimage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/reimage'} # type: ignore + + async def retrieve_boot_diagnostics_data( + self, + resource_group_name: str, + vm_name: str, + sas_uri_expiration_time_in_minutes: Optional[int] = None, + **kwargs + ) -> "models.RetrieveBootDiagnosticsDataResult": + """The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :param sas_uri_expiration_time_in_minutes: Expiration duration in minutes for the SAS URIs with + a value between 1 to 1440 minutes. :code:`
`:code:`
`NOTE: If not specified, SAS URIs + will be generated with a default expiration duration of 120 minutes. + :type sas_uri_expiration_time_in_minutes: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RetrieveBootDiagnosticsDataResult, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.RetrieveBootDiagnosticsDataResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RetrieveBootDiagnosticsDataResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.retrieve_boot_diagnostics_data.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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] + if sas_uri_expiration_time_in_minutes is not None: + query_parameters['sasUriExpirationTimeInMinutes'] = self._serialize.query("sas_uri_expiration_time_in_minutes", sas_uri_expiration_time_in_minutes, 'int') + 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.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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RetrieveBootDiagnosticsDataResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + retrieve_boot_diagnostics_data.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/retrieveBootDiagnosticsData'} # type: ignore + + async def _perform_maintenance_initial( + self, + resource_group_name: str, + vm_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-06-01" + + # Construct URL + url = self._perform_maintenance_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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') + + # 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, {}) + + _perform_maintenance_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/performMaintenance'} # type: ignore + + async def begin_perform_maintenance( + self, + resource_group_name: str, + vm_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """The operation to perform maintenance on a virtual machine. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_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._perform_maintenance_initial( + resource_group_name=resource_group_name, + vm_name=vm_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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_perform_maintenance.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/performMaintenance'} # type: ignore + + async def simulate_eviction( + self, + resource_group_name: str, + vm_name: str, + **kwargs + ) -> None: + """The operation to simulate the eviction of spot virtual machine. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-06-01" + + # Construct URL + url = self.simulate_eviction.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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') + + # 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 [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, {}) + + simulate_eviction.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/simulateEviction'} # type: ignore + + async def _assess_patches_initial( + self, + resource_group_name: str, + vm_name: str, + **kwargs + ) -> Optional["models.VirtualMachineAssessPatchesResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineAssessPatchesResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self._assess_patches_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + 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) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VirtualMachineAssessPatchesResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _assess_patches_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/assessPatches'} # type: ignore + + async def begin_assess_patches( + self, + resource_group_name: str, + vm_name: str, + **kwargs + ) -> AsyncLROPoller["models.VirtualMachineAssessPatchesResult"]: + """Assess patches on the VM. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_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 VirtualMachineAssessPatchesResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineAssessPatchesResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineAssessPatchesResult"] + 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._assess_patches_initial( + resource_group_name=resource_group_name, + vm_name=vm_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): + deserialized = self._deserialize('VirtualMachineAssessPatchesResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_assess_patches.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/assessPatches'} # type: ignore + + async def _run_command_initial( + self, + resource_group_name: str, + vm_name: str, + parameters: "models.RunCommandInput", + **kwargs + ) -> Optional["models.RunCommandResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" + + # Construct URL + url = self._run_command_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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') + + # 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(parameters, 'RunCommandInput') + 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('RunCommandResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _run_command_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommand'} # type: ignore + + async def begin_run_command( + self, + resource_group_name: str, + vm_name: str, + parameters: "models.RunCommandInput", + **kwargs + ) -> AsyncLROPoller["models.RunCommandResult"]: + """Run command on the VM. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :param parameters: Parameters supplied to the Run command operation. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.RunCommandInput + :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 RunCommandResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_06_01.models.RunCommandResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] + 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._run_command_initial( + resource_group_name=resource_group_name, + vm_name=vm_name, + parameters=parameters, + 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('RunCommandResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_run_command.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommand'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/__init__.py new file mode 100644 index 000000000000..e9fd5c30685f --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/__init__.py @@ -0,0 +1,656 @@ +# 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. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import AdditionalCapabilities + from ._models_py3 import AdditionalUnattendContent + from ._models_py3 import ApiEntityReference + from ._models_py3 import ApiError + from ._models_py3 import ApiErrorBase + from ._models_py3 import AutomaticOSUpgradePolicy + from ._models_py3 import AutomaticOSUpgradeProperties + from ._models_py3 import AutomaticRepairsPolicy + from ._models_py3 import AvailabilitySet + from ._models_py3 import AvailabilitySetListResult + from ._models_py3 import AvailabilitySetUpdate + from ._models_py3 import AvailablePatchSummary + from ._models_py3 import BillingProfile + from ._models_py3 import BootDiagnostics + from ._models_py3 import BootDiagnosticsInstanceView + from ._models_py3 import Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties + from ._models_py3 import ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties + from ._models_py3 import ComputeOperationListResult + from ._models_py3 import ComputeOperationValue + from ._models_py3 import DataDisk + from ._models_py3 import DataDiskImage + from ._models_py3 import DedicatedHost + from ._models_py3 import DedicatedHostAllocatableVM + from ._models_py3 import DedicatedHostAvailableCapacity + from ._models_py3 import DedicatedHostGroup + from ._models_py3 import DedicatedHostGroupInstanceView + from ._models_py3 import DedicatedHostGroupListResult + from ._models_py3 import DedicatedHostGroupUpdate + from ._models_py3 import DedicatedHostInstanceView + from ._models_py3 import DedicatedHostInstanceViewWithName + from ._models_py3 import DedicatedHostListResult + from ._models_py3 import DedicatedHostUpdate + from ._models_py3 import DiagnosticsProfile + from ._models_py3 import DiffDiskSettings + from ._models_py3 import DisallowedConfiguration + from ._models_py3 import DiskEncryptionSetParameters + from ._models_py3 import DiskEncryptionSettings + from ._models_py3 import DiskInstanceView + from ._models_py3 import HardwareProfile + from ._models_py3 import Image + from ._models_py3 import ImageDataDisk + from ._models_py3 import ImageDisk + from ._models_py3 import ImageListResult + from ._models_py3 import ImageOSDisk + from ._models_py3 import ImageReference + from ._models_py3 import ImageStorageProfile + from ._models_py3 import ImageUpdate + from ._models_py3 import InnerError + from ._models_py3 import InstanceViewStatus + from ._models_py3 import KeyVaultKeyReference + from ._models_py3 import KeyVaultSecretReference + from ._models_py3 import LastPatchInstallationSummary + from ._models_py3 import LinuxConfiguration + from ._models_py3 import ListUsagesResult + from ._models_py3 import LogAnalyticsInputBase + from ._models_py3 import LogAnalyticsOperationResult + from ._models_py3 import LogAnalyticsOutput + from ._models_py3 import MaintenanceRedeployStatus + from ._models_py3 import ManagedDiskParameters + from ._models_py3 import NetworkInterfaceReference + from ._models_py3 import NetworkProfile + from ._models_py3 import OSDisk + from ._models_py3 import OSDiskImage + from ._models_py3 import OSProfile + from ._models_py3 import OrchestrationServiceStateInput + from ._models_py3 import OrchestrationServiceSummary + from ._models_py3 import PatchSettings + from ._models_py3 import Plan + from ._models_py3 import ProximityPlacementGroup + from ._models_py3 import ProximityPlacementGroupListResult + from ._models_py3 import ProximityPlacementGroupUpdate + from ._models_py3 import PurchasePlan + from ._models_py3 import RecoveryWalkResponse + from ._models_py3 import RequestRateByIntervalInput + from ._models_py3 import Resource + from ._models_py3 import RetrieveBootDiagnosticsDataResult + from ._models_py3 import RollbackStatusInfo + from ._models_py3 import RollingUpgradePolicy + from ._models_py3 import RollingUpgradeProgressInfo + from ._models_py3 import RollingUpgradeRunningStatus + from ._models_py3 import RollingUpgradeStatusInfo + from ._models_py3 import RunCommandDocument + from ._models_py3 import RunCommandDocumentBase + from ._models_py3 import RunCommandInput + from ._models_py3 import RunCommandInputParameter + from ._models_py3 import RunCommandListResult + from ._models_py3 import RunCommandParameterDefinition + from ._models_py3 import RunCommandResult + from ._models_py3 import ScaleInPolicy + from ._models_py3 import ScheduledEventsProfile + from ._models_py3 import SecurityProfile + from ._models_py3 import Sku + from ._models_py3 import SshConfiguration + from ._models_py3 import SshPublicKey + from ._models_py3 import SshPublicKeyGenerateKeyPairResult + from ._models_py3 import SshPublicKeyResource + from ._models_py3 import SshPublicKeyUpdateResource + from ._models_py3 import SshPublicKeysGroupListResult + from ._models_py3 import StorageProfile + from ._models_py3 import SubResource + from ._models_py3 import SubResourceReadOnly + from ._models_py3 import SubResourceWithColocationStatus + from ._models_py3 import TerminateNotificationProfile + from ._models_py3 import ThrottledRequestsInput + from ._models_py3 import UpdateResource + from ._models_py3 import UpgradeOperationHistoricalStatusInfo + from ._models_py3 import UpgradeOperationHistoricalStatusInfoProperties + from ._models_py3 import UpgradeOperationHistoryStatus + from ._models_py3 import UpgradePolicy + from ._models_py3 import Usage + from ._models_py3 import UsageName + from ._models_py3 import VMScaleSetConvertToSinglePlacementGroupInput + from ._models_py3 import VaultCertificate + from ._models_py3 import VaultSecretGroup + from ._models_py3 import VirtualHardDisk + from ._models_py3 import VirtualMachine + from ._models_py3 import VirtualMachineAgentInstanceView + from ._models_py3 import VirtualMachineAssessPatchesResult + from ._models_py3 import VirtualMachineCaptureParameters + from ._models_py3 import VirtualMachineCaptureResult + from ._models_py3 import VirtualMachineExtension + from ._models_py3 import VirtualMachineExtensionHandlerInstanceView + from ._models_py3 import VirtualMachineExtensionImage + from ._models_py3 import VirtualMachineExtensionInstanceView + from ._models_py3 import VirtualMachineExtensionUpdate + from ._models_py3 import VirtualMachineExtensionsListResult + from ._models_py3 import VirtualMachineHealthStatus + from ._models_py3 import VirtualMachineIdentity + from ._models_py3 import VirtualMachineImage + from ._models_py3 import VirtualMachineImageResource + from ._models_py3 import VirtualMachineInstanceView + from ._models_py3 import VirtualMachineListResult + from ._models_py3 import VirtualMachinePatchStatus + from ._models_py3 import VirtualMachineReimageParameters + from ._models_py3 import VirtualMachineScaleSet + from ._models_py3 import VirtualMachineScaleSetDataDisk + from ._models_py3 import VirtualMachineScaleSetExtension + from ._models_py3 import VirtualMachineScaleSetExtensionListResult + from ._models_py3 import VirtualMachineScaleSetExtensionProfile + from ._models_py3 import VirtualMachineScaleSetExtensionUpdate + from ._models_py3 import VirtualMachineScaleSetIPConfiguration + from ._models_py3 import VirtualMachineScaleSetIdentity + from ._models_py3 import VirtualMachineScaleSetInstanceView + from ._models_py3 import VirtualMachineScaleSetInstanceViewStatusesSummary + from ._models_py3 import VirtualMachineScaleSetIpTag + from ._models_py3 import VirtualMachineScaleSetListOSUpgradeHistory + from ._models_py3 import VirtualMachineScaleSetListResult + from ._models_py3 import VirtualMachineScaleSetListSkusResult + from ._models_py3 import VirtualMachineScaleSetListWithLinkResult + from ._models_py3 import VirtualMachineScaleSetManagedDiskParameters + from ._models_py3 import VirtualMachineScaleSetNetworkConfiguration + from ._models_py3 import VirtualMachineScaleSetNetworkConfigurationDnsSettings + from ._models_py3 import VirtualMachineScaleSetNetworkProfile + from ._models_py3 import VirtualMachineScaleSetOSDisk + from ._models_py3 import VirtualMachineScaleSetOSProfile + from ._models_py3 import VirtualMachineScaleSetPublicIPAddressConfiguration + from ._models_py3 import VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings + from ._models_py3 import VirtualMachineScaleSetReimageParameters + from ._models_py3 import VirtualMachineScaleSetSku + from ._models_py3 import VirtualMachineScaleSetSkuCapacity + from ._models_py3 import VirtualMachineScaleSetStorageProfile + from ._models_py3 import VirtualMachineScaleSetUpdate + from ._models_py3 import VirtualMachineScaleSetUpdateIPConfiguration + from ._models_py3 import VirtualMachineScaleSetUpdateNetworkConfiguration + from ._models_py3 import VirtualMachineScaleSetUpdateNetworkProfile + from ._models_py3 import VirtualMachineScaleSetUpdateOSDisk + from ._models_py3 import VirtualMachineScaleSetUpdateOSProfile + from ._models_py3 import VirtualMachineScaleSetUpdatePublicIPAddressConfiguration + from ._models_py3 import VirtualMachineScaleSetUpdateStorageProfile + from ._models_py3 import VirtualMachineScaleSetUpdateVMProfile + from ._models_py3 import VirtualMachineScaleSetVM + from ._models_py3 import VirtualMachineScaleSetVMExtensionsSummary + from ._models_py3 import VirtualMachineScaleSetVMInstanceIDs + from ._models_py3 import VirtualMachineScaleSetVMInstanceRequiredIDs + from ._models_py3 import VirtualMachineScaleSetVMInstanceView + from ._models_py3 import VirtualMachineScaleSetVMListResult + from ._models_py3 import VirtualMachineScaleSetVMNetworkProfileConfiguration + from ._models_py3 import VirtualMachineScaleSetVMProfile + from ._models_py3 import VirtualMachineScaleSetVMProtectionPolicy + from ._models_py3 import VirtualMachineScaleSetVMReimageParameters + from ._models_py3 import VirtualMachineSize + from ._models_py3 import VirtualMachineSizeListResult + from ._models_py3 import VirtualMachineSoftwarePatchProperties + from ._models_py3 import VirtualMachineStatusCodeCount + from ._models_py3 import VirtualMachineUpdate + from ._models_py3 import WinRMConfiguration + from ._models_py3 import WinRMListener + from ._models_py3 import WindowsConfiguration +except (SyntaxError, ImportError): + from ._models import AdditionalCapabilities # type: ignore + from ._models import AdditionalUnattendContent # type: ignore + from ._models import ApiEntityReference # type: ignore + from ._models import ApiError # type: ignore + from ._models import ApiErrorBase # type: ignore + from ._models import AutomaticOSUpgradePolicy # type: ignore + from ._models import AutomaticOSUpgradeProperties # type: ignore + from ._models import AutomaticRepairsPolicy # type: ignore + from ._models import AvailabilitySet # type: ignore + from ._models import AvailabilitySetListResult # type: ignore + from ._models import AvailabilitySetUpdate # type: ignore + from ._models import AvailablePatchSummary # type: ignore + from ._models import BillingProfile # type: ignore + from ._models import BootDiagnostics # type: ignore + from ._models import BootDiagnosticsInstanceView # type: ignore + from ._models import Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties # type: ignore + from ._models import ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties # type: ignore + from ._models import ComputeOperationListResult # type: ignore + from ._models import ComputeOperationValue # type: ignore + from ._models import DataDisk # type: ignore + from ._models import DataDiskImage # type: ignore + from ._models import DedicatedHost # type: ignore + from ._models import DedicatedHostAllocatableVM # type: ignore + from ._models import DedicatedHostAvailableCapacity # type: ignore + from ._models import DedicatedHostGroup # type: ignore + from ._models import DedicatedHostGroupInstanceView # type: ignore + from ._models import DedicatedHostGroupListResult # type: ignore + from ._models import DedicatedHostGroupUpdate # type: ignore + from ._models import DedicatedHostInstanceView # type: ignore + from ._models import DedicatedHostInstanceViewWithName # type: ignore + from ._models import DedicatedHostListResult # type: ignore + from ._models import DedicatedHostUpdate # type: ignore + from ._models import DiagnosticsProfile # type: ignore + from ._models import DiffDiskSettings # type: ignore + from ._models import DisallowedConfiguration # type: ignore + from ._models import DiskEncryptionSetParameters # type: ignore + from ._models import DiskEncryptionSettings # type: ignore + from ._models import DiskInstanceView # type: ignore + from ._models import HardwareProfile # type: ignore + from ._models import Image # type: ignore + from ._models import ImageDataDisk # type: ignore + from ._models import ImageDisk # type: ignore + from ._models import ImageListResult # type: ignore + from ._models import ImageOSDisk # type: ignore + from ._models import ImageReference # type: ignore + from ._models import ImageStorageProfile # type: ignore + from ._models import ImageUpdate # type: ignore + from ._models import InnerError # type: ignore + from ._models import InstanceViewStatus # type: ignore + from ._models import KeyVaultKeyReference # type: ignore + from ._models import KeyVaultSecretReference # type: ignore + from ._models import LastPatchInstallationSummary # type: ignore + from ._models import LinuxConfiguration # type: ignore + from ._models import ListUsagesResult # type: ignore + from ._models import LogAnalyticsInputBase # type: ignore + from ._models import LogAnalyticsOperationResult # type: ignore + from ._models import LogAnalyticsOutput # type: ignore + from ._models import MaintenanceRedeployStatus # type: ignore + from ._models import ManagedDiskParameters # type: ignore + from ._models import NetworkInterfaceReference # type: ignore + from ._models import NetworkProfile # type: ignore + from ._models import OSDisk # type: ignore + from ._models import OSDiskImage # type: ignore + from ._models import OSProfile # type: ignore + from ._models import OrchestrationServiceStateInput # type: ignore + from ._models import OrchestrationServiceSummary # type: ignore + from ._models import PatchSettings # type: ignore + from ._models import Plan # type: ignore + from ._models import ProximityPlacementGroup # type: ignore + from ._models import ProximityPlacementGroupListResult # type: ignore + from ._models import ProximityPlacementGroupUpdate # type: ignore + from ._models import PurchasePlan # type: ignore + from ._models import RecoveryWalkResponse # type: ignore + from ._models import RequestRateByIntervalInput # type: ignore + from ._models import Resource # type: ignore + from ._models import RetrieveBootDiagnosticsDataResult # type: ignore + from ._models import RollbackStatusInfo # type: ignore + from ._models import RollingUpgradePolicy # type: ignore + from ._models import RollingUpgradeProgressInfo # type: ignore + from ._models import RollingUpgradeRunningStatus # type: ignore + from ._models import RollingUpgradeStatusInfo # type: ignore + from ._models import RunCommandDocument # type: ignore + from ._models import RunCommandDocumentBase # type: ignore + from ._models import RunCommandInput # type: ignore + from ._models import RunCommandInputParameter # type: ignore + from ._models import RunCommandListResult # type: ignore + from ._models import RunCommandParameterDefinition # type: ignore + from ._models import RunCommandResult # type: ignore + from ._models import ScaleInPolicy # type: ignore + from ._models import ScheduledEventsProfile # type: ignore + from ._models import SecurityProfile # type: ignore + from ._models import Sku # type: ignore + from ._models import SshConfiguration # type: ignore + from ._models import SshPublicKey # type: ignore + from ._models import SshPublicKeyGenerateKeyPairResult # type: ignore + from ._models import SshPublicKeyResource # type: ignore + from ._models import SshPublicKeyUpdateResource # type: ignore + from ._models import SshPublicKeysGroupListResult # type: ignore + from ._models import StorageProfile # type: ignore + from ._models import SubResource # type: ignore + from ._models import SubResourceReadOnly # type: ignore + from ._models import SubResourceWithColocationStatus # type: ignore + from ._models import TerminateNotificationProfile # type: ignore + from ._models import ThrottledRequestsInput # type: ignore + from ._models import UpdateResource # type: ignore + from ._models import UpgradeOperationHistoricalStatusInfo # type: ignore + from ._models import UpgradeOperationHistoricalStatusInfoProperties # type: ignore + from ._models import UpgradeOperationHistoryStatus # type: ignore + from ._models import UpgradePolicy # type: ignore + from ._models import Usage # type: ignore + from ._models import UsageName # type: ignore + from ._models import VMScaleSetConvertToSinglePlacementGroupInput # type: ignore + from ._models import VaultCertificate # type: ignore + from ._models import VaultSecretGroup # type: ignore + from ._models import VirtualHardDisk # type: ignore + from ._models import VirtualMachine # type: ignore + from ._models import VirtualMachineAgentInstanceView # type: ignore + from ._models import VirtualMachineAssessPatchesResult # type: ignore + from ._models import VirtualMachineCaptureParameters # type: ignore + from ._models import VirtualMachineCaptureResult # type: ignore + from ._models import VirtualMachineExtension # type: ignore + from ._models import VirtualMachineExtensionHandlerInstanceView # type: ignore + from ._models import VirtualMachineExtensionImage # type: ignore + from ._models import VirtualMachineExtensionInstanceView # type: ignore + from ._models import VirtualMachineExtensionUpdate # type: ignore + from ._models import VirtualMachineExtensionsListResult # type: ignore + from ._models import VirtualMachineHealthStatus # type: ignore + from ._models import VirtualMachineIdentity # type: ignore + from ._models import VirtualMachineImage # type: ignore + from ._models import VirtualMachineImageResource # type: ignore + from ._models import VirtualMachineInstanceView # type: ignore + from ._models import VirtualMachineListResult # type: ignore + from ._models import VirtualMachinePatchStatus # type: ignore + from ._models import VirtualMachineReimageParameters # type: ignore + from ._models import VirtualMachineScaleSet # type: ignore + from ._models import VirtualMachineScaleSetDataDisk # type: ignore + from ._models import VirtualMachineScaleSetExtension # type: ignore + from ._models import VirtualMachineScaleSetExtensionListResult # type: ignore + from ._models import VirtualMachineScaleSetExtensionProfile # type: ignore + from ._models import VirtualMachineScaleSetExtensionUpdate # type: ignore + from ._models import VirtualMachineScaleSetIPConfiguration # type: ignore + from ._models import VirtualMachineScaleSetIdentity # type: ignore + from ._models import VirtualMachineScaleSetInstanceView # type: ignore + from ._models import VirtualMachineScaleSetInstanceViewStatusesSummary # type: ignore + from ._models import VirtualMachineScaleSetIpTag # type: ignore + from ._models import VirtualMachineScaleSetListOSUpgradeHistory # type: ignore + from ._models import VirtualMachineScaleSetListResult # type: ignore + from ._models import VirtualMachineScaleSetListSkusResult # type: ignore + from ._models import VirtualMachineScaleSetListWithLinkResult # type: ignore + from ._models import VirtualMachineScaleSetManagedDiskParameters # type: ignore + from ._models import VirtualMachineScaleSetNetworkConfiguration # type: ignore + from ._models import VirtualMachineScaleSetNetworkConfigurationDnsSettings # type: ignore + from ._models import VirtualMachineScaleSetNetworkProfile # type: ignore + from ._models import VirtualMachineScaleSetOSDisk # type: ignore + from ._models import VirtualMachineScaleSetOSProfile # type: ignore + from ._models import VirtualMachineScaleSetPublicIPAddressConfiguration # type: ignore + from ._models import VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings # type: ignore + from ._models import VirtualMachineScaleSetReimageParameters # type: ignore + from ._models import VirtualMachineScaleSetSku # type: ignore + from ._models import VirtualMachineScaleSetSkuCapacity # type: ignore + from ._models import VirtualMachineScaleSetStorageProfile # type: ignore + from ._models import VirtualMachineScaleSetUpdate # type: ignore + from ._models import VirtualMachineScaleSetUpdateIPConfiguration # type: ignore + from ._models import VirtualMachineScaleSetUpdateNetworkConfiguration # type: ignore + from ._models import VirtualMachineScaleSetUpdateNetworkProfile # type: ignore + from ._models import VirtualMachineScaleSetUpdateOSDisk # type: ignore + from ._models import VirtualMachineScaleSetUpdateOSProfile # type: ignore + from ._models import VirtualMachineScaleSetUpdatePublicIPAddressConfiguration # type: ignore + from ._models import VirtualMachineScaleSetUpdateStorageProfile # type: ignore + from ._models import VirtualMachineScaleSetUpdateVMProfile # type: ignore + from ._models import VirtualMachineScaleSetVM # type: ignore + from ._models import VirtualMachineScaleSetVMExtensionsSummary # type: ignore + from ._models import VirtualMachineScaleSetVMInstanceIDs # type: ignore + from ._models import VirtualMachineScaleSetVMInstanceRequiredIDs # type: ignore + from ._models import VirtualMachineScaleSetVMInstanceView # type: ignore + from ._models import VirtualMachineScaleSetVMListResult # type: ignore + from ._models import VirtualMachineScaleSetVMNetworkProfileConfiguration # type: ignore + from ._models import VirtualMachineScaleSetVMProfile # type: ignore + from ._models import VirtualMachineScaleSetVMProtectionPolicy # type: ignore + from ._models import VirtualMachineScaleSetVMReimageParameters # type: ignore + from ._models import VirtualMachineSize # type: ignore + from ._models import VirtualMachineSizeListResult # type: ignore + from ._models import VirtualMachineSoftwarePatchProperties # type: ignore + from ._models import VirtualMachineStatusCodeCount # type: ignore + from ._models import VirtualMachineUpdate # type: ignore + from ._models import WinRMConfiguration # type: ignore + from ._models import WinRMListener # type: ignore + from ._models import WindowsConfiguration # type: ignore + +from ._compute_management_client_enums import ( + AvailabilitySetSkuTypes, + CachingTypes, + DedicatedHostLicenseTypes, + DiffDiskOptions, + DiffDiskPlacement, + DiskCreateOptionTypes, + HyperVGenerationType, + HyperVGenerationTypes, + IPVersion, + InGuestPatchMode, + IntervalInMins, + MaintenanceOperationResultCodeTypes, + OperatingSystemStateTypes, + OperatingSystemTypes, + OrchestrationServiceNames, + OrchestrationServiceState, + OrchestrationServiceStateAction, + PatchAssessmentState, + PatchOperationStatus, + ProtocolTypes, + ProximityPlacementGroupType, + RebootStatus, + ResourceIdentityType, + RollingUpgradeActionType, + RollingUpgradeStatusCode, + SettingNames, + SoftwareUpdateRebootBehavior, + StatusLevelTypes, + StorageAccountTypes, + UpgradeMode, + UpgradeOperationInvoker, + UpgradeState, + VirtualMachineEvictionPolicyTypes, + VirtualMachinePriorityTypes, + VirtualMachineScaleSetScaleInRules, + VirtualMachineScaleSetSkuScaleType, + VirtualMachineSizeTypes, + VmDiskTypes, +) + +__all__ = [ + 'AdditionalCapabilities', + 'AdditionalUnattendContent', + 'ApiEntityReference', + 'ApiError', + 'ApiErrorBase', + 'AutomaticOSUpgradePolicy', + 'AutomaticOSUpgradeProperties', + 'AutomaticRepairsPolicy', + 'AvailabilitySet', + 'AvailabilitySetListResult', + 'AvailabilitySetUpdate', + 'AvailablePatchSummary', + 'BillingProfile', + 'BootDiagnostics', + 'BootDiagnosticsInstanceView', + 'Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties', + 'ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties', + 'ComputeOperationListResult', + 'ComputeOperationValue', + 'DataDisk', + 'DataDiskImage', + 'DedicatedHost', + 'DedicatedHostAllocatableVM', + 'DedicatedHostAvailableCapacity', + 'DedicatedHostGroup', + 'DedicatedHostGroupInstanceView', + 'DedicatedHostGroupListResult', + 'DedicatedHostGroupUpdate', + 'DedicatedHostInstanceView', + 'DedicatedHostInstanceViewWithName', + 'DedicatedHostListResult', + 'DedicatedHostUpdate', + 'DiagnosticsProfile', + 'DiffDiskSettings', + 'DisallowedConfiguration', + 'DiskEncryptionSetParameters', + 'DiskEncryptionSettings', + 'DiskInstanceView', + 'HardwareProfile', + 'Image', + 'ImageDataDisk', + 'ImageDisk', + 'ImageListResult', + 'ImageOSDisk', + 'ImageReference', + 'ImageStorageProfile', + 'ImageUpdate', + 'InnerError', + 'InstanceViewStatus', + 'KeyVaultKeyReference', + 'KeyVaultSecretReference', + 'LastPatchInstallationSummary', + 'LinuxConfiguration', + 'ListUsagesResult', + 'LogAnalyticsInputBase', + 'LogAnalyticsOperationResult', + 'LogAnalyticsOutput', + 'MaintenanceRedeployStatus', + 'ManagedDiskParameters', + 'NetworkInterfaceReference', + 'NetworkProfile', + 'OSDisk', + 'OSDiskImage', + 'OSProfile', + 'OrchestrationServiceStateInput', + 'OrchestrationServiceSummary', + 'PatchSettings', + 'Plan', + 'ProximityPlacementGroup', + 'ProximityPlacementGroupListResult', + 'ProximityPlacementGroupUpdate', + 'PurchasePlan', + 'RecoveryWalkResponse', + 'RequestRateByIntervalInput', + 'Resource', + 'RetrieveBootDiagnosticsDataResult', + 'RollbackStatusInfo', + 'RollingUpgradePolicy', + 'RollingUpgradeProgressInfo', + 'RollingUpgradeRunningStatus', + 'RollingUpgradeStatusInfo', + 'RunCommandDocument', + 'RunCommandDocumentBase', + 'RunCommandInput', + 'RunCommandInputParameter', + 'RunCommandListResult', + 'RunCommandParameterDefinition', + 'RunCommandResult', + 'ScaleInPolicy', + 'ScheduledEventsProfile', + 'SecurityProfile', + 'Sku', + 'SshConfiguration', + 'SshPublicKey', + 'SshPublicKeyGenerateKeyPairResult', + 'SshPublicKeyResource', + 'SshPublicKeyUpdateResource', + 'SshPublicKeysGroupListResult', + 'StorageProfile', + 'SubResource', + 'SubResourceReadOnly', + 'SubResourceWithColocationStatus', + 'TerminateNotificationProfile', + 'ThrottledRequestsInput', + 'UpdateResource', + 'UpgradeOperationHistoricalStatusInfo', + 'UpgradeOperationHistoricalStatusInfoProperties', + 'UpgradeOperationHistoryStatus', + 'UpgradePolicy', + 'Usage', + 'UsageName', + 'VMScaleSetConvertToSinglePlacementGroupInput', + 'VaultCertificate', + 'VaultSecretGroup', + 'VirtualHardDisk', + 'VirtualMachine', + 'VirtualMachineAgentInstanceView', + 'VirtualMachineAssessPatchesResult', + 'VirtualMachineCaptureParameters', + 'VirtualMachineCaptureResult', + 'VirtualMachineExtension', + 'VirtualMachineExtensionHandlerInstanceView', + 'VirtualMachineExtensionImage', + 'VirtualMachineExtensionInstanceView', + 'VirtualMachineExtensionUpdate', + 'VirtualMachineExtensionsListResult', + 'VirtualMachineHealthStatus', + 'VirtualMachineIdentity', + 'VirtualMachineImage', + 'VirtualMachineImageResource', + 'VirtualMachineInstanceView', + 'VirtualMachineListResult', + 'VirtualMachinePatchStatus', + 'VirtualMachineReimageParameters', + 'VirtualMachineScaleSet', + 'VirtualMachineScaleSetDataDisk', + 'VirtualMachineScaleSetExtension', + 'VirtualMachineScaleSetExtensionListResult', + 'VirtualMachineScaleSetExtensionProfile', + 'VirtualMachineScaleSetExtensionUpdate', + 'VirtualMachineScaleSetIPConfiguration', + 'VirtualMachineScaleSetIdentity', + 'VirtualMachineScaleSetInstanceView', + 'VirtualMachineScaleSetInstanceViewStatusesSummary', + 'VirtualMachineScaleSetIpTag', + 'VirtualMachineScaleSetListOSUpgradeHistory', + 'VirtualMachineScaleSetListResult', + 'VirtualMachineScaleSetListSkusResult', + 'VirtualMachineScaleSetListWithLinkResult', + 'VirtualMachineScaleSetManagedDiskParameters', + 'VirtualMachineScaleSetNetworkConfiguration', + 'VirtualMachineScaleSetNetworkConfigurationDnsSettings', + 'VirtualMachineScaleSetNetworkProfile', + 'VirtualMachineScaleSetOSDisk', + 'VirtualMachineScaleSetOSProfile', + 'VirtualMachineScaleSetPublicIPAddressConfiguration', + 'VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings', + 'VirtualMachineScaleSetReimageParameters', + 'VirtualMachineScaleSetSku', + 'VirtualMachineScaleSetSkuCapacity', + 'VirtualMachineScaleSetStorageProfile', + 'VirtualMachineScaleSetUpdate', + 'VirtualMachineScaleSetUpdateIPConfiguration', + 'VirtualMachineScaleSetUpdateNetworkConfiguration', + 'VirtualMachineScaleSetUpdateNetworkProfile', + 'VirtualMachineScaleSetUpdateOSDisk', + 'VirtualMachineScaleSetUpdateOSProfile', + 'VirtualMachineScaleSetUpdatePublicIPAddressConfiguration', + 'VirtualMachineScaleSetUpdateStorageProfile', + 'VirtualMachineScaleSetUpdateVMProfile', + 'VirtualMachineScaleSetVM', + 'VirtualMachineScaleSetVMExtensionsSummary', + 'VirtualMachineScaleSetVMInstanceIDs', + 'VirtualMachineScaleSetVMInstanceRequiredIDs', + 'VirtualMachineScaleSetVMInstanceView', + 'VirtualMachineScaleSetVMListResult', + 'VirtualMachineScaleSetVMNetworkProfileConfiguration', + 'VirtualMachineScaleSetVMProfile', + 'VirtualMachineScaleSetVMProtectionPolicy', + 'VirtualMachineScaleSetVMReimageParameters', + 'VirtualMachineSize', + 'VirtualMachineSizeListResult', + 'VirtualMachineSoftwarePatchProperties', + 'VirtualMachineStatusCodeCount', + 'VirtualMachineUpdate', + 'WinRMConfiguration', + 'WinRMListener', + 'WindowsConfiguration', + 'AvailabilitySetSkuTypes', + 'CachingTypes', + 'DedicatedHostLicenseTypes', + 'DiffDiskOptions', + 'DiffDiskPlacement', + 'DiskCreateOptionTypes', + 'HyperVGenerationType', + 'HyperVGenerationTypes', + 'IPVersion', + 'InGuestPatchMode', + 'IntervalInMins', + 'MaintenanceOperationResultCodeTypes', + 'OperatingSystemStateTypes', + 'OperatingSystemTypes', + 'OrchestrationServiceNames', + 'OrchestrationServiceState', + 'OrchestrationServiceStateAction', + 'PatchAssessmentState', + 'PatchOperationStatus', + 'ProtocolTypes', + 'ProximityPlacementGroupType', + 'RebootStatus', + 'ResourceIdentityType', + 'RollingUpgradeActionType', + 'RollingUpgradeStatusCode', + 'SettingNames', + 'SoftwareUpdateRebootBehavior', + 'StatusLevelTypes', + 'StorageAccountTypes', + 'UpgradeMode', + 'UpgradeOperationInvoker', + 'UpgradeState', + 'VirtualMachineEvictionPolicyTypes', + 'VirtualMachinePriorityTypes', + 'VirtualMachineScaleSetScaleInRules', + 'VirtualMachineScaleSetSkuScaleType', + 'VirtualMachineSizeTypes', + 'VmDiskTypes', +] 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 new file mode 100644 index 000000000000..7c70d90e97ad --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/_compute_management_client_enums.py @@ -0,0 +1,548 @@ +# 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 enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class AvailabilitySetSkuTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the sku of an Availability Set. Use 'Aligned' for virtual machines with managed disks + and 'Classic' for virtual machines with unmanaged disks. Default value is 'Classic'. + """ + + CLASSIC = "Classic" + ALIGNED = "Aligned" + +class CachingTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the caching requirements. :code:`
`:code:`
` Possible values are: + :code:`
`:code:`
` **None** :code:`
`:code:`
` **ReadOnly** + :code:`
`:code:`
` **ReadWrite** :code:`
`:code:`
` Default: **None for Standard + storage. ReadOnly for Premium storage** + """ + + NONE = "None" + READ_ONLY = "ReadOnly" + READ_WRITE = "ReadWrite" + +class DedicatedHostLicenseTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the software license type that will be applied to the VMs deployed on the dedicated + host. :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **None** + :code:`
`:code:`
` **Windows_Server_Hybrid** :code:`
`:code:`
` + **Windows_Server_Perpetual** :code:`
`:code:`
` Default: **None** + """ + + NONE = "None" + WINDOWS_SERVER_HYBRID = "Windows_Server_Hybrid" + WINDOWS_SERVER_PERPETUAL = "Windows_Server_Perpetual" + +class DiffDiskOptions(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the ephemeral disk option for operating system disk. + """ + + LOCAL = "Local" + +class DiffDiskPlacement(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the ephemeral disk placement for operating system disk. This property can be used by + user in the request to choose the location i.e, cache disk or resource disk space for Ephemeral + OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer + Ephemeral OS disk size requirements for Windows VM at https://docs.microsoft.com/en- + us/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VM at + https://docs.microsoft.com/en-us/azure/virtual-machines/linux/ephemeral-os-disks#size- + requirements + """ + + CACHE_DISK = "CacheDisk" + RESOURCE_DISK = "ResourceDisk" + +class DiskCreateOptionTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies how the virtual machine should be created.:code:`
`:code:`
` Possible values + are::code:`
`:code:`
` **Attach** \u2013 This value is used when you are using a + specialized disk to create the virtual machine.:code:`
`:code:`
` **FromImage** \u2013 + This value is used when you are using an image to create the virtual machine. If you are using + a platform image, you also use the imageReference element described above. If you are using a + marketplace image, you also use the plan element previously described. + """ + + FROM_IMAGE = "FromImage" + EMPTY = "Empty" + ATTACH = "Attach" + +class HyperVGenerationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the HyperVGeneration Type associated with a resource + """ + + V1 = "V1" + V2 = "V2" + +class HyperVGenerationTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the HyperVGeneration Type + """ + + V1 = "V1" + V2 = "V2" + +class InGuestPatchMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the mode of in-guest patching to IaaS virtual machine.:code:`
`:code:`
` + Possible values are::code:`
`:code:`
` **Manual** - You control the application of + patches to a virtual machine. You do this by applying patches manually inside the VM. In this + mode, automatic updates are disabled; the property WindowsConfiguration.enableAutomaticUpdates + must be false:code:`
`:code:`
` **AutomaticByOS** - The virtual machine will + automatically be updated by the OS. The property WindowsConfiguration.enableAutomaticUpdates + must be true. :code:`
`:code:`
` ** AutomaticByPlatform** - the virtual machine will + automatically updated by the platform. The properties provisionVMAgent and + WindowsConfiguration.enableAutomaticUpdates must be true + """ + + MANUAL = "Manual" + AUTOMATIC_BY_OS = "AutomaticByOS" + AUTOMATIC_BY_PLATFORM = "AutomaticByPlatform" + +class IntervalInMins(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Interval value in minutes used to create LogAnalytics call rate logs. + """ + + THREE_MINS = "ThreeMins" + FIVE_MINS = "FiveMins" + THIRTY_MINS = "ThirtyMins" + SIXTY_MINS = "SixtyMins" + +class IPVersion(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Available from Api-Version 2017-03-30 onwards, it represents whether the specific + ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and + 'IPv6'. + """ + + I_PV4 = "IPv4" + I_PV6 = "IPv6" + +class MaintenanceOperationResultCodeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The Last Maintenance Operation Result Code. + """ + + NONE = "None" + RETRY_LATER = "RetryLater" + MAINTENANCE_ABORTED = "MaintenanceAborted" + MAINTENANCE_COMPLETED = "MaintenanceCompleted" + +class OperatingSystemStateTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The OS State. + """ + + GENERALIZED = "Generalized" #: Generalized image. Needs to be provisioned during deployment time. + SPECIALIZED = "Specialized" #: Specialized image. Contains already provisioned OS Disk. + +class OperatingSystemTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The operating system of the osDiskImage. + """ + + WINDOWS = "Windows" + LINUX = "Linux" + +class OrchestrationServiceNames(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The name of the service. + """ + + AUTOMATIC_REPAIRS = "AutomaticRepairs" + DUMMY_ORCHESTRATION_SERVICE_NAME = "DummyOrchestrationServiceName" + +class OrchestrationServiceState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current state of the service. + """ + + NOT_RUNNING = "NotRunning" + RUNNING = "Running" + SUSPENDED = "Suspended" + +class OrchestrationServiceStateAction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The action to be performed. + """ + + RESUME = "Resume" + SUSPEND = "Suspend" + +class PatchAssessmentState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Describes the outcome of an install operation for a given patch. + """ + + INSTALLED = "Installed" + FAILED = "Failed" + EXCLUDED = "Excluded" + NOT_SELECTED = "NotSelected" + PENDING = "Pending" + AVAILABLE = "Available" + +class PatchOperationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The overall success or failure status of the operation. It remains "InProgress" until the + operation completes. At that point it will become "Failed", "Succeeded", or + "CompletedWithWarnings." + """ + + IN_PROGRESS = "InProgress" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" + +class ProtocolTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the protocol of WinRM listener. :code:`
`:code:`
` Possible values are: + :code:`
`\ **http** :code:`
`:code:`
` **https** + """ + + HTTP = "Http" + HTTPS = "Https" + +class ProximityPlacementGroupType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the type of the proximity placement group. :code:`
`:code:`
` Possible values + are: :code:`
`:code:`
` **Standard** : Co-locate resources within an Azure region or + Availability Zone. :code:`
`:code:`
` **Ultra** : For future use. + """ + + STANDARD = "Standard" + ULTRA = "Ultra" + +class RebootStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The reboot status of the machine after the patch operation. It will be in "NotNeeded" status if + reboot is not needed after the patch operation. "Required" will be the status once the patch is + applied and machine is required to reboot. "Started" will be the reboot status when the machine + has started to reboot. "Failed" will be the status if the machine is failed to reboot. + "Completed" will be the status once the machine is rebooted successfully + """ + + NOT_NEEDED = "NotNeeded" + REQUIRED = "Required" + STARTED = "Started" + FAILED = "Failed" + COMPLETED = "Completed" + +class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity used for the virtual machine. The type 'SystemAssigned, UserAssigned' + includes both an implicitly created identity and a set of user assigned identities. The type + 'None' will remove any identities from the virtual machine. + """ + + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned, UserAssigned" + NONE = "None" + +class RollingUpgradeActionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The last action performed on the rolling upgrade. + """ + + START = "Start" + CANCEL = "Cancel" + +class RollingUpgradeStatusCode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Code indicating the current status of the upgrade. + """ + + ROLLING_FORWARD = "RollingForward" + CANCELLED = "Cancelled" + COMPLETED = "Completed" + FAULTED = "Faulted" + +class SettingNames(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the name of the setting to which the content applies. Possible values are: + FirstLogonCommands and AutoLogon. + """ + + AUTO_LOGON = "AutoLogon" + FIRST_LOGON_COMMANDS = "FirstLogonCommands" + +class SoftwareUpdateRebootBehavior(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Describes the reboot requirements of the patch. + """ + + NEVER_REBOOTS = "NeverReboots" + ALWAYS_REQUIRES_REBOOT = "AlwaysRequiresReboot" + CAN_REQUEST_REBOOT = "CanRequestReboot" + +class StatusLevelTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The level code. + """ + + INFO = "Info" + WARNING = "Warning" + ERROR = "Error" + +class StorageAccountTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the storage account type for the managed disk. Managed OS disk storage account type + can only be set when you create the scale set. NOTE: UltraSSD_LRS can only be used with data + disks. It cannot be used with OS Disk. Standard_LRS uses Standard HDD. StandardSSD_LRS uses + Standard SSD. Premium_LRS uses Premium SSD. UltraSSD_LRS uses Ultra disk. For more information + regarding disks supported for Windows Virtual Machines, refer to https://docs.microsoft.com/en- + us/azure/virtual-machines/windows/disks-types and, for Linux Virtual Machines, refer to + https://docs.microsoft.com/en-us/azure/virtual-machines/linux/disks-types + """ + + STANDARD_LRS = "Standard_LRS" + PREMIUM_LRS = "Premium_LRS" + STANDARD_SSD_LRS = "StandardSSD_LRS" + ULTRA_SSD_LRS = "UltraSSD_LRS" + +class UpgradeMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the mode of an upgrade to virtual machines in the scale set.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` **Manual** - You control the application + of updates to virtual machines in the scale set. You do this by using the manualUpgrade + action.:code:`
`:code:`
` **Automatic** - All virtual machines in the scale set are + automatically updated at the same time. + """ + + AUTOMATIC = "Automatic" + MANUAL = "Manual" + ROLLING = "Rolling" + +class UpgradeOperationInvoker(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Invoker of the Upgrade Operation + """ + + UNKNOWN = "Unknown" + USER = "User" + PLATFORM = "Platform" + +class UpgradeState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Code indicating the current status of the upgrade. + """ + + ROLLING_FORWARD = "RollingForward" + CANCELLED = "Cancelled" + COMPLETED = "Completed" + FAULTED = "Faulted" + +class VirtualMachineEvictionPolicyTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the eviction policy for the Azure Spot VM/VMSS + """ + + DEALLOCATE = "Deallocate" + DELETE = "Delete" + +class VirtualMachinePriorityTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the priority for a standalone virtual machine or the virtual machines in the scale + set. :code:`
`:code:`
` 'Low' enum will be deprecated in the future, please use 'Spot' as + the enum to deploy Azure Spot VM/VMSS. + """ + + REGULAR = "Regular" + LOW = "Low" + SPOT = "Spot" + +class VirtualMachineScaleSetScaleInRules(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + DEFAULT = "Default" + OLDEST_VM = "OldestVM" + NEWEST_VM = "NewestVM" + +class VirtualMachineScaleSetSkuScaleType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The scale type applicable to the sku. + """ + + AUTOMATIC = "Automatic" + NONE = "None" + +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 + `_ + :code:`
`:code:`
` `List all available virtual machine sizes in a region + `_ + :code:`
`:code:`
` `List all available virtual machine sizes for resizing + `_ + """ + + BASIC_A0 = "Basic_A0" + BASIC_A1 = "Basic_A1" + BASIC_A2 = "Basic_A2" + BASIC_A3 = "Basic_A3" + BASIC_A4 = "Basic_A4" + STANDARD_A0 = "Standard_A0" + STANDARD_A1 = "Standard_A1" + STANDARD_A2 = "Standard_A2" + STANDARD_A3 = "Standard_A3" + STANDARD_A4 = "Standard_A4" + STANDARD_A5 = "Standard_A5" + STANDARD_A6 = "Standard_A6" + STANDARD_A7 = "Standard_A7" + STANDARD_A8 = "Standard_A8" + STANDARD_A9 = "Standard_A9" + STANDARD_A10 = "Standard_A10" + STANDARD_A11 = "Standard_A11" + STANDARD_A1_V2 = "Standard_A1_v2" + STANDARD_A2_V2 = "Standard_A2_v2" + STANDARD_A4_V2 = "Standard_A4_v2" + STANDARD_A8_V2 = "Standard_A8_v2" + STANDARD_A2_M_V2 = "Standard_A2m_v2" + STANDARD_A4_M_V2 = "Standard_A4m_v2" + STANDARD_A8_M_V2 = "Standard_A8m_v2" + STANDARD_B1_S = "Standard_B1s" + STANDARD_B1_MS = "Standard_B1ms" + STANDARD_B2_S = "Standard_B2s" + STANDARD_B2_MS = "Standard_B2ms" + STANDARD_B4_MS = "Standard_B4ms" + STANDARD_B8_MS = "Standard_B8ms" + STANDARD_D1 = "Standard_D1" + STANDARD_D2 = "Standard_D2" + STANDARD_D3 = "Standard_D3" + STANDARD_D4 = "Standard_D4" + STANDARD_D11 = "Standard_D11" + STANDARD_D12 = "Standard_D12" + STANDARD_D13 = "Standard_D13" + STANDARD_D14 = "Standard_D14" + STANDARD_D1_V2 = "Standard_D1_v2" + STANDARD_D2_V2 = "Standard_D2_v2" + STANDARD_D3_V2 = "Standard_D3_v2" + STANDARD_D4_V2 = "Standard_D4_v2" + STANDARD_D5_V2 = "Standard_D5_v2" + STANDARD_D2_V3 = "Standard_D2_v3" + STANDARD_D4_V3 = "Standard_D4_v3" + STANDARD_D8_V3 = "Standard_D8_v3" + STANDARD_D16_V3 = "Standard_D16_v3" + STANDARD_D32_V3 = "Standard_D32_v3" + STANDARD_D64_V3 = "Standard_D64_v3" + STANDARD_D2_S_V3 = "Standard_D2s_v3" + STANDARD_D4_S_V3 = "Standard_D4s_v3" + STANDARD_D8_S_V3 = "Standard_D8s_v3" + STANDARD_D16_S_V3 = "Standard_D16s_v3" + STANDARD_D32_S_V3 = "Standard_D32s_v3" + STANDARD_D64_S_V3 = "Standard_D64s_v3" + STANDARD_D11_V2 = "Standard_D11_v2" + STANDARD_D12_V2 = "Standard_D12_v2" + STANDARD_D13_V2 = "Standard_D13_v2" + STANDARD_D14_V2 = "Standard_D14_v2" + STANDARD_D15_V2 = "Standard_D15_v2" + STANDARD_DS1 = "Standard_DS1" + STANDARD_DS2 = "Standard_DS2" + STANDARD_DS3 = "Standard_DS3" + STANDARD_DS4 = "Standard_DS4" + STANDARD_DS11 = "Standard_DS11" + STANDARD_DS12 = "Standard_DS12" + STANDARD_DS13 = "Standard_DS13" + STANDARD_DS14 = "Standard_DS14" + STANDARD_DS1_V2 = "Standard_DS1_v2" + STANDARD_DS2_V2 = "Standard_DS2_v2" + STANDARD_DS3_V2 = "Standard_DS3_v2" + STANDARD_DS4_V2 = "Standard_DS4_v2" + STANDARD_DS5_V2 = "Standard_DS5_v2" + STANDARD_DS11_V2 = "Standard_DS11_v2" + STANDARD_DS12_V2 = "Standard_DS12_v2" + STANDARD_DS13_V2 = "Standard_DS13_v2" + STANDARD_DS14_V2 = "Standard_DS14_v2" + STANDARD_DS15_V2 = "Standard_DS15_v2" + STANDARD_DS13_4_V2 = "Standard_DS13-4_v2" + STANDARD_DS13_2_V2 = "Standard_DS13-2_v2" + STANDARD_DS14_8_V2 = "Standard_DS14-8_v2" + STANDARD_DS14_4_V2 = "Standard_DS14-4_v2" + STANDARD_E2_V3 = "Standard_E2_v3" + STANDARD_E4_V3 = "Standard_E4_v3" + STANDARD_E8_V3 = "Standard_E8_v3" + STANDARD_E16_V3 = "Standard_E16_v3" + STANDARD_E32_V3 = "Standard_E32_v3" + STANDARD_E64_V3 = "Standard_E64_v3" + STANDARD_E2_S_V3 = "Standard_E2s_v3" + STANDARD_E4_S_V3 = "Standard_E4s_v3" + STANDARD_E8_S_V3 = "Standard_E8s_v3" + STANDARD_E16_S_V3 = "Standard_E16s_v3" + STANDARD_E32_S_V3 = "Standard_E32s_v3" + STANDARD_E64_S_V3 = "Standard_E64s_v3" + STANDARD_E32_16_V3 = "Standard_E32-16_v3" + STANDARD_E32_8_S_V3 = "Standard_E32-8s_v3" + STANDARD_E64_32_S_V3 = "Standard_E64-32s_v3" + STANDARD_E64_16_S_V3 = "Standard_E64-16s_v3" + STANDARD_F1 = "Standard_F1" + STANDARD_F2 = "Standard_F2" + STANDARD_F4 = "Standard_F4" + STANDARD_F8 = "Standard_F8" + STANDARD_F16 = "Standard_F16" + STANDARD_F1_S = "Standard_F1s" + STANDARD_F2_S = "Standard_F2s" + STANDARD_F4_S = "Standard_F4s" + STANDARD_F8_S = "Standard_F8s" + STANDARD_F16_S = "Standard_F16s" + STANDARD_F2_S_V2 = "Standard_F2s_v2" + STANDARD_F4_S_V2 = "Standard_F4s_v2" + STANDARD_F8_S_V2 = "Standard_F8s_v2" + STANDARD_F16_S_V2 = "Standard_F16s_v2" + STANDARD_F32_S_V2 = "Standard_F32s_v2" + STANDARD_F64_S_V2 = "Standard_F64s_v2" + STANDARD_F72_S_V2 = "Standard_F72s_v2" + STANDARD_G1 = "Standard_G1" + STANDARD_G2 = "Standard_G2" + STANDARD_G3 = "Standard_G3" + STANDARD_G4 = "Standard_G4" + STANDARD_G5 = "Standard_G5" + STANDARD_GS1 = "Standard_GS1" + STANDARD_GS2 = "Standard_GS2" + STANDARD_GS3 = "Standard_GS3" + STANDARD_GS4 = "Standard_GS4" + STANDARD_GS5 = "Standard_GS5" + STANDARD_GS4_8 = "Standard_GS4-8" + STANDARD_GS4_4 = "Standard_GS4-4" + STANDARD_GS5_16 = "Standard_GS5-16" + STANDARD_GS5_8 = "Standard_GS5-8" + STANDARD_H8 = "Standard_H8" + STANDARD_H16 = "Standard_H16" + STANDARD_H8_M = "Standard_H8m" + STANDARD_H16_M = "Standard_H16m" + STANDARD_H16_R = "Standard_H16r" + STANDARD_H16_MR = "Standard_H16mr" + STANDARD_L4_S = "Standard_L4s" + STANDARD_L8_S = "Standard_L8s" + STANDARD_L16_S = "Standard_L16s" + STANDARD_L32_S = "Standard_L32s" + STANDARD_M64_S = "Standard_M64s" + STANDARD_M64_MS = "Standard_M64ms" + STANDARD_M128_S = "Standard_M128s" + STANDARD_M128_MS = "Standard_M128ms" + STANDARD_M64_32_MS = "Standard_M64-32ms" + STANDARD_M64_16_MS = "Standard_M64-16ms" + STANDARD_M128_64_MS = "Standard_M128-64ms" + STANDARD_M128_32_MS = "Standard_M128-32ms" + STANDARD_NC6 = "Standard_NC6" + STANDARD_NC12 = "Standard_NC12" + STANDARD_NC24 = "Standard_NC24" + STANDARD_NC24_R = "Standard_NC24r" + STANDARD_NC6_S_V2 = "Standard_NC6s_v2" + STANDARD_NC12_S_V2 = "Standard_NC12s_v2" + STANDARD_NC24_S_V2 = "Standard_NC24s_v2" + STANDARD_NC24_RS_V2 = "Standard_NC24rs_v2" + STANDARD_NC6_S_V3 = "Standard_NC6s_v3" + STANDARD_NC12_S_V3 = "Standard_NC12s_v3" + STANDARD_NC24_S_V3 = "Standard_NC24s_v3" + STANDARD_NC24_RS_V3 = "Standard_NC24rs_v3" + STANDARD_ND6_S = "Standard_ND6s" + STANDARD_ND12_S = "Standard_ND12s" + STANDARD_ND24_S = "Standard_ND24s" + STANDARD_ND24_RS = "Standard_ND24rs" + STANDARD_NV6 = "Standard_NV6" + STANDARD_NV12 = "Standard_NV12" + STANDARD_NV24 = "Standard_NV24" + +class VmDiskTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """VM disk types which are disallowed. + """ + + NONE = "None" + UNMANAGED = "Unmanaged" 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 new file mode 100644 index 000000000000..461000731f12 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/_models.py @@ -0,0 +1,7933 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import msrest.serialization + + +class AdditionalCapabilities(msrest.serialization.Model): + """Enables or disables a capability on the virtual machine or virtual machine scale set. + + :param ultra_ssd_enabled: The flag that enables or disables a capability to have one or more + managed data disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed disks with + storage account type UltraSSD_LRS can be added to a virtual machine or virtual machine scale + set only if this property is enabled. + :type ultra_ssd_enabled: bool + """ + + _attribute_map = { + 'ultra_ssd_enabled': {'key': 'ultraSSDEnabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(AdditionalCapabilities, self).__init__(**kwargs) + self.ultra_ssd_enabled = kwargs.get('ultra_ssd_enabled', None) + + +class AdditionalUnattendContent(msrest.serialization.Model): + """Specifies additional XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup. Contents are defined by setting name, component name, and the pass in which the content is applied. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar pass_name: The pass name. Currently, the only allowable value is OobeSystem. Default + value: "OobeSystem". + :vartype pass_name: str + :ivar component_name: The component name. Currently, the only allowable value is Microsoft- + Windows-Shell-Setup. Default value: "Microsoft-Windows-Shell-Setup". + :vartype component_name: str + :param setting_name: Specifies the name of the setting to which the content applies. Possible + values are: FirstLogonCommands and AutoLogon. Possible values include: "AutoLogon", + "FirstLogonCommands". + :type setting_name: str or ~azure.mgmt.compute.v2020_06_01.models.SettingNames + :param content: Specifies the XML formatted content that is added to the unattend.xml file for + the specified path and component. The XML must be less than 4KB and must include the root + element for the setting or feature that is being inserted. + :type content: str + """ + + _validation = { + 'pass_name': {'constant': True}, + 'component_name': {'constant': True}, + } + + _attribute_map = { + 'pass_name': {'key': 'passName', 'type': 'str'}, + 'component_name': {'key': 'componentName', 'type': 'str'}, + 'setting_name': {'key': 'settingName', 'type': 'str'}, + 'content': {'key': 'content', 'type': 'str'}, + } + + pass_name = "OobeSystem" + component_name = "Microsoft-Windows-Shell-Setup" + + def __init__( + self, + **kwargs + ): + super(AdditionalUnattendContent, self).__init__(**kwargs) + self.setting_name = kwargs.get('setting_name', None) + self.content = kwargs.get('content', None) + + +class ApiEntityReference(msrest.serialization.Model): + """The API entity reference. + + :param id: The ARM resource id in the form of + /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiEntityReference, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class ApiError(msrest.serialization.Model): + """Api error. + + :param details: The Api error details. + :type details: list[~azure.mgmt.compute.v2020_06_01.models.ApiErrorBase] + :param innererror: The Api inner error. + :type innererror: ~azure.mgmt.compute.v2020_06_01.models.InnerError + :param code: The error code. + :type code: str + :param target: The target of the particular error. + :type target: str + :param message: The error message. + :type message: str + """ + + _attribute_map = { + 'details': {'key': 'details', 'type': '[ApiErrorBase]'}, + 'innererror': {'key': 'innererror', 'type': 'InnerError'}, + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiError, self).__init__(**kwargs) + self.details = kwargs.get('details', None) + self.innererror = kwargs.get('innererror', None) + self.code = kwargs.get('code', None) + self.target = kwargs.get('target', None) + self.message = kwargs.get('message', None) + + +class ApiErrorBase(msrest.serialization.Model): + """Api error base. + + :param code: The error code. + :type code: str + :param target: The target of the particular error. + :type target: str + :param message: The error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiErrorBase, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.target = kwargs.get('target', None) + self.message = kwargs.get('message', None) + + +class AutomaticOSUpgradePolicy(msrest.serialization.Model): + """The configuration parameters used for performing automatic OS upgrade. + + :param enable_automatic_os_upgrade: Indicates whether OS upgrades should automatically be + applied to scale set instances in a rolling fashion when a newer version of the OS image + becomes available. Default value is false. :code:`
`:code:`
` If this is set to true for + Windows based scale sets, `enableAutomaticUpdates + `_ is automatically set to false and cannot be set to true. + :type enable_automatic_os_upgrade: bool + :param disable_automatic_rollback: Whether OS image rollback feature should be disabled. + Default value is false. + :type disable_automatic_rollback: bool + """ + + _attribute_map = { + 'enable_automatic_os_upgrade': {'key': 'enableAutomaticOSUpgrade', 'type': 'bool'}, + 'disable_automatic_rollback': {'key': 'disableAutomaticRollback', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(AutomaticOSUpgradePolicy, self).__init__(**kwargs) + self.enable_automatic_os_upgrade = kwargs.get('enable_automatic_os_upgrade', None) + self.disable_automatic_rollback = kwargs.get('disable_automatic_rollback', None) + + +class AutomaticOSUpgradeProperties(msrest.serialization.Model): + """Describes automatic OS upgrade properties on the image. + + All required parameters must be populated in order to send to Azure. + + :param automatic_os_upgrade_supported: Required. Specifies whether automatic OS upgrade is + supported on the image. + :type automatic_os_upgrade_supported: bool + """ + + _validation = { + 'automatic_os_upgrade_supported': {'required': True}, + } + + _attribute_map = { + 'automatic_os_upgrade_supported': {'key': 'automaticOSUpgradeSupported', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(AutomaticOSUpgradeProperties, self).__init__(**kwargs) + self.automatic_os_upgrade_supported = kwargs['automatic_os_upgrade_supported'] + + +class AutomaticRepairsPolicy(msrest.serialization.Model): + """Specifies the configuration parameters for automatic repairs on the virtual machine scale set. + + :param enabled: Specifies whether automatic repairs should be enabled on the virtual machine + scale set. The default value is false. + :type enabled: bool + :param grace_period: The amount of time for which automatic repairs are suspended due to a + state change on VM. The grace time starts after the state change has completed. This helps + avoid premature or accidental repairs. The time duration should be specified in ISO 8601 + format. The minimum allowed grace period is 30 minutes (PT30M), which is also the default + value. The maximum allowed grace period is 90 minutes (PT90M). + :type grace_period: str + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'grace_period': {'key': 'gracePeriod', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AutomaticRepairsPolicy, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.grace_period = kwargs.get('grace_period', None) + + +class Resource(msrest.serialization.Model): + """The 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. + + :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] + """ + + _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}'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs['location'] + self.tags = kwargs.get('tags', None) + + +class AvailabilitySet(Resource): + """Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see `Manage the availability of virtual machines `_. :code:`
`:code:`
` For more information on Azure planned maintenance, see `Planned maintenance for virtual machines in Azure `_ :code:`
`:code:`
` Currently, a VM can only be added to availability set at creation time. An existing VM cannot be added to an availability set. + + 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 sku: Sku of the availability set, only name is required to be set. See + AvailabilitySetSkuTypes for possible set of values. Use 'Aligned' for virtual machines with + managed disks and 'Classic' for virtual machines with unmanaged disks. Default value is + 'Classic'. + :type sku: ~azure.mgmt.compute.v2020_06_01.models.Sku + :param platform_update_domain_count: Update Domain count. + :type platform_update_domain_count: int + :param platform_fault_domain_count: Fault Domain count. + :type platform_fault_domain_count: int + :param virtual_machines: A list of references to all virtual machines in the availability set. + :type virtual_machines: list[~azure.mgmt.compute.v2020_06_01.models.SubResource] + :param proximity_placement_group: Specifies information about the proximity placement group + that the availability set should be assigned to. :code:`
`:code:`
`Minimum api-version: + 2018-04-01. + :type proximity_placement_group: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :ivar statuses: The resource status information. + :vartype statuses: list[~azure.mgmt.compute.v2020_06_01.models.InstanceViewStatus] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'statuses': {'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}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'platform_update_domain_count': {'key': 'properties.platformUpdateDomainCount', 'type': 'int'}, + 'platform_fault_domain_count': {'key': 'properties.platformFaultDomainCount', 'type': 'int'}, + 'virtual_machines': {'key': 'properties.virtualMachines', 'type': '[SubResource]'}, + 'proximity_placement_group': {'key': 'properties.proximityPlacementGroup', 'type': 'SubResource'}, + 'statuses': {'key': 'properties.statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__( + self, + **kwargs + ): + super(AvailabilitySet, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.platform_update_domain_count = kwargs.get('platform_update_domain_count', None) + self.platform_fault_domain_count = kwargs.get('platform_fault_domain_count', None) + self.virtual_machines = kwargs.get('virtual_machines', None) + self.proximity_placement_group = kwargs.get('proximity_placement_group', None) + self.statuses = None + + +class AvailabilitySetListResult(msrest.serialization.Model): + """The List Availability Set operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of availability sets. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.AvailabilitySet] + :param next_link: The URI to fetch the next page of AvailabilitySets. Call ListNext() with this + URI to fetch the next page of AvailabilitySets. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AvailabilitySet]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AvailabilitySetListResult, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class UpdateResource(msrest.serialization.Model): + """The Update Resource model definition. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(UpdateResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class AvailabilitySetUpdate(UpdateResource): + """Specifies information about the availability set that the virtual machine should be assigned to. Only tags may be updated. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param sku: Sku of the availability set. + :type sku: ~azure.mgmt.compute.v2020_06_01.models.Sku + :param platform_update_domain_count: Update Domain count. + :type platform_update_domain_count: int + :param platform_fault_domain_count: Fault Domain count. + :type platform_fault_domain_count: int + :param virtual_machines: A list of references to all virtual machines in the availability set. + :type virtual_machines: list[~azure.mgmt.compute.v2020_06_01.models.SubResource] + :param proximity_placement_group: Specifies information about the proximity placement group + that the availability set should be assigned to. :code:`
`:code:`
`Minimum api-version: + 2018-04-01. + :type proximity_placement_group: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :ivar statuses: The resource status information. + :vartype statuses: list[~azure.mgmt.compute.v2020_06_01.models.InstanceViewStatus] + """ + + _validation = { + 'statuses': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'platform_update_domain_count': {'key': 'properties.platformUpdateDomainCount', 'type': 'int'}, + 'platform_fault_domain_count': {'key': 'properties.platformFaultDomainCount', 'type': 'int'}, + 'virtual_machines': {'key': 'properties.virtualMachines', 'type': '[SubResource]'}, + 'proximity_placement_group': {'key': 'properties.proximityPlacementGroup', 'type': 'SubResource'}, + 'statuses': {'key': 'properties.statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__( + self, + **kwargs + ): + super(AvailabilitySetUpdate, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.platform_update_domain_count = kwargs.get('platform_update_domain_count', None) + self.platform_fault_domain_count = kwargs.get('platform_fault_domain_count', None) + self.virtual_machines = kwargs.get('virtual_machines', None) + self.proximity_placement_group = kwargs.get('proximity_placement_group', None) + self.statuses = None + + +class AvailablePatchSummary(msrest.serialization.Model): + """Describes the properties of an virtual machine instance view for available patch summary. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status: The overall success or failure status of the operation. It remains "InProgress" + until the operation completes. At that point it will become "Failed", "Succeeded", or + "CompletedWithWarnings.". Possible values include: "InProgress", "Failed", "Succeeded", + "CompletedWithWarnings". + :vartype status: str or ~azure.mgmt.compute.v2020_06_01.models.PatchOperationStatus + :ivar assessment_activity_id: The activity ID of the operation that produced this result. It is + used to correlate across CRP and extension logs. + :vartype assessment_activity_id: str + :ivar reboot_pending: The overall reboot status of the VM. It will be true when partially + installed patches require a reboot to complete installation but the reboot has not yet + occurred. + :vartype reboot_pending: bool + :ivar critical_and_security_patch_count: The number of critical or security patches that have + been detected as available and not yet installed. + :vartype critical_and_security_patch_count: int + :ivar other_patch_count: The number of all available patches excluding critical and security. + :vartype other_patch_count: int + :ivar start_time: The UTC timestamp when the operation began. + :vartype start_time: ~datetime.datetime + :ivar last_modified_time: The UTC timestamp when the operation began. + :vartype last_modified_time: ~datetime.datetime + :ivar error: The errors that were encountered during execution of the operation. The details + array contains the list of them. + :vartype error: ~azure.mgmt.compute.v2020_06_01.models.ApiError + """ + + _validation = { + 'status': {'readonly': True}, + 'assessment_activity_id': {'readonly': True}, + 'reboot_pending': {'readonly': True}, + 'critical_and_security_patch_count': {'readonly': True}, + 'other_patch_count': {'readonly': True}, + 'start_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'assessment_activity_id': {'key': 'assessmentActivityId', 'type': 'str'}, + 'reboot_pending': {'key': 'rebootPending', 'type': 'bool'}, + 'critical_and_security_patch_count': {'key': 'criticalAndSecurityPatchCount', 'type': 'int'}, + 'other_patch_count': {'key': 'otherPatchCount', 'type': 'int'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'lastModifiedTime', 'type': 'iso-8601'}, + 'error': {'key': 'error', 'type': 'ApiError'}, + } + + def __init__( + self, + **kwargs + ): + super(AvailablePatchSummary, self).__init__(**kwargs) + self.status = None + self.assessment_activity_id = None + self.reboot_pending = None + self.critical_and_security_patch_count = None + self.other_patch_count = None + self.start_time = None + self.last_modified_time = None + self.error = None + + +class BillingProfile(msrest.serialization.Model): + """Specifies the billing related details of a Azure Spot VM or VMSS. :code:`
`:code:`
`Minimum api-version: 2019-03-01. + + :param max_price: Specifies the maximum price you are willing to pay for a Azure Spot VM/VMSS. + This price is in US Dollars. :code:`
`:code:`
` This price will be compared with the + current Azure Spot price for the VM size. Also, the prices are compared at the time of + create/update of Azure Spot VM/VMSS and the operation will only succeed if the maxPrice is + greater than the current Azure Spot price. :code:`
`:code:`
` The maxPrice will also be + used for evicting a Azure Spot VM/VMSS if the current Azure Spot price goes beyond the maxPrice + after creation of VM/VMSS. :code:`
`:code:`
` Possible values are: + :code:`
`:code:`
` - Any decimal value greater than zero. Example: 0.01538 + :code:`
`:code:`
` -1 – indicates default price to be up-to on-demand. + :code:`
`:code:`
` You can set the maxPrice to -1 to indicate that the Azure Spot VM/VMSS + should not be evicted for price reasons. Also, the default max price is -1 if it is not + provided by you. :code:`
`:code:`
`Minimum api-version: 2019-03-01. + :type max_price: float + """ + + _attribute_map = { + 'max_price': {'key': 'maxPrice', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(BillingProfile, self).__init__(**kwargs) + self.max_price = kwargs.get('max_price', None) + + +class BootDiagnostics(msrest.serialization.Model): + """Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status. :code:`
`:code:`
` You can easily view the output of your console log. :code:`
`:code:`
` Azure also enables you to see a screenshot of the VM from the hypervisor. + + :param enabled: Whether boot diagnostics should be enabled on the Virtual Machine. + :type enabled: bool + :param storage_uri: Uri of the storage account to use for placing the console output and + screenshot. :code:`
`:code:`
`If storageUri is not specified while enabling boot + diagnostics, managed storage will be used. + :type storage_uri: str + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'storage_uri': {'key': 'storageUri', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BootDiagnostics, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.storage_uri = kwargs.get('storage_uri', None) + + +class BootDiagnosticsInstanceView(msrest.serialization.Model): + """The instance view of a virtual machine boot diagnostics. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar console_screenshot_blob_uri: The console screenshot blob URI. + :code:`
`:code:`
`NOTE: This will **not** be set if boot diagnostics is currently enabled + with managed storage. + :vartype console_screenshot_blob_uri: str + :ivar serial_console_log_blob_uri: The serial console log blob Uri. + :code:`
`:code:`
`NOTE: This will **not** be set if boot diagnostics is currently enabled + with managed storage. + :vartype serial_console_log_blob_uri: str + :ivar status: The boot diagnostics status information for the VM. :code:`
`:code:`
` + NOTE: It will be set only if there are errors encountered in enabling boot diagnostics. + :vartype status: ~azure.mgmt.compute.v2020_06_01.models.InstanceViewStatus + """ + + _validation = { + 'console_screenshot_blob_uri': {'readonly': True}, + 'serial_console_log_blob_uri': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'console_screenshot_blob_uri': {'key': 'consoleScreenshotBlobUri', 'type': 'str'}, + 'serial_console_log_blob_uri': {'key': 'serialConsoleLogBlobUri', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'InstanceViewStatus'}, + } + + def __init__( + self, + **kwargs + ): + super(BootDiagnosticsInstanceView, self).__init__(**kwargs) + self.console_screenshot_blob_uri = None + self.serial_console_log_blob_uri = None + self.status = None + + +class Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): + """Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): + """ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class ComputeOperationListResult(msrest.serialization.Model): + """The List Compute Operation operation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of compute operations. + :vartype value: list[~azure.mgmt.compute.v2020_06_01.models.ComputeOperationValue] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ComputeOperationValue]'}, + } + + def __init__( + self, + **kwargs + ): + super(ComputeOperationListResult, self).__init__(**kwargs) + self.value = None + + +class ComputeOperationValue(msrest.serialization.Model): + """Describes the properties of a Compute Operation value. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar origin: The origin of the compute operation. + :vartype origin: str + :ivar name: The name of the compute operation. + :vartype name: str + :ivar operation: The display name of the compute operation. + :vartype operation: str + :ivar resource: The display name of the resource the operation applies to. + :vartype resource: str + :ivar description: The description of the operation. + :vartype description: str + :ivar provider: The resource provider for the operation. + :vartype provider: str + """ + + _validation = { + 'origin': {'readonly': True}, + 'name': {'readonly': True}, + 'operation': {'readonly': True}, + 'resource': {'readonly': True}, + 'description': {'readonly': True}, + 'provider': {'readonly': True}, + } + + _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'operation': {'key': 'display.operation', 'type': 'str'}, + 'resource': {'key': 'display.resource', 'type': 'str'}, + 'description': {'key': 'display.description', 'type': 'str'}, + 'provider': {'key': 'display.provider', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ComputeOperationValue, self).__init__(**kwargs) + self.origin = None + self.name = None + self.operation = None + self.resource = None + self.description = None + self.provider = None + + +class DataDisk(msrest.serialization.Model): + """Describes a data 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 lun: Required. Specifies the logical unit number of the data disk. This value is used to + identify data disks within the VM and therefore must be unique for each data disk attached to a + VM. + :type lun: int + :param name: The disk name. + :type name: str + :param vhd: The virtual hard disk. + :type vhd: ~azure.mgmt.compute.v2020_06_01.models.VirtualHardDisk + :param image: The source user image virtual hard disk. The virtual hard disk will be copied + before being attached to the virtual machine. If SourceImage is provided, the destination + virtual hard drive must not exist. + :type image: ~azure.mgmt.compute.v2020_06_01.models.VirtualHardDisk + :param caching: Specifies the caching requirements. :code:`
`:code:`
` Possible values + are: :code:`
`:code:`
` **None** :code:`
`:code:`
` **ReadOnly** + :code:`
`:code:`
` **ReadWrite** :code:`
`:code:`
` Default: **None for Standard + storage. ReadOnly for Premium storage**. Possible values include: "None", "ReadOnly", + "ReadWrite". + :type caching: str or ~azure.mgmt.compute.v2020_06_01.models.CachingTypes + :param write_accelerator_enabled: Specifies whether writeAccelerator should be enabled or + disabled on the disk. + :type write_accelerator_enabled: bool + :param create_option: Required. Specifies how the virtual machine should be + created.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` **Attach** \u2013 + This value is used when you are using a specialized disk to create the virtual + machine.:code:`
`:code:`
` **FromImage** \u2013 This value is used when you are using an + image to create the virtual machine. If you are using a platform image, you also use the + imageReference element described above. If you are using a marketplace image, you also use the + plan element previously described. Possible values include: "FromImage", "Empty", "Attach". + :type create_option: str or ~azure.mgmt.compute.v2020_06_01.models.DiskCreateOptionTypes + :param disk_size_gb: Specifies the size of an empty data disk in gigabytes. This element can be + used to overwrite the size of the disk in a virtual machine image. :code:`
`:code:`
` + This value cannot be larger than 1023 GB. + :type disk_size_gb: int + :param managed_disk: The managed disk parameters. + :type managed_disk: ~azure.mgmt.compute.v2020_06_01.models.ManagedDiskParameters + :param to_be_detached: Specifies whether the data disk is in process of detachment from the + VirtualMachine/VirtualMachineScaleset. + :type to_be_detached: bool + :ivar disk_iops_read_write: Specifies the Read-Write IOPS for the managed disk when + StorageAccountType is UltraSSD_LRS. Returned only for VirtualMachine ScaleSet VM disks. Can be + updated only via updates to the VirtualMachine Scale Set. + :vartype disk_iops_read_write: long + :ivar disk_m_bps_read_write: Specifies the bandwidth in MB per second for the managed disk when + StorageAccountType is UltraSSD_LRS. Returned only for VirtualMachine ScaleSet VM disks. Can be + updated only via updates to the VirtualMachine Scale Set. + :vartype disk_m_bps_read_write: long + """ + + _validation = { + 'lun': {'required': True}, + 'create_option': {'required': True}, + 'disk_iops_read_write': {'readonly': True}, + 'disk_m_bps_read_write': {'readonly': True}, + } + + _attribute_map = { + 'lun': {'key': 'lun', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'vhd': {'key': 'vhd', 'type': 'VirtualHardDisk'}, + 'image': {'key': 'image', 'type': 'VirtualHardDisk'}, + 'caching': {'key': 'caching', 'type': 'str'}, + 'write_accelerator_enabled': {'key': 'writeAcceleratorEnabled', 'type': 'bool'}, + 'create_option': {'key': 'createOption', 'type': 'str'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + 'managed_disk': {'key': 'managedDisk', 'type': 'ManagedDiskParameters'}, + 'to_be_detached': {'key': 'toBeDetached', 'type': 'bool'}, + 'disk_iops_read_write': {'key': 'diskIOPSReadWrite', 'type': 'long'}, + 'disk_m_bps_read_write': {'key': 'diskMBpsReadWrite', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(DataDisk, self).__init__(**kwargs) + self.lun = kwargs['lun'] + self.name = kwargs.get('name', None) + self.vhd = kwargs.get('vhd', None) + self.image = kwargs.get('image', None) + self.caching = kwargs.get('caching', None) + self.write_accelerator_enabled = kwargs.get('write_accelerator_enabled', None) + self.create_option = kwargs['create_option'] + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.managed_disk = kwargs.get('managed_disk', None) + self.to_be_detached = kwargs.get('to_be_detached', None) + self.disk_iops_read_write = None + self.disk_m_bps_read_write = None + + +class DataDiskImage(msrest.serialization.Model): + """Contains the data disk images information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar lun: Specifies the logical unit number of the data disk. This value is used to identify + data disks within the VM and therefore must be unique for each data disk attached to a VM. + :vartype lun: int + """ + + _validation = { + 'lun': {'readonly': True}, + } + + _attribute_map = { + 'lun': {'key': 'lun', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(DataDiskImage, self).__init__(**kwargs) + self.lun = None + + +class DedicatedHost(Resource): + """Specifies information about the Dedicated host. + + 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 sku: Required. SKU of the dedicated host for Hardware Generation and VM family. Only + name is required to be set. List Microsoft.Compute SKUs for a list of possible values. + :type sku: ~azure.mgmt.compute.v2020_06_01.models.Sku + :param platform_fault_domain: Fault domain of the dedicated host within a dedicated host group. + :type platform_fault_domain: int + :param auto_replace_on_failure: Specifies whether the dedicated host should be replaced + automatically in case of a failure. The value is defaulted to 'true' when not provided. + :type auto_replace_on_failure: bool + :ivar host_id: A unique id generated and assigned to the dedicated host by the platform. + :code:`
`:code:`
` Does not change throughout the lifetime of the host. + :vartype host_id: str + :ivar virtual_machines: A list of references to all virtual machines in the Dedicated Host. + :vartype virtual_machines: list[~azure.mgmt.compute.v2020_06_01.models.SubResourceReadOnly] + :param license_type: Specifies the software license type that will be applied to the VMs + deployed on the dedicated host. :code:`
`:code:`
` Possible values are: + :code:`
`:code:`
` **None** :code:`
`:code:`
` **Windows_Server_Hybrid** + :code:`
`:code:`
` **Windows_Server_Perpetual** :code:`
`:code:`
` Default: + **None**. Possible values include: "None", "Windows_Server_Hybrid", "Windows_Server_Perpetual". + :type license_type: str or ~azure.mgmt.compute.v2020_06_01.models.DedicatedHostLicenseTypes + :ivar provisioning_time: The date when the host was first provisioned. + :vartype provisioning_time: ~datetime.datetime + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :ivar instance_view: The dedicated host instance view. + :vartype instance_view: ~azure.mgmt.compute.v2020_06_01.models.DedicatedHostInstanceView + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'required': True}, + 'platform_fault_domain': {'maximum': 2, 'minimum': 0}, + 'host_id': {'readonly': True}, + 'virtual_machines': {'readonly': True}, + 'provisioning_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'instance_view': {'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}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'platform_fault_domain': {'key': 'properties.platformFaultDomain', 'type': 'int'}, + 'auto_replace_on_failure': {'key': 'properties.autoReplaceOnFailure', 'type': 'bool'}, + 'host_id': {'key': 'properties.hostId', 'type': 'str'}, + 'virtual_machines': {'key': 'properties.virtualMachines', 'type': '[SubResourceReadOnly]'}, + 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, + 'provisioning_time': {'key': 'properties.provisioningTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'DedicatedHostInstanceView'}, + } + + def __init__( + self, + **kwargs + ): + super(DedicatedHost, self).__init__(**kwargs) + self.sku = kwargs['sku'] + self.platform_fault_domain = kwargs.get('platform_fault_domain', None) + self.auto_replace_on_failure = kwargs.get('auto_replace_on_failure', None) + self.host_id = None + self.virtual_machines = None + self.license_type = kwargs.get('license_type', None) + self.provisioning_time = None + self.provisioning_state = None + self.instance_view = None + + +class DedicatedHostAllocatableVM(msrest.serialization.Model): + """Represents the dedicated host unutilized capacity in terms of a specific VM size. + + :param vm_size: VM size in terms of which the unutilized capacity is represented. + :type vm_size: str + :param count: Maximum number of VMs of size vmSize that can fit in the dedicated host's + remaining capacity. + :type count: float + """ + + _attribute_map = { + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(DedicatedHostAllocatableVM, self).__init__(**kwargs) + self.vm_size = kwargs.get('vm_size', None) + self.count = kwargs.get('count', None) + + +class DedicatedHostAvailableCapacity(msrest.serialization.Model): + """Dedicated host unutilized capacity. + + :param allocatable_v_ms: The unutilized capacity of the dedicated host represented in terms of + each VM size that is allowed to be deployed to the dedicated host. + :type allocatable_v_ms: list[~azure.mgmt.compute.v2020_06_01.models.DedicatedHostAllocatableVM] + """ + + _attribute_map = { + 'allocatable_v_ms': {'key': 'allocatableVMs', 'type': '[DedicatedHostAllocatableVM]'}, + } + + def __init__( + self, + **kwargs + ): + super(DedicatedHostAvailableCapacity, self).__init__(**kwargs) + self.allocatable_v_ms = kwargs.get('allocatable_v_ms', None) + + +class DedicatedHostGroup(Resource): + """Specifies information about the dedicated host group that the dedicated hosts should be assigned to. :code:`
`:code:`
` Currently, a dedicated host can only be added to a dedicated host group at creation time. An existing dedicated host cannot be added to another dedicated host group. + + 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 zones: Availability Zone to use for this host group. Only single zone is supported. The + zone can be assigned only during creation. If not provided, the group supports all zones in the + region. If provided, enforces each host in the group to be in the same zone. + :type zones: list[str] + :param platform_fault_domain_count: Number of fault domains that the host group can span. + :type platform_fault_domain_count: int + :ivar hosts: A list of references to all dedicated hosts in the dedicated host group. + :vartype hosts: list[~azure.mgmt.compute.v2020_06_01.models.SubResourceReadOnly] + :ivar instance_view: The dedicated host group instance view, which has the list of instance + view of the dedicated hosts under the dedicated host group. + :vartype instance_view: ~azure.mgmt.compute.v2020_06_01.models.DedicatedHostGroupInstanceView + :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. + :type support_automatic_placement: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'platform_fault_domain_count': {'maximum': 3, 'minimum': 1}, + 'hosts': {'readonly': True}, + 'instance_view': {'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}'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'platform_fault_domain_count': {'key': 'properties.platformFaultDomainCount', 'type': 'int'}, + 'hosts': {'key': 'properties.hosts', 'type': '[SubResourceReadOnly]'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'DedicatedHostGroupInstanceView'}, + 'support_automatic_placement': {'key': 'properties.supportAutomaticPlacement', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(DedicatedHostGroup, self).__init__(**kwargs) + self.zones = kwargs.get('zones', None) + self.platform_fault_domain_count = kwargs.get('platform_fault_domain_count', None) + self.hosts = None + self.instance_view = None + self.support_automatic_placement = kwargs.get('support_automatic_placement', None) + + +class DedicatedHostGroupInstanceView(msrest.serialization.Model): + """DedicatedHostGroupInstanceView. + + :param hosts: List of instance view of the dedicated hosts under the dedicated host group. + :type hosts: list[~azure.mgmt.compute.v2020_06_01.models.DedicatedHostInstanceViewWithName] + """ + + _attribute_map = { + 'hosts': {'key': 'hosts', 'type': '[DedicatedHostInstanceViewWithName]'}, + } + + def __init__( + self, + **kwargs + ): + super(DedicatedHostGroupInstanceView, self).__init__(**kwargs) + self.hosts = kwargs.get('hosts', None) + + +class DedicatedHostGroupListResult(msrest.serialization.Model): + """The List Dedicated Host Group with resource group response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of dedicated host groups. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.DedicatedHostGroup] + :param next_link: The URI to fetch the next page of Dedicated Host Groups. Call ListNext() with + this URI to fetch the next page of Dedicated Host Groups. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DedicatedHostGroup]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DedicatedHostGroupListResult, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class DedicatedHostGroupUpdate(UpdateResource): + """Specifies information about the dedicated host group that the dedicated host should be assigned to. Only tags may be updated. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param zones: Availability Zone to use for this host group. Only single zone is supported. The + zone can be assigned only during creation. If not provided, the group supports all zones in the + region. If provided, enforces each host in the group to be in the same zone. + :type zones: list[str] + :param platform_fault_domain_count: Number of fault domains that the host group can span. + :type platform_fault_domain_count: int + :ivar hosts: A list of references to all dedicated hosts in the dedicated host group. + :vartype hosts: list[~azure.mgmt.compute.v2020_06_01.models.SubResourceReadOnly] + :ivar instance_view: The dedicated host group instance view, which has the list of instance + view of the dedicated hosts under the dedicated host group. + :vartype instance_view: ~azure.mgmt.compute.v2020_06_01.models.DedicatedHostGroupInstanceView + :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. + :type support_automatic_placement: bool + """ + + _validation = { + 'platform_fault_domain_count': {'maximum': 3, 'minimum': 1}, + 'hosts': {'readonly': True}, + 'instance_view': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'platform_fault_domain_count': {'key': 'properties.platformFaultDomainCount', 'type': 'int'}, + 'hosts': {'key': 'properties.hosts', 'type': '[SubResourceReadOnly]'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'DedicatedHostGroupInstanceView'}, + 'support_automatic_placement': {'key': 'properties.supportAutomaticPlacement', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(DedicatedHostGroupUpdate, self).__init__(**kwargs) + self.zones = kwargs.get('zones', None) + self.platform_fault_domain_count = kwargs.get('platform_fault_domain_count', None) + self.hosts = None + self.instance_view = None + self.support_automatic_placement = kwargs.get('support_automatic_placement', None) + + +class DedicatedHostInstanceView(msrest.serialization.Model): + """The instance view of a dedicated host. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar asset_id: Specifies the unique id of the dedicated physical machine on which the + dedicated host resides. + :vartype asset_id: str + :param available_capacity: Unutilized capacity of the dedicated host. + :type available_capacity: ~azure.mgmt.compute.v2020_06_01.models.DedicatedHostAvailableCapacity + :param statuses: The resource status information. + :type statuses: list[~azure.mgmt.compute.v2020_06_01.models.InstanceViewStatus] + """ + + _validation = { + 'asset_id': {'readonly': True}, + } + + _attribute_map = { + 'asset_id': {'key': 'assetId', 'type': 'str'}, + 'available_capacity': {'key': 'availableCapacity', 'type': 'DedicatedHostAvailableCapacity'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__( + self, + **kwargs + ): + super(DedicatedHostInstanceView, self).__init__(**kwargs) + self.asset_id = None + self.available_capacity = kwargs.get('available_capacity', None) + self.statuses = kwargs.get('statuses', None) + + +class DedicatedHostInstanceViewWithName(DedicatedHostInstanceView): + """The instance view of a dedicated host that includes the name of the dedicated host. It is used for the response to the instance view of a dedicated host group. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar asset_id: Specifies the unique id of the dedicated physical machine on which the + dedicated host resides. + :vartype asset_id: str + :param available_capacity: Unutilized capacity of the dedicated host. + :type available_capacity: ~azure.mgmt.compute.v2020_06_01.models.DedicatedHostAvailableCapacity + :param statuses: The resource status information. + :type statuses: list[~azure.mgmt.compute.v2020_06_01.models.InstanceViewStatus] + :ivar name: The name of the dedicated host. + :vartype name: str + """ + + _validation = { + 'asset_id': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'asset_id': {'key': 'assetId', 'type': 'str'}, + 'available_capacity': {'key': 'availableCapacity', 'type': 'DedicatedHostAvailableCapacity'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DedicatedHostInstanceViewWithName, self).__init__(**kwargs) + self.name = None + + +class DedicatedHostListResult(msrest.serialization.Model): + """The list dedicated host operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of dedicated hosts. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.DedicatedHost] + :param next_link: The URI to fetch the next page of dedicated hosts. Call ListNext() with this + URI to fetch the next page of dedicated hosts. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DedicatedHost]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DedicatedHostListResult, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class DedicatedHostUpdate(UpdateResource): + """Specifies information about the dedicated host. Only tags, autoReplaceOnFailure and licenseType may be updated. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param platform_fault_domain: Fault domain of the dedicated host within a dedicated host group. + :type platform_fault_domain: int + :param auto_replace_on_failure: Specifies whether the dedicated host should be replaced + automatically in case of a failure. The value is defaulted to 'true' when not provided. + :type auto_replace_on_failure: bool + :ivar host_id: A unique id generated and assigned to the dedicated host by the platform. + :code:`
`:code:`
` Does not change throughout the lifetime of the host. + :vartype host_id: str + :ivar virtual_machines: A list of references to all virtual machines in the Dedicated Host. + :vartype virtual_machines: list[~azure.mgmt.compute.v2020_06_01.models.SubResourceReadOnly] + :param license_type: Specifies the software license type that will be applied to the VMs + deployed on the dedicated host. :code:`
`:code:`
` Possible values are: + :code:`
`:code:`
` **None** :code:`
`:code:`
` **Windows_Server_Hybrid** + :code:`
`:code:`
` **Windows_Server_Perpetual** :code:`
`:code:`
` Default: + **None**. Possible values include: "None", "Windows_Server_Hybrid", "Windows_Server_Perpetual". + :type license_type: str or ~azure.mgmt.compute.v2020_06_01.models.DedicatedHostLicenseTypes + :ivar provisioning_time: The date when the host was first provisioned. + :vartype provisioning_time: ~datetime.datetime + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :ivar instance_view: The dedicated host instance view. + :vartype instance_view: ~azure.mgmt.compute.v2020_06_01.models.DedicatedHostInstanceView + """ + + _validation = { + 'platform_fault_domain': {'maximum': 2, 'minimum': 0}, + 'host_id': {'readonly': True}, + 'virtual_machines': {'readonly': True}, + 'provisioning_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'instance_view': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'platform_fault_domain': {'key': 'properties.platformFaultDomain', 'type': 'int'}, + 'auto_replace_on_failure': {'key': 'properties.autoReplaceOnFailure', 'type': 'bool'}, + 'host_id': {'key': 'properties.hostId', 'type': 'str'}, + 'virtual_machines': {'key': 'properties.virtualMachines', 'type': '[SubResourceReadOnly]'}, + 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, + 'provisioning_time': {'key': 'properties.provisioningTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'DedicatedHostInstanceView'}, + } + + def __init__( + self, + **kwargs + ): + super(DedicatedHostUpdate, self).__init__(**kwargs) + self.platform_fault_domain = kwargs.get('platform_fault_domain', None) + self.auto_replace_on_failure = kwargs.get('auto_replace_on_failure', None) + self.host_id = None + self.virtual_machines = None + self.license_type = kwargs.get('license_type', None) + self.provisioning_time = None + self.provisioning_state = None + self.instance_view = None + + +class DiagnosticsProfile(msrest.serialization.Model): + """Specifies the boot diagnostic settings state. :code:`
`:code:`
`Minimum api-version: 2015-06-15. + + :param boot_diagnostics: Boot Diagnostics is a debugging feature which allows you to view + Console Output and Screenshot to diagnose VM status. :code:`
`:code:`
` You can easily + view the output of your console log. :code:`
`:code:`
` Azure also enables you to see a + screenshot of the VM from the hypervisor. + :type boot_diagnostics: ~azure.mgmt.compute.v2020_06_01.models.BootDiagnostics + """ + + _attribute_map = { + 'boot_diagnostics': {'key': 'bootDiagnostics', 'type': 'BootDiagnostics'}, + } + + def __init__( + self, + **kwargs + ): + super(DiagnosticsProfile, self).__init__(**kwargs) + self.boot_diagnostics = kwargs.get('boot_diagnostics', None) + + +class DiffDiskSettings(msrest.serialization.Model): + """Describes the parameters of ephemeral disk settings that can be specified for operating system disk. :code:`
`:code:`
` NOTE: The ephemeral disk settings can only be specified for managed disk. + + :param option: Specifies the ephemeral disk settings for operating system disk. Possible values + include: "Local". + :type option: str or ~azure.mgmt.compute.v2020_06_01.models.DiffDiskOptions + :param placement: Specifies the ephemeral disk placement for operating system + disk.:code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **CacheDisk** + :code:`
`:code:`
` **ResourceDisk** :code:`
`:code:`
` Default: **CacheDisk** if + one is configured for the VM size otherwise **ResourceDisk** is used.:code:`
`:code:`
` + Refer to VM size documentation for Windows VM at https://docs.microsoft.com/en- + us/azure/virtual-machines/windows/sizes and Linux VM at https://docs.microsoft.com/en- + us/azure/virtual-machines/linux/sizes to check which VM sizes exposes a cache disk. Possible + values include: "CacheDisk", "ResourceDisk". + :type placement: str or ~azure.mgmt.compute.v2020_06_01.models.DiffDiskPlacement + """ + + _attribute_map = { + 'option': {'key': 'option', 'type': 'str'}, + 'placement': {'key': 'placement', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DiffDiskSettings, self).__init__(**kwargs) + self.option = kwargs.get('option', None) + self.placement = kwargs.get('placement', None) + + +class DisallowedConfiguration(msrest.serialization.Model): + """Specifies the disallowed configuration for a virtual machine image. + + :param vm_disk_type: VM disk types which are disallowed. Possible values include: "None", + "Unmanaged". + :type vm_disk_type: str or ~azure.mgmt.compute.v2020_06_01.models.VmDiskTypes + """ + + _attribute_map = { + 'vm_disk_type': {'key': 'vmDiskType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DisallowedConfiguration, self).__init__(**kwargs) + self.vm_disk_type = kwargs.get('vm_disk_type', None) + + +class SubResource(msrest.serialization.Model): + """SubResource. + + :param id: Resource Id. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SubResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class DiskEncryptionSetParameters(SubResource): + """Describes the parameter of customer managed disk encryption set resource id that can be specified for disk. :code:`
`:code:`
` NOTE: The disk encryption set resource id can only be specified for managed disk. Please refer https://aka.ms/mdssewithcmkoverview for more details. + + :param id: Resource Id. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DiskEncryptionSetParameters, self).__init__(**kwargs) + + +class DiskEncryptionSettings(msrest.serialization.Model): + """Describes a Encryption Settings for a Disk. + + :param disk_encryption_key: Specifies the location of the disk encryption key, which is a Key + Vault Secret. + :type disk_encryption_key: ~azure.mgmt.compute.v2020_06_01.models.KeyVaultSecretReference + :param key_encryption_key: Specifies the location of the key encryption key in Key Vault. + :type key_encryption_key: ~azure.mgmt.compute.v2020_06_01.models.KeyVaultKeyReference + :param enabled: Specifies whether disk encryption should be enabled on the virtual machine. + :type enabled: bool + """ + + _attribute_map = { + 'disk_encryption_key': {'key': 'diskEncryptionKey', 'type': 'KeyVaultSecretReference'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyVaultKeyReference'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(DiskEncryptionSettings, self).__init__(**kwargs) + self.disk_encryption_key = kwargs.get('disk_encryption_key', None) + self.key_encryption_key = kwargs.get('key_encryption_key', None) + self.enabled = kwargs.get('enabled', None) + + +class DiskInstanceView(msrest.serialization.Model): + """The instance view of the disk. + + :param name: The disk name. + :type name: str + :param encryption_settings: Specifies the encryption settings for the OS Disk. + :code:`
`:code:`
` Minimum api-version: 2015-06-15. + :type encryption_settings: list[~azure.mgmt.compute.v2020_06_01.models.DiskEncryptionSettings] + :param statuses: The resource status information. + :type statuses: list[~azure.mgmt.compute.v2020_06_01.models.InstanceViewStatus] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'encryption_settings': {'key': 'encryptionSettings', 'type': '[DiskEncryptionSettings]'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__( + self, + **kwargs + ): + super(DiskInstanceView, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.encryption_settings = kwargs.get('encryption_settings', None) + self.statuses = kwargs.get('statuses', None) + + +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 + `_ + :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", + "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", + "Standard_DS14", "Standard_DS1_v2", "Standard_DS2_v2", "Standard_DS3_v2", "Standard_DS4_v2", + "Standard_DS5_v2", "Standard_DS11_v2", "Standard_DS12_v2", "Standard_DS13_v2", + "Standard_DS14_v2", "Standard_DS15_v2", "Standard_DS13-4_v2", "Standard_DS13-2_v2", + "Standard_DS14-8_v2", "Standard_DS14-4_v2", "Standard_E2_v3", "Standard_E4_v3", + "Standard_E8_v3", "Standard_E16_v3", "Standard_E32_v3", "Standard_E64_v3", "Standard_E2s_v3", + "Standard_E4s_v3", "Standard_E8s_v3", "Standard_E16s_v3", "Standard_E32s_v3", + "Standard_E64s_v3", "Standard_E32-16_v3", "Standard_E32-8s_v3", "Standard_E64-32s_v3", + "Standard_E64-16s_v3", "Standard_F1", "Standard_F2", "Standard_F4", "Standard_F8", + "Standard_F16", "Standard_F1s", "Standard_F2s", "Standard_F4s", "Standard_F8s", + "Standard_F16s", "Standard_F2s_v2", "Standard_F4s_v2", "Standard_F8s_v2", "Standard_F16s_v2", + "Standard_F32s_v2", "Standard_F64s_v2", "Standard_F72s_v2", "Standard_G1", "Standard_G2", + "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", "Standard_GS3", + "Standard_GS4", "Standard_GS5", "Standard_GS4-8", "Standard_GS4-4", "Standard_GS5-16", + "Standard_GS5-8", "Standard_H8", "Standard_H16", "Standard_H8m", "Standard_H16m", + "Standard_H16r", "Standard_H16mr", "Standard_L4s", "Standard_L8s", "Standard_L16s", + "Standard_L32s", "Standard_M64s", "Standard_M64ms", "Standard_M128s", "Standard_M128ms", + "Standard_M64-32ms", "Standard_M64-16ms", "Standard_M128-64ms", "Standard_M128-32ms", + "Standard_NC6", "Standard_NC12", "Standard_NC24", "Standard_NC24r", "Standard_NC6s_v2", + "Standard_NC12s_v2", "Standard_NC24s_v2", "Standard_NC24rs_v2", "Standard_NC6s_v3", + "Standard_NC12s_v3", "Standard_NC24s_v3", "Standard_NC24rs_v3", "Standard_ND6s", + "Standard_ND12s", "Standard_ND24s", "Standard_ND24rs", "Standard_NV6", "Standard_NV12", + "Standard_NV24". + :type vm_size: str or ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineSizeTypes + """ + + _attribute_map = { + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HardwareProfile, self).__init__(**kwargs) + self.vm_size = kwargs.get('vm_size', None) + + +class Image(Resource): + """The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist. + + 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 source_virtual_machine: The source virtual machine from which Image is created. + :type source_virtual_machine: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param storage_profile: Specifies the storage settings for the virtual machine disks. + :type storage_profile: ~azure.mgmt.compute.v2020_06_01.models.ImageStorageProfile + :ivar provisioning_state: The provisioning state. + :vartype provisioning_state: str + :param hyper_v_generation: Gets the HyperVGenerationType of the VirtualMachine created from the + image. Possible values include: "V1", "V2". + :type hyper_v_generation: str or ~azure.mgmt.compute.v2020_06_01.models.HyperVGenerationTypes + """ + + _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}'}, + 'source_virtual_machine': {'key': 'properties.sourceVirtualMachine', 'type': 'SubResource'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'ImageStorageProfile'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Image, self).__init__(**kwargs) + self.source_virtual_machine = kwargs.get('source_virtual_machine', None) + self.storage_profile = kwargs.get('storage_profile', None) + self.provisioning_state = None + self.hyper_v_generation = kwargs.get('hyper_v_generation', None) + + +class ImageDisk(msrest.serialization.Model): + """Describes a image disk. + + :param snapshot: The snapshot. + :type snapshot: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param managed_disk: The managedDisk. + :type managed_disk: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param blob_uri: The Virtual Hard Disk. + :type blob_uri: str + :param caching: Specifies the caching requirements. :code:`
`:code:`
` Possible values + are: :code:`
`:code:`
` **None** :code:`
`:code:`
` **ReadOnly** + :code:`
`:code:`
` **ReadWrite** :code:`
`:code:`
` Default: **None for Standard + storage. ReadOnly for Premium storage**. Possible values include: "None", "ReadOnly", + "ReadWrite". + :type caching: str or ~azure.mgmt.compute.v2020_06_01.models.CachingTypes + :param disk_size_gb: Specifies the size of empty data disks in gigabytes. This element can be + used to overwrite the name of the disk in a virtual machine image. :code:`
`:code:`
` + This value cannot be larger than 1023 GB. + :type disk_size_gb: int + :param storage_account_type: Specifies the storage account type for the managed disk. NOTE: + UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values + include: "Standard_LRS", "Premium_LRS", "StandardSSD_LRS", "UltraSSD_LRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2020_06_01.models.StorageAccountTypes + :param disk_encryption_set: Specifies the customer managed disk encryption set resource id for + the managed image disk. + :type disk_encryption_set: ~azure.mgmt.compute.v2020_06_01.models.SubResource + """ + + _attribute_map = { + 'snapshot': {'key': 'snapshot', 'type': 'SubResource'}, + 'managed_disk': {'key': 'managedDisk', 'type': 'SubResource'}, + 'blob_uri': {'key': 'blobUri', 'type': 'str'}, + 'caching': {'key': 'caching', 'type': 'str'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'disk_encryption_set': {'key': 'diskEncryptionSet', 'type': 'SubResource'}, + } + + def __init__( + self, + **kwargs + ): + super(ImageDisk, self).__init__(**kwargs) + self.snapshot = kwargs.get('snapshot', None) + self.managed_disk = kwargs.get('managed_disk', None) + self.blob_uri = kwargs.get('blob_uri', None) + self.caching = kwargs.get('caching', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.storage_account_type = kwargs.get('storage_account_type', None) + self.disk_encryption_set = kwargs.get('disk_encryption_set', None) + + +class ImageDataDisk(ImageDisk): + """Describes a data disk. + + All required parameters must be populated in order to send to Azure. + + :param snapshot: The snapshot. + :type snapshot: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param managed_disk: The managedDisk. + :type managed_disk: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param blob_uri: The Virtual Hard Disk. + :type blob_uri: str + :param caching: Specifies the caching requirements. :code:`
`:code:`
` Possible values + are: :code:`
`:code:`
` **None** :code:`
`:code:`
` **ReadOnly** + :code:`
`:code:`
` **ReadWrite** :code:`
`:code:`
` Default: **None for Standard + storage. ReadOnly for Premium storage**. Possible values include: "None", "ReadOnly", + "ReadWrite". + :type caching: str or ~azure.mgmt.compute.v2020_06_01.models.CachingTypes + :param disk_size_gb: Specifies the size of empty data disks in gigabytes. This element can be + used to overwrite the name of the disk in a virtual machine image. :code:`
`:code:`
` + This value cannot be larger than 1023 GB. + :type disk_size_gb: int + :param storage_account_type: Specifies the storage account type for the managed disk. NOTE: + UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values + include: "Standard_LRS", "Premium_LRS", "StandardSSD_LRS", "UltraSSD_LRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2020_06_01.models.StorageAccountTypes + :param disk_encryption_set: Specifies the customer managed disk encryption set resource id for + the managed image disk. + :type disk_encryption_set: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param lun: Required. Specifies the logical unit number of the data disk. This value is used to + identify data disks within the VM and therefore must be unique for each data disk attached to a + VM. + :type lun: int + """ + + _validation = { + 'lun': {'required': True}, + } + + _attribute_map = { + 'snapshot': {'key': 'snapshot', 'type': 'SubResource'}, + 'managed_disk': {'key': 'managedDisk', 'type': 'SubResource'}, + 'blob_uri': {'key': 'blobUri', 'type': 'str'}, + 'caching': {'key': 'caching', 'type': 'str'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'disk_encryption_set': {'key': 'diskEncryptionSet', 'type': 'SubResource'}, + 'lun': {'key': 'lun', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(ImageDataDisk, self).__init__(**kwargs) + self.lun = kwargs['lun'] + + +class ImageListResult(msrest.serialization.Model): + """The List Image operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of Images. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.Image] + :param next_link: The uri to fetch the next page of Images. Call ListNext() with this to fetch + the next page of Images. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Image]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ImageListResult, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class ImageOSDisk(ImageDisk): + """Describes an Operating System disk. + + All required parameters must be populated in order to send to Azure. + + :param snapshot: The snapshot. + :type snapshot: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param managed_disk: The managedDisk. + :type managed_disk: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param blob_uri: The Virtual Hard Disk. + :type blob_uri: str + :param caching: Specifies the caching requirements. :code:`
`:code:`
` Possible values + are: :code:`
`:code:`
` **None** :code:`
`:code:`
` **ReadOnly** + :code:`
`:code:`
` **ReadWrite** :code:`
`:code:`
` Default: **None for Standard + storage. ReadOnly for Premium storage**. Possible values include: "None", "ReadOnly", + "ReadWrite". + :type caching: str or ~azure.mgmt.compute.v2020_06_01.models.CachingTypes + :param disk_size_gb: Specifies the size of empty data disks in gigabytes. This element can be + used to overwrite the name of the disk in a virtual machine image. :code:`
`:code:`
` + This value cannot be larger than 1023 GB. + :type disk_size_gb: int + :param storage_account_type: Specifies the storage account type for the managed disk. NOTE: + UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values + include: "Standard_LRS", "Premium_LRS", "StandardSSD_LRS", "UltraSSD_LRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2020_06_01.models.StorageAccountTypes + :param disk_encryption_set: Specifies the customer managed disk encryption set resource id for + the managed image disk. + :type disk_encryption_set: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param os_type: Required. This property allows you to specify the type of the OS that is + included in the disk if creating a VM from a custom 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_06_01.models.OperatingSystemTypes + :param os_state: Required. The OS State. Possible values include: "Generalized", "Specialized". + :type os_state: str or ~azure.mgmt.compute.v2020_06_01.models.OperatingSystemStateTypes + """ + + _validation = { + 'os_type': {'required': True}, + 'os_state': {'required': True}, + } + + _attribute_map = { + 'snapshot': {'key': 'snapshot', 'type': 'SubResource'}, + 'managed_disk': {'key': 'managedDisk', 'type': 'SubResource'}, + 'blob_uri': {'key': 'blobUri', 'type': 'str'}, + 'caching': {'key': 'caching', 'type': 'str'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'disk_encryption_set': {'key': 'diskEncryptionSet', 'type': 'SubResource'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'os_state': {'key': 'osState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ImageOSDisk, self).__init__(**kwargs) + self.os_type = kwargs['os_type'] + self.os_state = kwargs['os_state'] + + +class ImageReference(SubResource): + """Specifies information about the image to use. You can specify information about platform images, marketplace images, or virtual machine images. This element is required when you want to use a platform image, marketplace image, or virtual machine image, but is not used in other creation operations. NOTE: Image reference publisher and offer can only be set when you create the scale set. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource Id. + :type id: str + :param publisher: The image publisher. + :type publisher: str + :param offer: Specifies the offer of the platform image or marketplace image used to create the + virtual machine. + :type offer: str + :param sku: The image SKU. + :type sku: str + :param version: Specifies the version of the platform image or marketplace image used to create + the virtual machine. The allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and + Build are decimal numbers. Specify 'latest' to use the latest version of an image available at + deploy time. Even if you use 'latest', the VM image will not automatically update after deploy + time even if a new version becomes available. + :type version: str + :ivar exact_version: Specifies in decimal numbers, the version of platform image or marketplace + image used to create the virtual machine. This readonly field differs from 'version', only if + the value specified in 'version' field is 'latest'. + :vartype exact_version: str + """ + + _validation = { + 'exact_version': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'offer': {'key': 'offer', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'exact_version': {'key': 'exactVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ImageReference, self).__init__(**kwargs) + self.publisher = kwargs.get('publisher', None) + self.offer = kwargs.get('offer', None) + self.sku = kwargs.get('sku', None) + self.version = kwargs.get('version', None) + self.exact_version = None + + +class ImageStorageProfile(msrest.serialization.Model): + """Describes a storage profile. + + :param os_disk: Specifies information about the operating system disk used by the virtual + machine. :code:`
`:code:`
` For more information about disks, see `About disks and VHDs + for Azure virtual machines `_. + :type os_disk: ~azure.mgmt.compute.v2020_06_01.models.ImageOSDisk + :param data_disks: Specifies the parameters that are used to add a data disk to a virtual + machine. :code:`
`:code:`
` For more information about disks, see `About disks and VHDs + for Azure virtual machines `_. + :type data_disks: list[~azure.mgmt.compute.v2020_06_01.models.ImageDataDisk] + :param zone_resilient: Specifies whether an image is zone resilient or not. Default is false. + Zone resilient images can be created only in regions that provide Zone Redundant Storage (ZRS). + :type zone_resilient: bool + """ + + _attribute_map = { + 'os_disk': {'key': 'osDisk', 'type': 'ImageOSDisk'}, + 'data_disks': {'key': 'dataDisks', 'type': '[ImageDataDisk]'}, + 'zone_resilient': {'key': 'zoneResilient', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ImageStorageProfile, self).__init__(**kwargs) + self.os_disk = kwargs.get('os_disk', None) + self.data_disks = kwargs.get('data_disks', None) + self.zone_resilient = kwargs.get('zone_resilient', None) + + +class ImageUpdate(UpdateResource): + """The source user image virtual hard disk. Only tags may be updated. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param source_virtual_machine: The source virtual machine from which Image is created. + :type source_virtual_machine: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param storage_profile: Specifies the storage settings for the virtual machine disks. + :type storage_profile: ~azure.mgmt.compute.v2020_06_01.models.ImageStorageProfile + :ivar provisioning_state: The provisioning state. + :vartype provisioning_state: str + :param hyper_v_generation: Gets the HyperVGenerationType of the VirtualMachine created from the + image. Possible values include: "V1", "V2". + :type hyper_v_generation: str or ~azure.mgmt.compute.v2020_06_01.models.HyperVGenerationTypes + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'source_virtual_machine': {'key': 'properties.sourceVirtualMachine', 'type': 'SubResource'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'ImageStorageProfile'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ImageUpdate, self).__init__(**kwargs) + self.source_virtual_machine = kwargs.get('source_virtual_machine', None) + self.storage_profile = kwargs.get('storage_profile', None) + self.provisioning_state = None + self.hyper_v_generation = kwargs.get('hyper_v_generation', 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 InstanceViewStatus(msrest.serialization.Model): + """Instance view status. + + :param code: The status code. + :type code: str + :param level: The level code. Possible values include: "Info", "Warning", "Error". + :type level: str or ~azure.mgmt.compute.v2020_06_01.models.StatusLevelTypes + :param display_status: The short localizable label for the status. + :type display_status: str + :param message: The detailed status message, including for alerts and error messages. + :type message: str + :param time: The time of the status. + :type time: ~datetime.datetime + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'level': {'key': 'level', 'type': 'str'}, + 'display_status': {'key': 'displayStatus', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'time': {'key': 'time', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(InstanceViewStatus, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.level = kwargs.get('level', None) + self.display_status = kwargs.get('display_status', None) + self.message = kwargs.get('message', None) + self.time = kwargs.get('time', None) + + +class KeyVaultKeyReference(msrest.serialization.Model): + """Describes a reference to Key Vault Key. + + All required parameters must be populated in order to send to Azure. + + :param key_url: Required. The URL referencing a key encryption key in Key Vault. + :type key_url: str + :param source_vault: Required. The relative URL of the Key Vault containing the key. + :type source_vault: ~azure.mgmt.compute.v2020_06_01.models.SubResource + """ + + _validation = { + 'key_url': {'required': True}, + 'source_vault': {'required': True}, + } + + _attribute_map = { + 'key_url': {'key': 'keyUrl', 'type': 'str'}, + 'source_vault': {'key': 'sourceVault', 'type': 'SubResource'}, + } + + def __init__( + self, + **kwargs + ): + super(KeyVaultKeyReference, self).__init__(**kwargs) + self.key_url = kwargs['key_url'] + self.source_vault = kwargs['source_vault'] + + +class KeyVaultSecretReference(msrest.serialization.Model): + """Describes a reference to Key Vault Secret. + + All required parameters must be populated in order to send to Azure. + + :param secret_url: Required. The URL referencing a secret in a Key Vault. + :type secret_url: str + :param source_vault: Required. The relative URL of the Key Vault containing the secret. + :type source_vault: ~azure.mgmt.compute.v2020_06_01.models.SubResource + """ + + _validation = { + 'secret_url': {'required': True}, + 'source_vault': {'required': True}, + } + + _attribute_map = { + 'secret_url': {'key': 'secretUrl', 'type': 'str'}, + 'source_vault': {'key': 'sourceVault', 'type': 'SubResource'}, + } + + def __init__( + self, + **kwargs + ): + super(KeyVaultSecretReference, self).__init__(**kwargs) + self.secret_url = kwargs['secret_url'] + self.source_vault = kwargs['source_vault'] + + +class LastPatchInstallationSummary(msrest.serialization.Model): + """Describes the properties of the last installed patch summary. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status: The overall success or failure status of the operation. It remains "InProgress" + until the operation completes. At that point it will become "Failed", "Succeeded", or + "CompletedWithWarnings.". Possible values include: "InProgress", "Failed", "Succeeded", + "CompletedWithWarnings". + :vartype status: str or ~azure.mgmt.compute.v2020_06_01.models.PatchOperationStatus + :ivar installation_activity_id: The activity ID of the operation that produced this result. It + is used to correlate across CRP and extension logs. + :vartype installation_activity_id: str + :ivar maintenance_window_exceeded: Describes whether the operation ran out of time before it + completed all its intended actions. + :vartype maintenance_window_exceeded: bool + :ivar reboot_status: The reboot status of the machine after the patch operation. It will be in + "NotNeeded" status if reboot is not needed after the patch operation. "Required" will be the + status once the patch is applied and machine is required to reboot. "Started" will be the + reboot status when the machine has started to reboot. "Failed" will be the status if the + machine is failed to reboot. "Completed" will be the status once the machine is rebooted + successfully. Possible values include: "NotNeeded", "Required", "Started", "Failed", + "Completed". + :vartype reboot_status: str or ~azure.mgmt.compute.v2020_06_01.models.RebootStatus + :ivar not_selected_patch_count: The number of all available patches but not going to be + installed because it didn't match a classification or inclusion list entry. + :vartype not_selected_patch_count: int + :ivar excluded_patch_count: The number of all available patches but excluded explicitly by a + customer-specified exclusion list match. + :vartype excluded_patch_count: int + :ivar pending_patch_count: The number of all available patches expected to be installed over + the course of the patch installation operation. + :vartype pending_patch_count: int + :ivar installed_patch_count: The count of patches that successfully installed. + :vartype installed_patch_count: int + :ivar failed_patch_count: The count of patches that failed installation. + :vartype failed_patch_count: int + :ivar start_time: The UTC timestamp when the operation began. + :vartype start_time: ~datetime.datetime + :ivar last_modified_time: The UTC timestamp when the operation began. + :vartype last_modified_time: ~datetime.datetime + :ivar started_by: The person or system account that started the operation. + :vartype started_by: str + :ivar error: The errors that were encountered during execution of the operation. The details + array contains the list of them. + :vartype error: ~azure.mgmt.compute.v2020_06_01.models.ApiError + """ + + _validation = { + 'status': {'readonly': True}, + 'installation_activity_id': {'readonly': True}, + 'maintenance_window_exceeded': {'readonly': True}, + 'reboot_status': {'readonly': True}, + 'not_selected_patch_count': {'readonly': True}, + 'excluded_patch_count': {'readonly': True}, + 'pending_patch_count': {'readonly': True}, + 'installed_patch_count': {'readonly': True}, + 'failed_patch_count': {'readonly': True}, + 'start_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'started_by': {'readonly': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'installation_activity_id': {'key': 'installationActivityId', 'type': 'str'}, + 'maintenance_window_exceeded': {'key': 'maintenanceWindowExceeded', 'type': 'bool'}, + 'reboot_status': {'key': 'rebootStatus', 'type': 'str'}, + 'not_selected_patch_count': {'key': 'notSelectedPatchCount', 'type': 'int'}, + 'excluded_patch_count': {'key': 'excludedPatchCount', 'type': 'int'}, + 'pending_patch_count': {'key': 'pendingPatchCount', 'type': 'int'}, + 'installed_patch_count': {'key': 'installedPatchCount', 'type': 'int'}, + 'failed_patch_count': {'key': 'failedPatchCount', 'type': 'int'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'lastModifiedTime', 'type': 'iso-8601'}, + 'started_by': {'key': 'startedBy', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ApiError'}, + } + + def __init__( + self, + **kwargs + ): + super(LastPatchInstallationSummary, self).__init__(**kwargs) + self.status = None + self.installation_activity_id = None + self.maintenance_window_exceeded = None + self.reboot_status = None + self.not_selected_patch_count = None + self.excluded_patch_count = None + self.pending_patch_count = None + self.installed_patch_count = None + self.failed_patch_count = None + self.start_time = None + self.last_modified_time = None + self.started_by = None + self.error = None + + +class LinuxConfiguration(msrest.serialization.Model): + """Specifies the Linux operating system settings on the virtual machine. :code:`
`:code:`
`For a list of supported Linux distributions, see `Linux on Azure-Endorsed Distributions `_ :code:`
`:code:`
` For running non-endorsed distributions, see `Information for Non-Endorsed Distributions `_. + + :param disable_password_authentication: Specifies whether password authentication should be + disabled. + :type disable_password_authentication: bool + :param ssh: Specifies the ssh key configuration for a Linux OS. + :type ssh: ~azure.mgmt.compute.v2020_06_01.models.SshConfiguration + :param provision_vm_agent: Indicates whether virtual machine agent should be provisioned on the + virtual machine. :code:`
`:code:`
` When this property is not specified in the request + body, default behavior is to set it to true. This will ensure that VM Agent is installed on + the VM so that extensions can be added to the VM later. + :type provision_vm_agent: bool + """ + + _attribute_map = { + 'disable_password_authentication': {'key': 'disablePasswordAuthentication', 'type': 'bool'}, + 'ssh': {'key': 'ssh', 'type': 'SshConfiguration'}, + 'provision_vm_agent': {'key': 'provisionVMAgent', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(LinuxConfiguration, self).__init__(**kwargs) + self.disable_password_authentication = kwargs.get('disable_password_authentication', None) + self.ssh = kwargs.get('ssh', None) + self.provision_vm_agent = kwargs.get('provision_vm_agent', None) + + +class ListUsagesResult(msrest.serialization.Model): + """The List Usages operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of compute resource usages. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.Usage] + :param next_link: The URI to fetch the next page of compute resource usage information. Call + ListNext() with this to fetch the next page of compute resource usage information. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Usage]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ListUsagesResult, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class LogAnalyticsInputBase(msrest.serialization.Model): + """Api input base class for LogAnalytics Api. + + All required parameters must be populated in order to send to Azure. + + :param blob_container_sas_uri: Required. SAS Uri of the logging blob container to which + LogAnalytics Api writes output logs to. + :type blob_container_sas_uri: str + :param from_time: Required. From time of the query. + :type from_time: ~datetime.datetime + :param to_time: Required. To time of the query. + :type to_time: ~datetime.datetime + :param group_by_throttle_policy: Group query result by Throttle Policy applied. + :type group_by_throttle_policy: bool + :param group_by_operation_name: Group query result by Operation Name. + :type group_by_operation_name: bool + :param group_by_resource_name: Group query result by Resource Name. + :type group_by_resource_name: bool + """ + + _validation = { + 'blob_container_sas_uri': {'required': True}, + 'from_time': {'required': True}, + 'to_time': {'required': True}, + } + + _attribute_map = { + 'blob_container_sas_uri': {'key': 'blobContainerSasUri', 'type': 'str'}, + 'from_time': {'key': 'fromTime', 'type': 'iso-8601'}, + 'to_time': {'key': 'toTime', 'type': 'iso-8601'}, + 'group_by_throttle_policy': {'key': 'groupByThrottlePolicy', 'type': 'bool'}, + 'group_by_operation_name': {'key': 'groupByOperationName', 'type': 'bool'}, + 'group_by_resource_name': {'key': 'groupByResourceName', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(LogAnalyticsInputBase, self).__init__(**kwargs) + self.blob_container_sas_uri = kwargs['blob_container_sas_uri'] + self.from_time = kwargs['from_time'] + self.to_time = kwargs['to_time'] + 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) + + +class LogAnalyticsOperationResult(msrest.serialization.Model): + """LogAnalytics operation status response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar properties: LogAnalyticsOutput. + :vartype properties: ~azure.mgmt.compute.v2020_06_01.models.LogAnalyticsOutput + """ + + _validation = { + 'properties': {'readonly': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'LogAnalyticsOutput'}, + } + + def __init__( + self, + **kwargs + ): + super(LogAnalyticsOperationResult, self).__init__(**kwargs) + self.properties = None + + +class LogAnalyticsOutput(msrest.serialization.Model): + """LogAnalytics output properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar output: Output file Uri path to blob container. + :vartype output: str + """ + + _validation = { + 'output': {'readonly': True}, + } + + _attribute_map = { + 'output': {'key': 'output', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LogAnalyticsOutput, self).__init__(**kwargs) + self.output = None + + +class MaintenanceRedeployStatus(msrest.serialization.Model): + """Maintenance Operation Status. + + :param is_customer_initiated_maintenance_allowed: True, if customer is allowed to perform + Maintenance. + :type is_customer_initiated_maintenance_allowed: bool + :param pre_maintenance_window_start_time: Start Time for the Pre Maintenance Window. + :type pre_maintenance_window_start_time: ~datetime.datetime + :param pre_maintenance_window_end_time: End Time for the Pre Maintenance Window. + :type pre_maintenance_window_end_time: ~datetime.datetime + :param maintenance_window_start_time: Start Time for the Maintenance Window. + :type maintenance_window_start_time: ~datetime.datetime + :param maintenance_window_end_time: End Time for the Maintenance Window. + :type maintenance_window_end_time: ~datetime.datetime + :param last_operation_result_code: The Last Maintenance Operation Result Code. Possible values + include: "None", "RetryLater", "MaintenanceAborted", "MaintenanceCompleted". + :type last_operation_result_code: str or + ~azure.mgmt.compute.v2020_06_01.models.MaintenanceOperationResultCodeTypes + :param last_operation_message: Message returned for the last Maintenance Operation. + :type last_operation_message: str + """ + + _attribute_map = { + 'is_customer_initiated_maintenance_allowed': {'key': 'isCustomerInitiatedMaintenanceAllowed', 'type': 'bool'}, + 'pre_maintenance_window_start_time': {'key': 'preMaintenanceWindowStartTime', 'type': 'iso-8601'}, + 'pre_maintenance_window_end_time': {'key': 'preMaintenanceWindowEndTime', 'type': 'iso-8601'}, + 'maintenance_window_start_time': {'key': 'maintenanceWindowStartTime', 'type': 'iso-8601'}, + 'maintenance_window_end_time': {'key': 'maintenanceWindowEndTime', 'type': 'iso-8601'}, + 'last_operation_result_code': {'key': 'lastOperationResultCode', 'type': 'str'}, + 'last_operation_message': {'key': 'lastOperationMessage', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MaintenanceRedeployStatus, self).__init__(**kwargs) + self.is_customer_initiated_maintenance_allowed = kwargs.get('is_customer_initiated_maintenance_allowed', None) + self.pre_maintenance_window_start_time = kwargs.get('pre_maintenance_window_start_time', None) + self.pre_maintenance_window_end_time = kwargs.get('pre_maintenance_window_end_time', None) + self.maintenance_window_start_time = kwargs.get('maintenance_window_start_time', None) + self.maintenance_window_end_time = kwargs.get('maintenance_window_end_time', None) + self.last_operation_result_code = kwargs.get('last_operation_result_code', None) + self.last_operation_message = kwargs.get('last_operation_message', None) + + +class ManagedDiskParameters(SubResource): + """The parameters of a managed disk. + + :param id: Resource Id. + :type id: str + :param storage_account_type: Specifies the storage account type for the managed disk. NOTE: + UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values + include: "Standard_LRS", "Premium_LRS", "StandardSSD_LRS", "UltraSSD_LRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2020_06_01.models.StorageAccountTypes + :param disk_encryption_set: Specifies the customer managed disk encryption set resource id for + the managed disk. + :type disk_encryption_set: ~azure.mgmt.compute.v2020_06_01.models.SubResource + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'disk_encryption_set': {'key': 'diskEncryptionSet', 'type': 'SubResource'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedDiskParameters, self).__init__(**kwargs) + self.storage_account_type = kwargs.get('storage_account_type', None) + self.disk_encryption_set = kwargs.get('disk_encryption_set', None) + + +class NetworkInterfaceReference(SubResource): + """Describes a network interface reference. + + :param id: Resource Id. + :type id: str + :param primary: Specifies the primary network interface in case the virtual machine has more + than 1 network interface. + :type primary: bool + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkInterfaceReference, self).__init__(**kwargs) + self.primary = kwargs.get('primary', None) + + +class NetworkProfile(msrest.serialization.Model): + """Specifies the network interfaces of the virtual machine. + + :param network_interfaces: Specifies the list of resource Ids for the network interfaces + associated with the virtual machine. + :type network_interfaces: + list[~azure.mgmt.compute.v2020_06_01.models.NetworkInterfaceReference] + """ + + _attribute_map = { + 'network_interfaces': {'key': 'networkInterfaces', 'type': '[NetworkInterfaceReference]'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkProfile, self).__init__(**kwargs) + self.network_interfaces = kwargs.get('network_interfaces', None) + + +class OrchestrationServiceStateInput(msrest.serialization.Model): + """The input for OrchestrationServiceState. + + All required parameters must be populated in order to send to Azure. + + :param service_name: Required. The name of the service. Possible values include: + "AutomaticRepairs", "DummyOrchestrationServiceName". + :type service_name: str or ~azure.mgmt.compute.v2020_06_01.models.OrchestrationServiceNames + :param action: Required. The action to be performed. Possible values include: "Resume", + "Suspend". + :type action: str or ~azure.mgmt.compute.v2020_06_01.models.OrchestrationServiceStateAction + """ + + _validation = { + 'service_name': {'required': True}, + 'action': {'required': True}, + } + + _attribute_map = { + 'service_name': {'key': 'serviceName', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OrchestrationServiceStateInput, self).__init__(**kwargs) + self.service_name = kwargs['service_name'] + self.action = kwargs['action'] + + +class OrchestrationServiceSummary(msrest.serialization.Model): + """Summary for an orchestration service of a virtual machine scale set. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar service_name: The name of the service. Possible values include: "AutomaticRepairs", + "DummyOrchestrationServiceName". + :vartype service_name: str or ~azure.mgmt.compute.v2020_06_01.models.OrchestrationServiceNames + :ivar service_state: The current state of the service. Possible values include: "NotRunning", + "Running", "Suspended". + :vartype service_state: str or ~azure.mgmt.compute.v2020_06_01.models.OrchestrationServiceState + """ + + _validation = { + 'service_name': {'readonly': True}, + 'service_state': {'readonly': True}, + } + + _attribute_map = { + 'service_name': {'key': 'serviceName', 'type': 'str'}, + 'service_state': {'key': 'serviceState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OrchestrationServiceSummary, self).__init__(**kwargs) + self.service_name = None + self.service_state = None + + +class OSDisk(msrest.serialization.Model): + """Specifies information about the operating system disk used by the virtual machine. :code:`
`:code:`
` For more information about disks, see `About disks and VHDs for Azure virtual machines `_. + + All required parameters must be populated in order to send to Azure. + + :param os_type: This property allows you to specify the type of the OS that is included in the + disk if creating a VM from user-image or a specialized VHD. :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_06_01.models.OperatingSystemTypes + :param encryption_settings: Specifies the encryption settings for the OS Disk. + :code:`
`:code:`
` Minimum api-version: 2015-06-15. + :type encryption_settings: ~azure.mgmt.compute.v2020_06_01.models.DiskEncryptionSettings + :param name: The disk name. + :type name: str + :param vhd: The virtual hard disk. + :type vhd: ~azure.mgmt.compute.v2020_06_01.models.VirtualHardDisk + :param image: The source user image virtual hard disk. The virtual hard disk will be copied + before being attached to the virtual machine. If SourceImage is provided, the destination + virtual hard drive must not exist. + :type image: ~azure.mgmt.compute.v2020_06_01.models.VirtualHardDisk + :param caching: Specifies the caching requirements. :code:`
`:code:`
` Possible values + are: :code:`
`:code:`
` **None** :code:`
`:code:`
` **ReadOnly** + :code:`
`:code:`
` **ReadWrite** :code:`
`:code:`
` Default: **None** for Standard + storage. **ReadOnly** for Premium storage. Possible values include: "None", "ReadOnly", + "ReadWrite". + :type caching: str or ~azure.mgmt.compute.v2020_06_01.models.CachingTypes + :param write_accelerator_enabled: Specifies whether writeAccelerator should be enabled or + disabled on the disk. + :type write_accelerator_enabled: bool + :param diff_disk_settings: Specifies the ephemeral Disk Settings for the operating system disk + used by the virtual machine. + :type diff_disk_settings: ~azure.mgmt.compute.v2020_06_01.models.DiffDiskSettings + :param create_option: Required. Specifies how the virtual machine should be + created.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` **Attach** \u2013 + This value is used when you are using a specialized disk to create the virtual + machine.:code:`
`:code:`
` **FromImage** \u2013 This value is used when you are using an + image to create the virtual machine. If you are using a platform image, you also use the + imageReference element described above. If you are using a marketplace image, you also use the + plan element previously described. Possible values include: "FromImage", "Empty", "Attach". + :type create_option: str or ~azure.mgmt.compute.v2020_06_01.models.DiskCreateOptionTypes + :param disk_size_gb: Specifies the size of an empty data disk in gigabytes. This element can be + used to overwrite the size of the disk in a virtual machine image. :code:`
`:code:`
` + This value cannot be larger than 1023 GB. + :type disk_size_gb: int + :param managed_disk: The managed disk parameters. + :type managed_disk: ~azure.mgmt.compute.v2020_06_01.models.ManagedDiskParameters + """ + + _validation = { + 'create_option': {'required': True}, + } + + _attribute_map = { + 'os_type': {'key': 'osType', 'type': 'str'}, + 'encryption_settings': {'key': 'encryptionSettings', 'type': 'DiskEncryptionSettings'}, + 'name': {'key': 'name', 'type': 'str'}, + 'vhd': {'key': 'vhd', 'type': 'VirtualHardDisk'}, + 'image': {'key': 'image', 'type': 'VirtualHardDisk'}, + 'caching': {'key': 'caching', 'type': 'str'}, + 'write_accelerator_enabled': {'key': 'writeAcceleratorEnabled', 'type': 'bool'}, + 'diff_disk_settings': {'key': 'diffDiskSettings', 'type': 'DiffDiskSettings'}, + 'create_option': {'key': 'createOption', 'type': 'str'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + 'managed_disk': {'key': 'managedDisk', 'type': 'ManagedDiskParameters'}, + } + + def __init__( + self, + **kwargs + ): + super(OSDisk, self).__init__(**kwargs) + self.os_type = kwargs.get('os_type', None) + self.encryption_settings = kwargs.get('encryption_settings', None) + self.name = kwargs.get('name', None) + self.vhd = kwargs.get('vhd', None) + self.image = kwargs.get('image', None) + self.caching = kwargs.get('caching', None) + self.write_accelerator_enabled = kwargs.get('write_accelerator_enabled', None) + self.diff_disk_settings = kwargs.get('diff_disk_settings', None) + self.create_option = kwargs['create_option'] + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.managed_disk = kwargs.get('managed_disk', None) + + +class OSDiskImage(msrest.serialization.Model): + """Contains the os disk image information. + + All required parameters must be populated in order to send to Azure. + + :param operating_system: Required. The operating system of the osDiskImage. Possible values + include: "Windows", "Linux". + :type operating_system: str or ~azure.mgmt.compute.v2020_06_01.models.OperatingSystemTypes + """ + + _validation = { + 'operating_system': {'required': True}, + } + + _attribute_map = { + 'operating_system': {'key': 'operatingSystem', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OSDiskImage, self).__init__(**kwargs) + self.operating_system = kwargs['operating_system'] + + +class OSProfile(msrest.serialization.Model): + """Specifies the operating system settings for the virtual machine. Some of the settings cannot be changed once VM is provisioned. + + :param computer_name: Specifies the host OS name of the virtual machine. + :code:`
`:code:`
` This name cannot be updated after the VM is created. + :code:`
`:code:`
` **Max-length (Windows):** 15 characters :code:`
`:code:`
` + **Max-length (Linux):** 64 characters. :code:`
`:code:`
` For naming conventions and + restrictions see `Azure infrastructure services implementation guidelines + `_. + :type computer_name: str + :param admin_username: Specifies the name of the administrator account. + :code:`
`:code:`
` This property cannot be updated after the VM is created. + :code:`
`:code:`
` **Windows-only restriction:** Cannot end in "." + :code:`
`:code:`
` **Disallowed values:** "administrator", "admin", "user", "user1", + "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", + "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", + "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". + :code:`
`:code:`
` **Minimum-length (Linux):** 1 character :code:`
`:code:`
` + **Max-length (Linux):** 64 characters :code:`
`:code:`
` **Max-length (Windows):** 20 + characters :code:`
`:code:`
`:code:`
  • ` For root access to the Linux VM, see `Using + root privileges on Linux virtual machines in Azure `_\ :code:`
    `:code:`
  • ` For a list of built-in system users on + Linux that should not be used in this field, see `Selecting User Names for Linux on Azure + `_. + :type admin_username: str + :param admin_password: Specifies the password of the administrator account. + :code:`
    `:code:`
    ` **Minimum-length (Windows):** 8 characters :code:`
    `:code:`
    ` + **Minimum-length (Linux):** 6 characters :code:`
    `:code:`
    ` **Max-length (Windows):** 123 + characters :code:`
    `:code:`
    ` **Max-length (Linux):** 72 characters + :code:`
    `:code:`
    ` **Complexity requirements:** 3 out of 4 conditions below need to be + fulfilled :code:`
    ` Has lower characters :code:`
    `Has upper characters :code:`
    ` Has a + digit :code:`
    ` Has a special character (Regex match [\W_]) :code:`
    `:code:`
    ` + **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", + "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" :code:`
    `:code:`
    ` For + resetting the password, see `How to reset the Remote Desktop service or its login password in a + Windows VM `_ :code:`
    `:code:`
    ` For + resetting root password, see `Manage users, SSH, and check or repair disks on Azure Linux VMs + using the VMAccess Extension `_. + :type admin_password: str + :param custom_data: Specifies a base-64 encoded string of custom data. The base-64 encoded + string is decoded to a binary array that is saved as a file on the Virtual Machine. The maximum + length of the binary array is 65535 bytes. :code:`
    `:code:`
    ` **Note: Do not pass any + secrets or passwords in customData property** :code:`
    `:code:`
    ` This property cannot be + updated after the VM is created. :code:`
    `:code:`
    ` customData is passed to the VM to be + saved as a file, for more information see `Custom Data on Azure VMs + `_ + :code:`
    `:code:`
    ` For using cloud-init for your Linux VM, see `Using cloud-init to + customize a Linux VM during creation `_. + :type custom_data: str + :param windows_configuration: Specifies Windows operating system settings on the virtual + machine. + :type windows_configuration: ~azure.mgmt.compute.v2020_06_01.models.WindowsConfiguration + :param linux_configuration: Specifies the Linux operating system settings on the virtual + machine. :code:`
    `:code:`
    `For a list of supported Linux distributions, see `Linux on + Azure-Endorsed Distributions `_ + :code:`
    `:code:`
    ` For running non-endorsed distributions, see `Information for Non- + Endorsed Distributions `_. + :type linux_configuration: ~azure.mgmt.compute.v2020_06_01.models.LinuxConfiguration + :param secrets: Specifies set of certificates that should be installed onto the virtual + machine. + :type secrets: list[~azure.mgmt.compute.v2020_06_01.models.VaultSecretGroup] + :param allow_extension_operations: Specifies whether extension operations should be allowed on + the virtual machine. :code:`
    `:code:`
    `This may only be set to False when no extensions + are present on the virtual machine. + :type allow_extension_operations: bool + :param require_guest_provision_signal: Specifies whether the guest provision signal is required + to infer provision success of the virtual machine. **Note: This property is for private + testing only, and all customers must not set the property to false.**. + :type require_guest_provision_signal: bool + """ + + _attribute_map = { + 'computer_name': {'key': 'computerName', 'type': 'str'}, + 'admin_username': {'key': 'adminUsername', 'type': 'str'}, + 'admin_password': {'key': 'adminPassword', 'type': 'str'}, + 'custom_data': {'key': 'customData', 'type': 'str'}, + 'windows_configuration': {'key': 'windowsConfiguration', 'type': 'WindowsConfiguration'}, + 'linux_configuration': {'key': 'linuxConfiguration', 'type': 'LinuxConfiguration'}, + 'secrets': {'key': 'secrets', 'type': '[VaultSecretGroup]'}, + 'allow_extension_operations': {'key': 'allowExtensionOperations', 'type': 'bool'}, + 'require_guest_provision_signal': {'key': 'requireGuestProvisionSignal', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(OSProfile, self).__init__(**kwargs) + self.computer_name = kwargs.get('computer_name', None) + self.admin_username = kwargs.get('admin_username', None) + self.admin_password = kwargs.get('admin_password', None) + self.custom_data = kwargs.get('custom_data', None) + self.windows_configuration = kwargs.get('windows_configuration', None) + self.linux_configuration = kwargs.get('linux_configuration', None) + self.secrets = kwargs.get('secrets', None) + self.allow_extension_operations = kwargs.get('allow_extension_operations', None) + self.require_guest_provision_signal = kwargs.get('require_guest_provision_signal', None) + + +class PatchSettings(msrest.serialization.Model): + """PatchSettings. + + :param patch_mode: Specifies the mode of in-guest patching to IaaS virtual machine.:code:`
    `:code:`
    ` Possible values are::code:`
    `:code:`
    ` **Manual** - You control + the application of patches to a virtual machine. You do this by applying patches manually + inside the VM. In this mode, automatic updates are disabled; the property + WindowsConfiguration.enableAutomaticUpdates must be false:code:`
    `:code:`
    ` + **AutomaticByOS** - The virtual machine will automatically be updated by the OS. The property + WindowsConfiguration.enableAutomaticUpdates must be true. :code:`
    `:code:`
    ` ** + AutomaticByPlatform** - the virtual machine will automatically updated by the platform. The + properties provisionVMAgent and WindowsConfiguration.enableAutomaticUpdates must be true. + Possible values include: "Manual", "AutomaticByOS", "AutomaticByPlatform". + :type patch_mode: str or ~azure.mgmt.compute.v2020_06_01.models.InGuestPatchMode + """ + + _attribute_map = { + 'patch_mode': {'key': 'patchMode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PatchSettings, self).__init__(**kwargs) + self.patch_mode = kwargs.get('patch_mode', None) + + +class Plan(msrest.serialization.Model): + """Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. + + :param name: The plan ID. + :type name: str + :param publisher: The publisher ID. + :type publisher: str + :param product: 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 promotion code. + :type promotion_code: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Plan, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.publisher = kwargs.get('publisher', None) + self.product = kwargs.get('product', None) + self.promotion_code = kwargs.get('promotion_code', None) + + +class ProximityPlacementGroup(Resource): + """Specifies information about the proximity placement group. + + 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 proximity_placement_group_type: Specifies the type of the proximity placement group. + :code:`
    `:code:`
    ` Possible values are: :code:`
    `:code:`
    ` **Standard** : Co-locate + resources within an Azure region or Availability Zone. :code:`
    `:code:`
    ` **Ultra** : For + future use. Possible values include: "Standard", "Ultra". + :type proximity_placement_group_type: str or + ~azure.mgmt.compute.v2020_06_01.models.ProximityPlacementGroupType + :ivar virtual_machines: A list of references to all virtual machines in the proximity placement + group. + :vartype virtual_machines: + list[~azure.mgmt.compute.v2020_06_01.models.SubResourceWithColocationStatus] + :ivar virtual_machine_scale_sets: A list of references to all virtual machine scale sets in the + proximity placement group. + :vartype virtual_machine_scale_sets: + list[~azure.mgmt.compute.v2020_06_01.models.SubResourceWithColocationStatus] + :ivar availability_sets: A list of references to all availability sets in the proximity + placement group. + :vartype availability_sets: + list[~azure.mgmt.compute.v2020_06_01.models.SubResourceWithColocationStatus] + :param colocation_status: Describes colocation status of the Proximity Placement Group. + :type colocation_status: ~azure.mgmt.compute.v2020_06_01.models.InstanceViewStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'virtual_machines': {'readonly': True}, + 'virtual_machine_scale_sets': {'readonly': True}, + 'availability_sets': {'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}'}, + 'proximity_placement_group_type': {'key': 'properties.proximityPlacementGroupType', 'type': 'str'}, + 'virtual_machines': {'key': 'properties.virtualMachines', 'type': '[SubResourceWithColocationStatus]'}, + 'virtual_machine_scale_sets': {'key': 'properties.virtualMachineScaleSets', 'type': '[SubResourceWithColocationStatus]'}, + 'availability_sets': {'key': 'properties.availabilitySets', 'type': '[SubResourceWithColocationStatus]'}, + 'colocation_status': {'key': 'properties.colocationStatus', 'type': 'InstanceViewStatus'}, + } + + def __init__( + self, + **kwargs + ): + super(ProximityPlacementGroup, self).__init__(**kwargs) + self.proximity_placement_group_type = kwargs.get('proximity_placement_group_type', None) + self.virtual_machines = None + self.virtual_machine_scale_sets = None + self.availability_sets = None + self.colocation_status = kwargs.get('colocation_status', None) + + +class ProximityPlacementGroupListResult(msrest.serialization.Model): + """The List Proximity Placement Group operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of proximity placement groups. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.ProximityPlacementGroup] + :param next_link: The URI to fetch the next page of proximity placement groups. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProximityPlacementGroup]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProximityPlacementGroupListResult, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class ProximityPlacementGroupUpdate(UpdateResource): + """Specifies information about the proximity placement group. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(ProximityPlacementGroupUpdate, self).__init__(**kwargs) + + +class PurchasePlan(msrest.serialization.Model): + """Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. + + All required parameters must be populated in order to send to Azure. + + :param publisher: Required. The publisher ID. + :type publisher: str + :param name: Required. The plan ID. + :type name: 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 + """ + + _validation = { + 'publisher': {'required': True}, + 'name': {'required': True}, + 'product': {'required': True}, + } + + _attribute_map = { + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PurchasePlan, self).__init__(**kwargs) + self.publisher = kwargs['publisher'] + self.name = kwargs['name'] + self.product = kwargs['product'] + + +class RecoveryWalkResponse(msrest.serialization.Model): + """Response after calling a manual recovery walk. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar walk_performed: Whether the recovery walk was performed. + :vartype walk_performed: bool + :ivar next_platform_update_domain: The next update domain that needs to be walked. Null means + walk spanning all update domains has been completed. + :vartype next_platform_update_domain: int + """ + + _validation = { + 'walk_performed': {'readonly': True}, + 'next_platform_update_domain': {'readonly': True}, + } + + _attribute_map = { + 'walk_performed': {'key': 'walkPerformed', 'type': 'bool'}, + 'next_platform_update_domain': {'key': 'nextPlatformUpdateDomain', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(RecoveryWalkResponse, self).__init__(**kwargs) + self.walk_performed = None + self.next_platform_update_domain = None + + +class RequestRateByIntervalInput(LogAnalyticsInputBase): + """Api request input for LogAnalytics getRequestRateByInterval Api. + + All required parameters must be populated in order to send to Azure. + + :param blob_container_sas_uri: Required. SAS Uri of the logging blob container to which + LogAnalytics Api writes output logs to. + :type blob_container_sas_uri: str + :param from_time: Required. From time of the query. + :type from_time: ~datetime.datetime + :param to_time: Required. To time of the query. + :type to_time: ~datetime.datetime + :param group_by_throttle_policy: Group query result by Throttle Policy applied. + :type group_by_throttle_policy: bool + :param group_by_operation_name: Group query result by Operation Name. + :type group_by_operation_name: bool + :param group_by_resource_name: Group query result by Resource Name. + :type group_by_resource_name: 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 + """ + + _validation = { + 'blob_container_sas_uri': {'required': True}, + 'from_time': {'required': True}, + 'to_time': {'required': True}, + 'interval_length': {'required': True}, + } + + _attribute_map = { + 'blob_container_sas_uri': {'key': 'blobContainerSasUri', 'type': 'str'}, + 'from_time': {'key': 'fromTime', 'type': 'iso-8601'}, + 'to_time': {'key': 'toTime', 'type': 'iso-8601'}, + 'group_by_throttle_policy': {'key': 'groupByThrottlePolicy', 'type': 'bool'}, + 'group_by_operation_name': {'key': 'groupByOperationName', 'type': 'bool'}, + 'group_by_resource_name': {'key': 'groupByResourceName', 'type': 'bool'}, + 'interval_length': {'key': 'intervalLength', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RequestRateByIntervalInput, self).__init__(**kwargs) + self.interval_length = kwargs['interval_length'] + + +class RetrieveBootDiagnosticsDataResult(msrest.serialization.Model): + """The SAS URIs of the console screenshot and serial log blobs. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar console_screenshot_blob_uri: The console screenshot blob URI. + :vartype console_screenshot_blob_uri: str + :ivar serial_console_log_blob_uri: The serial console log blob URI. + :vartype serial_console_log_blob_uri: str + """ + + _validation = { + 'console_screenshot_blob_uri': {'readonly': True}, + 'serial_console_log_blob_uri': {'readonly': True}, + } + + _attribute_map = { + 'console_screenshot_blob_uri': {'key': 'consoleScreenshotBlobUri', 'type': 'str'}, + 'serial_console_log_blob_uri': {'key': 'serialConsoleLogBlobUri', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RetrieveBootDiagnosticsDataResult, self).__init__(**kwargs) + self.console_screenshot_blob_uri = None + self.serial_console_log_blob_uri = None + + +class RollbackStatusInfo(msrest.serialization.Model): + """Information about rollback on failed VM instances after a OS Upgrade operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar successfully_rolledback_instance_count: The number of instances which have been + successfully rolled back. + :vartype successfully_rolledback_instance_count: int + :ivar failed_rolledback_instance_count: The number of instances which failed to rollback. + :vartype failed_rolledback_instance_count: int + :ivar rollback_error: Error details if OS rollback failed. + :vartype rollback_error: ~azure.mgmt.compute.v2020_06_01.models.ApiError + """ + + _validation = { + 'successfully_rolledback_instance_count': {'readonly': True}, + 'failed_rolledback_instance_count': {'readonly': True}, + 'rollback_error': {'readonly': True}, + } + + _attribute_map = { + 'successfully_rolledback_instance_count': {'key': 'successfullyRolledbackInstanceCount', 'type': 'int'}, + 'failed_rolledback_instance_count': {'key': 'failedRolledbackInstanceCount', 'type': 'int'}, + 'rollback_error': {'key': 'rollbackError', 'type': 'ApiError'}, + } + + def __init__( + self, + **kwargs + ): + super(RollbackStatusInfo, self).__init__(**kwargs) + self.successfully_rolledback_instance_count = None + self.failed_rolledback_instance_count = None + self.rollback_error = None + + +class RollingUpgradePolicy(msrest.serialization.Model): + """The configuration parameters used while performing a rolling upgrade. + + :param max_batch_instance_percent: The maximum percent of total virtual machine instances that + will be upgraded simultaneously by the rolling upgrade in one batch. As this is a maximum, + unhealthy instances in previous or future batches can cause the percentage of instances in a + batch to decrease to ensure higher reliability. The default value for this parameter is 20%. + :type max_batch_instance_percent: int + :param max_unhealthy_instance_percent: The maximum percentage of the total virtual machine + instances in the scale set that can be simultaneously unhealthy, either as a result of being + upgraded, or by being found in an unhealthy state by the virtual machine health checks before + the rolling upgrade aborts. This constraint will be checked prior to starting any batch. The + default value for this parameter is 20%. + :type max_unhealthy_instance_percent: int + :param max_unhealthy_upgraded_instance_percent: The maximum percentage of upgraded virtual + machine instances that can be found to be in an unhealthy state. This check will happen after + each batch is upgraded. If this percentage is ever exceeded, the rolling update aborts. The + default value for this parameter is 20%. + :type max_unhealthy_upgraded_instance_percent: int + :param pause_time_between_batches: The wait time between completing the update for all virtual + machines in one batch and starting the next batch. The time duration should be specified in ISO + 8601 format. The default value is 0 seconds (PT0S). + :type pause_time_between_batches: str + """ + + _validation = { + 'max_batch_instance_percent': {'maximum': 100, 'minimum': 5}, + 'max_unhealthy_instance_percent': {'maximum': 100, 'minimum': 5}, + 'max_unhealthy_upgraded_instance_percent': {'maximum': 100, 'minimum': 0}, + } + + _attribute_map = { + 'max_batch_instance_percent': {'key': 'maxBatchInstancePercent', 'type': 'int'}, + 'max_unhealthy_instance_percent': {'key': 'maxUnhealthyInstancePercent', 'type': 'int'}, + 'max_unhealthy_upgraded_instance_percent': {'key': 'maxUnhealthyUpgradedInstancePercent', 'type': 'int'}, + 'pause_time_between_batches': {'key': 'pauseTimeBetweenBatches', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RollingUpgradePolicy, self).__init__(**kwargs) + self.max_batch_instance_percent = kwargs.get('max_batch_instance_percent', None) + self.max_unhealthy_instance_percent = kwargs.get('max_unhealthy_instance_percent', None) + self.max_unhealthy_upgraded_instance_percent = kwargs.get('max_unhealthy_upgraded_instance_percent', None) + self.pause_time_between_batches = kwargs.get('pause_time_between_batches', None) + + +class RollingUpgradeProgressInfo(msrest.serialization.Model): + """Information about the number of virtual machine instances in each upgrade state. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar successful_instance_count: The number of instances that have been successfully upgraded. + :vartype successful_instance_count: int + :ivar failed_instance_count: The number of instances that have failed to be upgraded + successfully. + :vartype failed_instance_count: int + :ivar in_progress_instance_count: The number of instances that are currently being upgraded. + :vartype in_progress_instance_count: int + :ivar pending_instance_count: The number of instances that have not yet begun to be upgraded. + :vartype pending_instance_count: int + """ + + _validation = { + 'successful_instance_count': {'readonly': True}, + 'failed_instance_count': {'readonly': True}, + 'in_progress_instance_count': {'readonly': True}, + 'pending_instance_count': {'readonly': True}, + } + + _attribute_map = { + 'successful_instance_count': {'key': 'successfulInstanceCount', 'type': 'int'}, + 'failed_instance_count': {'key': 'failedInstanceCount', 'type': 'int'}, + 'in_progress_instance_count': {'key': 'inProgressInstanceCount', 'type': 'int'}, + 'pending_instance_count': {'key': 'pendingInstanceCount', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(RollingUpgradeProgressInfo, self).__init__(**kwargs) + self.successful_instance_count = None + self.failed_instance_count = None + self.in_progress_instance_count = None + self.pending_instance_count = None + + +class RollingUpgradeRunningStatus(msrest.serialization.Model): + """Information about the current running state of the overall upgrade. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Code indicating the current status of the upgrade. Possible values include: + "RollingForward", "Cancelled", "Completed", "Faulted". + :vartype code: str or ~azure.mgmt.compute.v2020_06_01.models.RollingUpgradeStatusCode + :ivar start_time: Start time of the upgrade. + :vartype start_time: ~datetime.datetime + :ivar last_action: The last action performed on the rolling upgrade. Possible values include: + "Start", "Cancel". + :vartype last_action: str or ~azure.mgmt.compute.v2020_06_01.models.RollingUpgradeActionType + :ivar last_action_time: Last action time of the upgrade. + :vartype last_action_time: ~datetime.datetime + """ + + _validation = { + 'code': {'readonly': True}, + 'start_time': {'readonly': True}, + 'last_action': {'readonly': True}, + 'last_action_time': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'last_action': {'key': 'lastAction', 'type': 'str'}, + 'last_action_time': {'key': 'lastActionTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(RollingUpgradeRunningStatus, self).__init__(**kwargs) + self.code = None + self.start_time = None + self.last_action = None + self.last_action_time = None + + +class RollingUpgradeStatusInfo(Resource): + """The status of the latest virtual machine scale set rolling upgrade. + + 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 policy: The rolling upgrade policies applied for this upgrade. + :vartype policy: ~azure.mgmt.compute.v2020_06_01.models.RollingUpgradePolicy + :ivar running_status: Information about the current running state of the overall upgrade. + :vartype running_status: ~azure.mgmt.compute.v2020_06_01.models.RollingUpgradeRunningStatus + :ivar progress: Information about the number of virtual machine instances in each upgrade + state. + :vartype progress: ~azure.mgmt.compute.v2020_06_01.models.RollingUpgradeProgressInfo + :ivar error: Error details for this upgrade, if there are any. + :vartype error: ~azure.mgmt.compute.v2020_06_01.models.ApiError + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'policy': {'readonly': True}, + 'running_status': {'readonly': True}, + 'progress': {'readonly': True}, + 'error': {'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}'}, + 'policy': {'key': 'properties.policy', 'type': 'RollingUpgradePolicy'}, + 'running_status': {'key': 'properties.runningStatus', 'type': 'RollingUpgradeRunningStatus'}, + 'progress': {'key': 'properties.progress', 'type': 'RollingUpgradeProgressInfo'}, + 'error': {'key': 'properties.error', 'type': 'ApiError'}, + } + + def __init__( + self, + **kwargs + ): + super(RollingUpgradeStatusInfo, self).__init__(**kwargs) + self.policy = None + self.running_status = None + self.progress = None + self.error = None + + +class RunCommandDocumentBase(msrest.serialization.Model): + """Describes the properties of a Run Command metadata. + + All required parameters must be populated in order to send to Azure. + + :param schema: Required. The VM run command schema. + :type schema: str + :param id: Required. The VM run command id. + :type id: str + :param os_type: Required. The Operating System type. Possible values include: "Windows", + "Linux". + :type os_type: str or ~azure.mgmt.compute.v2020_06_01.models.OperatingSystemTypes + :param label: Required. The VM run command label. + :type label: str + :param description: Required. The VM run command description. + :type description: str + """ + + _validation = { + 'schema': {'required': True}, + 'id': {'required': True}, + 'os_type': {'required': True}, + 'label': {'required': True}, + 'description': {'required': True}, + } + + _attribute_map = { + 'schema': {'key': '$schema', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'label': {'key': 'label', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RunCommandDocumentBase, self).__init__(**kwargs) + self.schema = kwargs['schema'] + self.id = kwargs['id'] + self.os_type = kwargs['os_type'] + self.label = kwargs['label'] + self.description = kwargs['description'] + + +class RunCommandDocument(RunCommandDocumentBase): + """Describes the properties of a Run Command. + + All required parameters must be populated in order to send to Azure. + + :param schema: Required. The VM run command schema. + :type schema: str + :param id: Required. The VM run command id. + :type id: str + :param os_type: Required. The Operating System type. Possible values include: "Windows", + "Linux". + :type os_type: str or ~azure.mgmt.compute.v2020_06_01.models.OperatingSystemTypes + :param label: Required. The VM run command label. + :type label: str + :param description: Required. The VM run command description. + :type description: str + :param script: Required. The script to be executed. + :type script: list[str] + :param parameters: The parameters used by the script. + :type parameters: list[~azure.mgmt.compute.v2020_06_01.models.RunCommandParameterDefinition] + """ + + _validation = { + 'schema': {'required': True}, + 'id': {'required': True}, + 'os_type': {'required': True}, + 'label': {'required': True}, + 'description': {'required': True}, + 'script': {'required': True}, + } + + _attribute_map = { + 'schema': {'key': '$schema', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'label': {'key': 'label', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'script': {'key': 'script', 'type': '[str]'}, + 'parameters': {'key': 'parameters', 'type': '[RunCommandParameterDefinition]'}, + } + + def __init__( + self, + **kwargs + ): + super(RunCommandDocument, self).__init__(**kwargs) + self.script = kwargs['script'] + self.parameters = kwargs.get('parameters', None) + + +class RunCommandInput(msrest.serialization.Model): + """Capture Virtual Machine parameters. + + All required parameters must be populated in order to send to Azure. + + :param command_id: Required. The run command id. + :type command_id: str + :param script: Optional. The script to be executed. When this value is given, the given script + will override the default script of the command. + :type script: list[str] + :param parameters: The run command parameters. + :type parameters: list[~azure.mgmt.compute.v2020_06_01.models.RunCommandInputParameter] + """ + + _validation = { + 'command_id': {'required': True}, + } + + _attribute_map = { + 'command_id': {'key': 'commandId', 'type': 'str'}, + 'script': {'key': 'script', 'type': '[str]'}, + 'parameters': {'key': 'parameters', 'type': '[RunCommandInputParameter]'}, + } + + def __init__( + self, + **kwargs + ): + super(RunCommandInput, self).__init__(**kwargs) + self.command_id = kwargs['command_id'] + self.script = kwargs.get('script', None) + self.parameters = kwargs.get('parameters', None) + + +class RunCommandInputParameter(msrest.serialization.Model): + """Describes the properties of a run command parameter. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The run command parameter name. + :type name: str + :param value: Required. The run command parameter value. + :type value: str + """ + + _validation = { + 'name': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RunCommandInputParameter, self).__init__(**kwargs) + self.name = kwargs['name'] + self.value = kwargs['value'] + + +class RunCommandListResult(msrest.serialization.Model): + """The List Virtual Machine operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of virtual machine run commands. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.RunCommandDocumentBase] + :param next_link: The uri to fetch the next page of run commands. Call ListNext() with this to + fetch the next page of run commands. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[RunCommandDocumentBase]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RunCommandListResult, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class RunCommandParameterDefinition(msrest.serialization.Model): + """Describes the properties of a run command parameter. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The run command parameter name. + :type name: str + :param type: Required. The run command parameter type. + :type type: str + :param default_value: The run command parameter default value. + :type default_value: str + :param required: The run command parameter required. + :type required: bool + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'default_value': {'key': 'defaultValue', 'type': 'str'}, + 'required': {'key': 'required', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(RunCommandParameterDefinition, self).__init__(**kwargs) + self.name = kwargs['name'] + self.type = kwargs['type'] + self.default_value = kwargs.get('default_value', None) + self.required = kwargs.get('required', False) + + +class RunCommandResult(msrest.serialization.Model): + """RunCommandResult. + + :param value: Run command operation response. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.InstanceViewStatus] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[InstanceViewStatus]'}, + } + + def __init__( + self, + **kwargs + ): + super(RunCommandResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class ScaleInPolicy(msrest.serialization.Model): + """Describes a scale-in policy for a virtual machine scale set. + + :param rules: The rules to be followed when scaling-in a virtual machine scale set. + :code:`
    `:code:`
    ` Possible values are: :code:`
    `:code:`
    ` **Default** When a + virtual machine scale set is scaled in, the scale set will first be balanced across zones if it + is a zonal scale set. Then, it will be balanced across Fault Domains as far as possible. Within + each Fault Domain, the virtual machines chosen for removal will be the newest ones that are not + protected from scale-in. :code:`
    `:code:`
    ` **OldestVM** When a virtual machine scale set + is being scaled-in, the oldest virtual machines that are not protected from scale-in will be + chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced + across zones. Within each zone, the oldest virtual machines that are not protected will be + chosen for removal. :code:`
    `:code:`
    ` **NewestVM** When a virtual machine scale set is + being scaled-in, the newest virtual machines that are not protected from scale-in will be + chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced + across zones. Within each zone, the newest virtual machines that are not protected will be + chosen for removal. :code:`
    `:code:`
    `. + :type rules: list[str or + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetScaleInRules] + """ + + _attribute_map = { + 'rules': {'key': 'rules', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ScaleInPolicy, self).__init__(**kwargs) + self.rules = kwargs.get('rules', None) + + +class ScheduledEventsProfile(msrest.serialization.Model): + """ScheduledEventsProfile. + + :param terminate_notification_profile: Specifies Terminate Scheduled Event related + configurations. + :type terminate_notification_profile: + ~azure.mgmt.compute.v2020_06_01.models.TerminateNotificationProfile + """ + + _attribute_map = { + 'terminate_notification_profile': {'key': 'terminateNotificationProfile', 'type': 'TerminateNotificationProfile'}, + } + + def __init__( + self, + **kwargs + ): + super(ScheduledEventsProfile, self).__init__(**kwargs) + self.terminate_notification_profile = kwargs.get('terminate_notification_profile', None) + + +class SecurityProfile(msrest.serialization.Model): + """Specifies the Security profile settings for the virtual machine or virtual machine scale set. + + :param encryption_at_host: This property can be used by user in the request to enable or + disable the Host Encryption for the virtual machine or virtual machine scale set. This will + enable the encryption for all the disks including Resource/Temp disk at host itself. + :code:`
    `:code:`
    ` Default: The Encryption at host will be disabled unless this property + is set to true for the resource. + :type encryption_at_host: bool + """ + + _attribute_map = { + 'encryption_at_host': {'key': 'encryptionAtHost', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(SecurityProfile, self).__init__(**kwargs) + self.encryption_at_host = kwargs.get('encryption_at_host', None) + + +class Sku(msrest.serialization.Model): + """Describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware the scale set is currently on, you need to deallocate the VMs in the scale set before you modify the SKU name. + + :param name: The sku name. + :type name: str + :param tier: Specifies the tier of virtual machines in a scale set.:code:`
    `:code:`
    ` + Possible Values::code:`
    `:code:`
    ` **Standard**\ :code:`
    `:code:`
    ` + **Basic**. + :type tier: str + :param capacity: Specifies the number of virtual machines in the scale set. + :type capacity: long + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get('capacity', None) + + +class SshConfiguration(msrest.serialization.Model): + """SSH configuration for Linux based VMs running on Azure. + + :param public_keys: The list of SSH public keys used to authenticate with linux based VMs. + :type public_keys: list[~azure.mgmt.compute.v2020_06_01.models.SshPublicKey] + """ + + _attribute_map = { + 'public_keys': {'key': 'publicKeys', 'type': '[SshPublicKey]'}, + } + + def __init__( + self, + **kwargs + ): + super(SshConfiguration, self).__init__(**kwargs) + self.public_keys = kwargs.get('public_keys', None) + + +class SshPublicKey(msrest.serialization.Model): + """Contains information about SSH certificate public key and the path on the Linux VM where the public key is placed. + + :param path: Specifies the full path on the created VM where ssh public key is stored. If the + file already exists, the specified key is appended to the file. Example: + /home/user/.ssh/authorized_keys. + :type path: str + :param key_data: SSH public key certificate used to authenticate with the VM through ssh. The + key needs to be at least 2048-bit and in ssh-rsa format. :code:`
    `:code:`
    ` For creating + ssh keys, see `Create SSH keys on Linux and Mac for Linux VMs in Azure + `_. + :type key_data: str + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'key_data': {'key': 'keyData', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SshPublicKey, self).__init__(**kwargs) + self.path = kwargs.get('path', None) + self.key_data = kwargs.get('key_data', None) + + +class SshPublicKeyGenerateKeyPairResult(msrest.serialization.Model): + """Response from generation of an SSH key pair. + + All required parameters must be populated in order to send to Azure. + + :param private_key: Required. Private key portion of the key pair used to authenticate to a + virtual machine through ssh. The private key is returned in RFC3447 format and should be + treated as a secret. + :type private_key: str + :param public_key: Required. Public key portion of the key pair used to authenticate to a + virtual machine through ssh. The public key is in ssh-rsa format. + :type public_key: str + :param id: Required. The ARM resource id in the form of + /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{SshPublicKeyName}. + :type id: str + """ + + _validation = { + 'private_key': {'required': True}, + 'public_key': {'required': True}, + 'id': {'required': True}, + } + + _attribute_map = { + 'private_key': {'key': 'privateKey', 'type': 'str'}, + 'public_key': {'key': 'publicKey', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SshPublicKeyGenerateKeyPairResult, self).__init__(**kwargs) + self.private_key = kwargs['private_key'] + self.public_key = kwargs['public_key'] + self.id = kwargs['id'] + + +class SshPublicKeyResource(Resource): + """Specifies information about the SSH public 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. + + :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 public_key: SSH public key used to authenticate to a virtual machine through ssh. If + this property is not initially provided when the resource is created, the publicKey property + will be populated when generateKeyPair is called. If the public key is provided upon resource + creation, the provided public key needs to be at least 2048-bit and in ssh-rsa format. + :type public_key: str + """ + + _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}'}, + 'public_key': {'key': 'properties.publicKey', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SshPublicKeyResource, self).__init__(**kwargs) + self.public_key = kwargs.get('public_key', None) + + +class SshPublicKeysGroupListResult(msrest.serialization.Model): + """The list SSH public keys operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of SSH public keys. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.SshPublicKeyResource] + :param next_link: The URI to fetch the next page of SSH public keys. Call ListNext() with this + URI to fetch the next page of SSH public keys. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SshPublicKeyResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SshPublicKeysGroupListResult, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class SshPublicKeyUpdateResource(UpdateResource): + """Specifies information about the SSH public key. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param public_key: SSH public key used to authenticate to a virtual machine through ssh. If + this property is not initially provided when the resource is created, the publicKey property + will be populated when generateKeyPair is called. If the public key is provided upon resource + creation, the provided public key needs to be at least 2048-bit and in ssh-rsa format. + :type public_key: str + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'public_key': {'key': 'properties.publicKey', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SshPublicKeyUpdateResource, self).__init__(**kwargs) + self.public_key = kwargs.get('public_key', None) + + +class StorageProfile(msrest.serialization.Model): + """Specifies the storage settings for the virtual machine disks. + + :param image_reference: Specifies information about the image to use. You can specify + information about platform images, marketplace images, or virtual machine images. This element + is required when you want to use a platform image, marketplace image, or virtual machine image, + but is not used in other creation operations. + :type image_reference: ~azure.mgmt.compute.v2020_06_01.models.ImageReference + :param os_disk: Specifies information about the operating system disk used by the virtual + machine. :code:`
    `:code:`
    ` For more information about disks, see `About disks and VHDs + for Azure virtual machines `_. + :type os_disk: ~azure.mgmt.compute.v2020_06_01.models.OSDisk + :param data_disks: Specifies the parameters that are used to add a data disk to a virtual + machine. :code:`
    `:code:`
    ` For more information about disks, see `About disks and VHDs + for Azure virtual machines `_. + :type data_disks: list[~azure.mgmt.compute.v2020_06_01.models.DataDisk] + """ + + _attribute_map = { + 'image_reference': {'key': 'imageReference', 'type': 'ImageReference'}, + 'os_disk': {'key': 'osDisk', 'type': 'OSDisk'}, + 'data_disks': {'key': 'dataDisks', 'type': '[DataDisk]'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageProfile, self).__init__(**kwargs) + self.image_reference = kwargs.get('image_reference', None) + self.os_disk = kwargs.get('os_disk', None) + self.data_disks = kwargs.get('data_disks', None) + + +class SubResourceReadOnly(msrest.serialization.Model): + """SubResourceReadOnly. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SubResourceReadOnly, self).__init__(**kwargs) + self.id = None + + +class SubResourceWithColocationStatus(SubResource): + """SubResourceWithColocationStatus. + + :param id: Resource Id. + :type id: str + :param colocation_status: Describes colocation status of a resource in the Proximity Placement + Group. + :type colocation_status: ~azure.mgmt.compute.v2020_06_01.models.InstanceViewStatus + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'colocation_status': {'key': 'colocationStatus', 'type': 'InstanceViewStatus'}, + } + + def __init__( + self, + **kwargs + ): + super(SubResourceWithColocationStatus, self).__init__(**kwargs) + self.colocation_status = kwargs.get('colocation_status', None) + + +class TerminateNotificationProfile(msrest.serialization.Model): + """TerminateNotificationProfile. + + :param not_before_timeout: Configurable length of time a Virtual Machine being deleted will + have to potentially approve the Terminate Scheduled Event before the event is auto approved + (timed out). The configuration must be specified in ISO 8601 format, the default value is 5 + minutes (PT5M). + :type not_before_timeout: str + :param enable: Specifies whether the Terminate Scheduled event is enabled or disabled. + :type enable: bool + """ + + _attribute_map = { + 'not_before_timeout': {'key': 'notBeforeTimeout', 'type': 'str'}, + 'enable': {'key': 'enable', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(TerminateNotificationProfile, self).__init__(**kwargs) + self.not_before_timeout = kwargs.get('not_before_timeout', None) + self.enable = kwargs.get('enable', None) + + +class ThrottledRequestsInput(LogAnalyticsInputBase): + """Api request input for LogAnalytics getThrottledRequests Api. + + All required parameters must be populated in order to send to Azure. + + :param blob_container_sas_uri: Required. SAS Uri of the logging blob container to which + LogAnalytics Api writes output logs to. + :type blob_container_sas_uri: str + :param from_time: Required. From time of the query. + :type from_time: ~datetime.datetime + :param to_time: Required. To time of the query. + :type to_time: ~datetime.datetime + :param group_by_throttle_policy: Group query result by Throttle Policy applied. + :type group_by_throttle_policy: bool + :param group_by_operation_name: Group query result by Operation Name. + :type group_by_operation_name: bool + :param group_by_resource_name: Group query result by Resource Name. + :type group_by_resource_name: bool + """ + + _validation = { + 'blob_container_sas_uri': {'required': True}, + 'from_time': {'required': True}, + 'to_time': {'required': True}, + } + + _attribute_map = { + 'blob_container_sas_uri': {'key': 'blobContainerSasUri', 'type': 'str'}, + 'from_time': {'key': 'fromTime', 'type': 'iso-8601'}, + 'to_time': {'key': 'toTime', 'type': 'iso-8601'}, + 'group_by_throttle_policy': {'key': 'groupByThrottlePolicy', 'type': 'bool'}, + 'group_by_operation_name': {'key': 'groupByOperationName', 'type': 'bool'}, + 'group_by_resource_name': {'key': 'groupByResourceName', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ThrottledRequestsInput, self).__init__(**kwargs) + + +class UpgradeOperationHistoricalStatusInfo(msrest.serialization.Model): + """Virtual Machine Scale Set OS Upgrade History operation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar properties: Information about the properties of the upgrade operation. + :vartype properties: + ~azure.mgmt.compute.v2020_06_01.models.UpgradeOperationHistoricalStatusInfoProperties + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + """ + + _validation = { + 'properties': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'UpgradeOperationHistoricalStatusInfoProperties'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UpgradeOperationHistoricalStatusInfo, self).__init__(**kwargs) + self.properties = None + self.type = None + self.location = None + + +class UpgradeOperationHistoricalStatusInfoProperties(msrest.serialization.Model): + """Describes each OS upgrade on the Virtual Machine Scale Set. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar running_status: Information about the overall status of the upgrade operation. + :vartype running_status: ~azure.mgmt.compute.v2020_06_01.models.UpgradeOperationHistoryStatus + :ivar progress: Counts of the VMs in each state. + :vartype progress: ~azure.mgmt.compute.v2020_06_01.models.RollingUpgradeProgressInfo + :ivar error: Error Details for this upgrade if there are any. + :vartype error: ~azure.mgmt.compute.v2020_06_01.models.ApiError + :ivar started_by: Invoker of the Upgrade Operation. Possible values include: "Unknown", "User", + "Platform". + :vartype started_by: str or ~azure.mgmt.compute.v2020_06_01.models.UpgradeOperationInvoker + :ivar target_image_reference: Image Reference details. + :vartype target_image_reference: ~azure.mgmt.compute.v2020_06_01.models.ImageReference + :ivar rollback_info: Information about OS rollback if performed. + :vartype rollback_info: ~azure.mgmt.compute.v2020_06_01.models.RollbackStatusInfo + """ + + _validation = { + 'running_status': {'readonly': True}, + 'progress': {'readonly': True}, + 'error': {'readonly': True}, + 'started_by': {'readonly': True}, + 'target_image_reference': {'readonly': True}, + 'rollback_info': {'readonly': True}, + } + + _attribute_map = { + 'running_status': {'key': 'runningStatus', 'type': 'UpgradeOperationHistoryStatus'}, + 'progress': {'key': 'progress', 'type': 'RollingUpgradeProgressInfo'}, + 'error': {'key': 'error', 'type': 'ApiError'}, + 'started_by': {'key': 'startedBy', 'type': 'str'}, + 'target_image_reference': {'key': 'targetImageReference', 'type': 'ImageReference'}, + 'rollback_info': {'key': 'rollbackInfo', 'type': 'RollbackStatusInfo'}, + } + + def __init__( + self, + **kwargs + ): + super(UpgradeOperationHistoricalStatusInfoProperties, self).__init__(**kwargs) + self.running_status = None + self.progress = None + self.error = None + self.started_by = None + self.target_image_reference = None + self.rollback_info = None + + +class UpgradeOperationHistoryStatus(msrest.serialization.Model): + """Information about the current running state of the overall upgrade. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Code indicating the current status of the upgrade. Possible values include: + "RollingForward", "Cancelled", "Completed", "Faulted". + :vartype code: str or ~azure.mgmt.compute.v2020_06_01.models.UpgradeState + :ivar start_time: Start time of the upgrade. + :vartype start_time: ~datetime.datetime + :ivar end_time: End time of the upgrade. + :vartype end_time: ~datetime.datetime + """ + + _validation = { + 'code': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(UpgradeOperationHistoryStatus, self).__init__(**kwargs) + self.code = None + self.start_time = None + self.end_time = None + + +class UpgradePolicy(msrest.serialization.Model): + """Describes an upgrade policy - automatic, manual, or rolling. + + :param mode: Specifies the mode of an upgrade to virtual machines in the scale set.:code:`
    `:code:`
    ` Possible values are::code:`
    `:code:`
    ` **Manual** - You control + the application of updates to virtual machines in the scale set. You do this by using the + manualUpgrade action.:code:`
    `:code:`
    ` **Automatic** - All virtual machines in the + scale set are automatically updated at the same time. Possible values include: "Automatic", + "Manual", "Rolling". + :type mode: str or ~azure.mgmt.compute.v2020_06_01.models.UpgradeMode + :param rolling_upgrade_policy: The configuration parameters used while performing a rolling + upgrade. + :type rolling_upgrade_policy: ~azure.mgmt.compute.v2020_06_01.models.RollingUpgradePolicy + :param automatic_os_upgrade_policy: Configuration parameters used for performing automatic OS + Upgrade. + :type automatic_os_upgrade_policy: + ~azure.mgmt.compute.v2020_06_01.models.AutomaticOSUpgradePolicy + """ + + _attribute_map = { + 'mode': {'key': 'mode', 'type': 'str'}, + 'rolling_upgrade_policy': {'key': 'rollingUpgradePolicy', 'type': 'RollingUpgradePolicy'}, + 'automatic_os_upgrade_policy': {'key': 'automaticOSUpgradePolicy', 'type': 'AutomaticOSUpgradePolicy'}, + } + + def __init__( + self, + **kwargs + ): + super(UpgradePolicy, self).__init__(**kwargs) + self.mode = kwargs.get('mode', None) + self.rolling_upgrade_policy = kwargs.get('rolling_upgrade_policy', None) + self.automatic_os_upgrade_policy = kwargs.get('automatic_os_upgrade_policy', None) + + +class Usage(msrest.serialization.Model): + """Describes Compute Resource Usage. + + 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 unit: Required. An enum describing the unit of usage measurement. Default value: "Count". + :vartype unit: str + :param current_value: Required. The current usage of the resource. + :type current_value: int + :param limit: Required. The maximum permitted usage of the resource. + :type limit: long + :param name: Required. The name of the type of usage. + :type name: ~azure.mgmt.compute.v2020_06_01.models.UsageName + """ + + _validation = { + 'unit': {'required': True, 'constant': True}, + 'current_value': {'required': True}, + 'limit': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + unit = "Count" + + def __init__( + self, + **kwargs + ): + super(Usage, self).__init__(**kwargs) + self.current_value = kwargs['current_value'] + self.limit = kwargs['limit'] + self.name = kwargs['name'] + + +class UsageName(msrest.serialization.Model): + """The Usage Names. + + :param value: The name of the resource. + :type value: str + :param localized_value: The localized name of the resource. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UsageName, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.localized_value = kwargs.get('localized_value', None) + + +class VaultCertificate(msrest.serialization.Model): + """Describes a single certificate reference in a Key Vault, and where the certificate should reside on the VM. + + :param certificate_url: This is the URL of a certificate that has been uploaded to Key Vault as + a secret. For adding a secret to the Key Vault, see `Add a key or secret to the key vault + `_. In this case, your + certificate needs to be It is the Base64 encoding of the following JSON Object which is encoded + in UTF-8: :code:`
    `:code:`
    ` {:code:`
    ` "data":":code:``",:code:`
    ` "dataType":"pfx",:code:`
    ` "password":":code:``":code:`
    `}. + :type certificate_url: str + :param certificate_store: For Windows VMs, specifies the certificate store on the Virtual + Machine to which the certificate should be added. The specified certificate store is implicitly + in the LocalMachine account. :code:`
    `:code:`
    `For Linux VMs, the certificate file is + placed under the /var/lib/waagent directory, with the file name <UppercaseThumbprint>.crt + for the X509 certificate file and <UppercaseThumbprint>.prv for private key. Both of + these files are .pem formatted. + :type certificate_store: str + """ + + _attribute_map = { + 'certificate_url': {'key': 'certificateUrl', 'type': 'str'}, + 'certificate_store': {'key': 'certificateStore', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VaultCertificate, self).__init__(**kwargs) + self.certificate_url = kwargs.get('certificate_url', None) + self.certificate_store = kwargs.get('certificate_store', None) + + +class VaultSecretGroup(msrest.serialization.Model): + """Describes a set of certificates which are all in the same Key Vault. + + :param source_vault: The relative URL of the Key Vault containing all of the certificates in + VaultCertificates. + :type source_vault: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param vault_certificates: The list of key vault references in SourceVault which contain + certificates. + :type vault_certificates: list[~azure.mgmt.compute.v2020_06_01.models.VaultCertificate] + """ + + _attribute_map = { + 'source_vault': {'key': 'sourceVault', 'type': 'SubResource'}, + 'vault_certificates': {'key': 'vaultCertificates', 'type': '[VaultCertificate]'}, + } + + def __init__( + self, + **kwargs + ): + super(VaultSecretGroup, self).__init__(**kwargs) + self.source_vault = kwargs.get('source_vault', None) + self.vault_certificates = kwargs.get('vault_certificates', None) + + +class VirtualHardDisk(msrest.serialization.Model): + """Describes the uri of a disk. + + :param uri: Specifies the virtual hard disk's uri. + :type uri: str + """ + + _attribute_map = { + 'uri': {'key': 'uri', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualHardDisk, self).__init__(**kwargs) + self.uri = kwargs.get('uri', None) + + +class VirtualMachine(Resource): + """Describes a Virtual Machine. + + 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 plan: Specifies information about the marketplace image used to create the virtual + machine. This element is only used for marketplace images. Before you can use a marketplace + image from an API, you must enable the image for programmatic use. In the Azure portal, find + the marketplace image that you want to use and then click **Want to deploy programmatically, + Get Started ->**. Enter any required information and then click **Save**. + :type plan: ~azure.mgmt.compute.v2020_06_01.models.Plan + :ivar resources: The virtual machine child extension resources. + :vartype resources: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtension] + :param identity: The identity of the virtual machine, if configured. + :type identity: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineIdentity + :param zones: The virtual machine zones. + :type zones: list[str] + :param hardware_profile: Specifies the hardware settings for the virtual machine. + :type hardware_profile: ~azure.mgmt.compute.v2020_06_01.models.HardwareProfile + :param storage_profile: Specifies the storage settings for the virtual machine disks. + :type storage_profile: ~azure.mgmt.compute.v2020_06_01.models.StorageProfile + :param additional_capabilities: Specifies additional capabilities enabled or disabled on the + virtual machine. + :type additional_capabilities: ~azure.mgmt.compute.v2020_06_01.models.AdditionalCapabilities + :param os_profile: Specifies the operating system settings used while creating the virtual + machine. Some of the settings cannot be changed once VM is provisioned. + :type os_profile: ~azure.mgmt.compute.v2020_06_01.models.OSProfile + :param network_profile: Specifies the network interfaces of the virtual machine. + :type network_profile: ~azure.mgmt.compute.v2020_06_01.models.NetworkProfile + :param security_profile: Specifies the Security related profile settings for the virtual + machine. + :type security_profile: ~azure.mgmt.compute.v2020_06_01.models.SecurityProfile + :param diagnostics_profile: Specifies the boot diagnostic settings state. + :code:`
    `:code:`
    `Minimum api-version: 2015-06-15. + :type diagnostics_profile: ~azure.mgmt.compute.v2020_06_01.models.DiagnosticsProfile + :param availability_set: Specifies information about the availability set that the virtual + machine should be assigned to. Virtual machines specified in the same availability set are + allocated to different nodes to maximize availability. For more information about availability + sets, see `Manage the availability of virtual machines + `_. :code:`
    `:code:`
    ` + For more information on Azure planned maintenance, see `Planned maintenance for virtual + machines in Azure `_ + :code:`
    `:code:`
    ` Currently, a VM can only be added to availability set at creation + time. The availability set to which the VM is being added should be under the same resource + group as the availability set resource. An existing VM cannot be added to an availability set. + :code:`
    `:code:`
    `This property cannot exist along with a non-null + properties.virtualMachineScaleSet reference. + :type availability_set: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param virtual_machine_scale_set: Specifies information about the virtual machine scale set + that the virtual machine should be assigned to. Virtual machines specified in the same virtual + machine scale set are allocated to different nodes to maximize availability. Currently, a VM + can only be added to virtual machine scale set at creation time. An existing VM cannot be added + to a virtual machine scale set. :code:`
    `:code:`
    `This property cannot exist along with a + non-null properties.availabilitySet reference. :code:`
    `:code:`
    `Minimum api‐version: + 2019‐03‐01. + :type virtual_machine_scale_set: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param proximity_placement_group: Specifies information about the proximity placement group + that the virtual machine should be assigned to. :code:`
    `:code:`
    `Minimum api-version: + 2018-04-01. + :type proximity_placement_group: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param priority: Specifies the priority for the virtual machine. + :code:`
    `:code:`
    `Minimum api-version: 2019-03-01. Possible values include: "Regular", + "Low", "Spot". + :type priority: str or ~azure.mgmt.compute.v2020_06_01.models.VirtualMachinePriorityTypes + :param eviction_policy: Specifies the eviction policy for the Azure Spot virtual machine and + Azure Spot scale set. :code:`
    `:code:`
    `For Azure Spot virtual machines, both + 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01. + :code:`
    `:code:`
    `For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported + and the minimum api-version is 2017-10-30-preview. Possible values include: "Deallocate", + "Delete". + :type eviction_policy: str or + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineEvictionPolicyTypes + :param billing_profile: Specifies the billing related details of a Azure Spot virtual machine. + :code:`
    `:code:`
    `Minimum api-version: 2019-03-01. + :type billing_profile: ~azure.mgmt.compute.v2020_06_01.models.BillingProfile + :param host: Specifies information about the dedicated host that the virtual machine resides + in. :code:`
    `:code:`
    `Minimum api-version: 2018-10-01. + :type host: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param host_group: Specifies information about the dedicated host group that the virtual + machine resides in. :code:`
    `:code:`
    `Minimum api-version: 2020-06-01. + :code:`
    `:code:`
    `NOTE: User cannot specify both host and hostGroup properties. + :type host_group: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :ivar instance_view: The virtual machine instance view. + :vartype instance_view: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineInstanceView + :param license_type: Specifies that the image or disk that is being used was licensed on- + premises. This element is only used for images that contain the Windows Server operating + system. :code:`
    `:code:`
    ` Possible values are: :code:`
    `:code:`
    ` Windows_Client + :code:`
    `:code:`
    ` Windows_Server :code:`
    `:code:`
    ` If this element is included in + a request for an update, the value must match the initial value. This value cannot be updated. + :code:`
    `:code:`
    ` For more information, see `Azure Hybrid Use Benefit for Windows Server + `_ :code:`
    `:code:`
    ` + Minimum api-version: 2015-06-15. + :type license_type: str + :ivar vm_id: Specifies the VM unique ID which is a 128-bits identifier that is encoded and + stored in all Azure IaaS VMs SMBIOS and can be read using platform BIOS commands. + :vartype vm_id: str + :param extensions_time_budget: Specifies the time alloted for all extensions to start. The time + duration should be between 15 minutes and 120 minutes (inclusive) and should be specified in + ISO 8601 format. The default value is 90 minutes (PT1H30M). :code:`
    `:code:`
    ` Minimum + api-version: 2020-06-01. + :type extensions_time_budget: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'resources': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'instance_view': {'readonly': True}, + 'vm_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}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'resources': {'key': 'resources', 'type': '[VirtualMachineExtension]'}, + 'identity': {'key': 'identity', 'type': 'VirtualMachineIdentity'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'hardware_profile': {'key': 'properties.hardwareProfile', 'type': 'HardwareProfile'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, + 'additional_capabilities': {'key': 'properties.additionalCapabilities', 'type': 'AdditionalCapabilities'}, + 'os_profile': {'key': 'properties.osProfile', 'type': 'OSProfile'}, + 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'}, + 'security_profile': {'key': 'properties.securityProfile', 'type': 'SecurityProfile'}, + 'diagnostics_profile': {'key': 'properties.diagnosticsProfile', 'type': 'DiagnosticsProfile'}, + 'availability_set': {'key': 'properties.availabilitySet', 'type': 'SubResource'}, + 'virtual_machine_scale_set': {'key': 'properties.virtualMachineScaleSet', 'type': 'SubResource'}, + 'proximity_placement_group': {'key': 'properties.proximityPlacementGroup', 'type': 'SubResource'}, + 'priority': {'key': 'properties.priority', 'type': 'str'}, + 'eviction_policy': {'key': 'properties.evictionPolicy', 'type': 'str'}, + 'billing_profile': {'key': 'properties.billingProfile', 'type': 'BillingProfile'}, + 'host': {'key': 'properties.host', 'type': 'SubResource'}, + 'host_group': {'key': 'properties.hostGroup', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineInstanceView'}, + 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, + 'vm_id': {'key': 'properties.vmId', 'type': 'str'}, + 'extensions_time_budget': {'key': 'properties.extensionsTimeBudget', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachine, self).__init__(**kwargs) + self.plan = kwargs.get('plan', None) + self.resources = None + self.identity = kwargs.get('identity', None) + self.zones = kwargs.get('zones', None) + self.hardware_profile = kwargs.get('hardware_profile', None) + self.storage_profile = kwargs.get('storage_profile', None) + self.additional_capabilities = kwargs.get('additional_capabilities', None) + self.os_profile = kwargs.get('os_profile', None) + self.network_profile = kwargs.get('network_profile', None) + self.security_profile = kwargs.get('security_profile', None) + self.diagnostics_profile = kwargs.get('diagnostics_profile', None) + self.availability_set = kwargs.get('availability_set', None) + self.virtual_machine_scale_set = kwargs.get('virtual_machine_scale_set', None) + self.proximity_placement_group = kwargs.get('proximity_placement_group', None) + self.priority = kwargs.get('priority', None) + self.eviction_policy = kwargs.get('eviction_policy', None) + self.billing_profile = kwargs.get('billing_profile', None) + self.host = kwargs.get('host', None) + self.host_group = kwargs.get('host_group', None) + self.provisioning_state = None + self.instance_view = None + self.license_type = kwargs.get('license_type', None) + self.vm_id = None + self.extensions_time_budget = kwargs.get('extensions_time_budget', None) + + +class VirtualMachineAgentInstanceView(msrest.serialization.Model): + """The instance view of the VM Agent running on the virtual machine. + + :param vm_agent_version: The VM Agent full version. + :type vm_agent_version: str + :param extension_handlers: The virtual machine extension handler instance view. + :type extension_handlers: + list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtensionHandlerInstanceView] + :param statuses: The resource status information. + :type statuses: list[~azure.mgmt.compute.v2020_06_01.models.InstanceViewStatus] + """ + + _attribute_map = { + 'vm_agent_version': {'key': 'vmAgentVersion', 'type': 'str'}, + 'extension_handlers': {'key': 'extensionHandlers', 'type': '[VirtualMachineExtensionHandlerInstanceView]'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineAgentInstanceView, self).__init__(**kwargs) + self.vm_agent_version = kwargs.get('vm_agent_version', None) + self.extension_handlers = kwargs.get('extension_handlers', None) + self.statuses = kwargs.get('statuses', None) + + +class VirtualMachineAssessPatchesResult(msrest.serialization.Model): + """Describes the properties of an AssessPatches result. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status: The overall success or failure status of the operation. It remains "InProgress" + until the operation completes. At that point it will become "Failed", "Succeeded", or + "CompletedWithWarnings.". Possible values include: "InProgress", "Failed", "Succeeded", + "CompletedWithWarnings". + :vartype status: str or ~azure.mgmt.compute.v2020_06_01.models.PatchOperationStatus + :ivar assessment_activity_id: The activity ID of the operation that produced this result. It is + used to correlate across CRP and extension logs. + :vartype assessment_activity_id: str + :ivar reboot_pending: The overall reboot status of the VM. It will be true when partially + installed patches require a reboot to complete installation but the reboot has not yet + occurred. + :vartype reboot_pending: bool + :ivar critical_and_security_patch_count: The number of critical or security patches that have + been detected as available and not yet installed. + :vartype critical_and_security_patch_count: int + :ivar other_patch_count: The number of all available patches excluding critical and security. + :vartype other_patch_count: int + :ivar start_date_time: The UTC timestamp when the operation began. + :vartype start_date_time: ~datetime.datetime + :ivar patches: The list of patches that have been detected as available for installation. + :vartype patches: + list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineSoftwarePatchProperties] + :ivar error: The errors that were encountered during execution of the operation. The details + array contains the list of them. + :vartype error: ~azure.mgmt.compute.v2020_06_01.models.ApiError + """ + + _validation = { + 'status': {'readonly': True}, + 'assessment_activity_id': {'readonly': True}, + 'reboot_pending': {'readonly': True}, + 'critical_and_security_patch_count': {'readonly': True}, + 'other_patch_count': {'readonly': True}, + 'start_date_time': {'readonly': True}, + 'patches': {'readonly': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'assessment_activity_id': {'key': 'assessmentActivityId', 'type': 'str'}, + 'reboot_pending': {'key': 'rebootPending', 'type': 'bool'}, + 'critical_and_security_patch_count': {'key': 'criticalAndSecurityPatchCount', 'type': 'int'}, + 'other_patch_count': {'key': 'otherPatchCount', 'type': 'int'}, + 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, + 'patches': {'key': 'patches', 'type': '[VirtualMachineSoftwarePatchProperties]'}, + 'error': {'key': 'error', 'type': 'ApiError'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineAssessPatchesResult, self).__init__(**kwargs) + self.status = None + self.assessment_activity_id = None + self.reboot_pending = None + self.critical_and_security_patch_count = None + self.other_patch_count = None + self.start_date_time = None + self.patches = None + self.error = None + + +class VirtualMachineCaptureParameters(msrest.serialization.Model): + """Capture Virtual Machine parameters. + + All required parameters must be populated in order to send to Azure. + + :param vhd_prefix: Required. The captured virtual hard disk's name prefix. + :type vhd_prefix: str + :param destination_container_name: Required. The destination container name. + :type destination_container_name: str + :param overwrite_vhds: Required. Specifies whether to overwrite the destination virtual hard + disk, in case of conflict. + :type overwrite_vhds: bool + """ + + _validation = { + 'vhd_prefix': {'required': True}, + 'destination_container_name': {'required': True}, + 'overwrite_vhds': {'required': True}, + } + + _attribute_map = { + 'vhd_prefix': {'key': 'vhdPrefix', 'type': 'str'}, + 'destination_container_name': {'key': 'destinationContainerName', 'type': 'str'}, + 'overwrite_vhds': {'key': 'overwriteVhds', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineCaptureParameters, self).__init__(**kwargs) + self.vhd_prefix = kwargs['vhd_prefix'] + self.destination_container_name = kwargs['destination_container_name'] + self.overwrite_vhds = kwargs['overwrite_vhds'] + + +class VirtualMachineCaptureResult(SubResource): + """Output of virtual machine capture operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource Id. + :type id: str + :ivar schema: the schema of the captured virtual machine. + :vartype schema: str + :ivar content_version: the version of the content. + :vartype content_version: str + :ivar parameters: parameters of the captured virtual machine. + :vartype parameters: object + :ivar resources: a list of resource items of the captured virtual machine. + :vartype resources: list[object] + """ + + _validation = { + 'schema': {'readonly': True}, + 'content_version': {'readonly': True}, + 'parameters': {'readonly': True}, + 'resources': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'schema': {'key': '$schema', 'type': 'str'}, + 'content_version': {'key': 'contentVersion', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'object'}, + 'resources': {'key': 'resources', 'type': '[object]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineCaptureResult, self).__init__(**kwargs) + self.schema = None + self.content_version = None + self.parameters = None + self.resources = None + + +class VirtualMachineExtension(Resource): + """Describes a Virtual Machine Extension. + + 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 force_update_tag: How the extension handler should be forced to update even if the + extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type_properties_type: Specifies the type of the extension; an example is + "CustomScriptExtension". + :type type_properties_type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param auto_upgrade_minor_version: Indicates whether the extension should use a newer minor + version if one is available at deployment time. Once deployed, however, the extension will not + upgrade minor versions unless redeployed, even with this property set to true. + :type auto_upgrade_minor_version: bool + :param enable_automatic_upgrade: Indicates whether the extension should be automatically + upgraded by the platform if there is a newer version of the extension available. + :type enable_automatic_upgrade: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: object + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :param instance_view: The virtual machine extension instance view. + :type instance_view: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtensionInstanceView + """ + + _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}'}, + 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'properties.publisher', 'type': 'str'}, + 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, + 'type_handler_version': {'key': 'properties.typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'enable_automatic_upgrade': {'key': 'properties.enableAutomaticUpgrade', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': 'object'}, + 'protected_settings': {'key': 'properties.protectedSettings', 'type': 'object'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineExtensionInstanceView'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineExtension, self).__init__(**kwargs) + self.force_update_tag = kwargs.get('force_update_tag', None) + self.publisher = kwargs.get('publisher', None) + self.type_properties_type = kwargs.get('type_properties_type', None) + self.type_handler_version = kwargs.get('type_handler_version', None) + self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) + self.enable_automatic_upgrade = kwargs.get('enable_automatic_upgrade', None) + self.settings = kwargs.get('settings', None) + self.protected_settings = kwargs.get('protected_settings', None) + self.provisioning_state = None + self.instance_view = kwargs.get('instance_view', None) + + +class VirtualMachineExtensionHandlerInstanceView(msrest.serialization.Model): + """The instance view of a virtual machine extension handler. + + :param type: Specifies the type of the extension; an example is "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param status: The extension handler status. + :type status: ~azure.mgmt.compute.v2020_06_01.models.InstanceViewStatus + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'InstanceViewStatus'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineExtensionHandlerInstanceView, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.type_handler_version = kwargs.get('type_handler_version', None) + self.status = kwargs.get('status', None) + + +class VirtualMachineExtensionImage(Resource): + """Describes a Virtual Machine Extension 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 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 operating_system: The operating system this extension supports. + :type operating_system: str + :param compute_role: The type of role (IaaS or PaaS) this extension supports. + :type compute_role: str + :param handler_schema: The schema defined by publisher, where extension consumers should + provide settings in a matching schema. + :type handler_schema: str + :param vm_scale_set_enabled: Whether the extension can be used on xRP VMScaleSets. By default + existing extensions are usable on scalesets, but there might be cases where a publisher wants + to explicitly indicate the extension is only enabled for CRP VMs but not VMSS. + :type vm_scale_set_enabled: bool + :param supports_multiple_extensions: Whether the handler can support multiple extensions. + :type supports_multiple_extensions: bool + """ + + _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}'}, + 'operating_system': {'key': 'properties.operatingSystem', 'type': 'str'}, + 'compute_role': {'key': 'properties.computeRole', 'type': 'str'}, + 'handler_schema': {'key': 'properties.handlerSchema', 'type': 'str'}, + 'vm_scale_set_enabled': {'key': 'properties.vmScaleSetEnabled', 'type': 'bool'}, + 'supports_multiple_extensions': {'key': 'properties.supportsMultipleExtensions', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineExtensionImage, self).__init__(**kwargs) + self.operating_system = kwargs.get('operating_system', None) + self.compute_role = kwargs.get('compute_role', None) + self.handler_schema = kwargs.get('handler_schema', None) + self.vm_scale_set_enabled = kwargs.get('vm_scale_set_enabled', None) + self.supports_multiple_extensions = kwargs.get('supports_multiple_extensions', None) + + +class VirtualMachineExtensionInstanceView(msrest.serialization.Model): + """The instance view of a virtual machine extension. + + :param name: The virtual machine extension name. + :type name: str + :param type: Specifies the type of the extension; an example is "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param substatuses: The resource status information. + :type substatuses: list[~azure.mgmt.compute.v2020_06_01.models.InstanceViewStatus] + :param statuses: The resource status information. + :type statuses: list[~azure.mgmt.compute.v2020_06_01.models.InstanceViewStatus] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'substatuses': {'key': 'substatuses', 'type': '[InstanceViewStatus]'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineExtensionInstanceView, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + self.type_handler_version = kwargs.get('type_handler_version', None) + self.substatuses = kwargs.get('substatuses', None) + self.statuses = kwargs.get('statuses', None) + + +class VirtualMachineExtensionsListResult(msrest.serialization.Model): + """The List Extension operation response. + + :param value: The list of extensions. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtension] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualMachineExtension]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineExtensionsListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class VirtualMachineExtensionUpdate(UpdateResource): + """Describes a Virtual Machine Extension. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param force_update_tag: How the extension handler should be forced to update even if the + extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type: Specifies the type of the extension; an example is "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param auto_upgrade_minor_version: Indicates whether the extension should use a newer minor + version if one is available at deployment time. Once deployed, however, the extension will not + upgrade minor versions unless redeployed, even with this property set to true. + :type auto_upgrade_minor_version: bool + :param enable_automatic_upgrade: Indicates whether the extension should be automatically + upgraded by the platform if there is a newer version of the extension available. + :type enable_automatic_upgrade: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: object + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'properties.publisher', 'type': 'str'}, + 'type': {'key': 'properties.type', 'type': 'str'}, + 'type_handler_version': {'key': 'properties.typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'enable_automatic_upgrade': {'key': 'properties.enableAutomaticUpgrade', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': 'object'}, + 'protected_settings': {'key': 'properties.protectedSettings', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineExtensionUpdate, self).__init__(**kwargs) + self.force_update_tag = kwargs.get('force_update_tag', None) + self.publisher = kwargs.get('publisher', None) + self.type = kwargs.get('type', None) + self.type_handler_version = kwargs.get('type_handler_version', None) + self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) + self.enable_automatic_upgrade = kwargs.get('enable_automatic_upgrade', None) + self.settings = kwargs.get('settings', None) + self.protected_settings = kwargs.get('protected_settings', None) + + +class VirtualMachineHealthStatus(msrest.serialization.Model): + """The health status of the VM. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status: The health status information for the VM. + :vartype status: ~azure.mgmt.compute.v2020_06_01.models.InstanceViewStatus + """ + + _validation = { + 'status': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'InstanceViewStatus'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineHealthStatus, self).__init__(**kwargs) + self.status = None + + +class VirtualMachineIdentity(msrest.serialization.Model): + """Identity for the virtual machine. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of virtual machine identity. This property will only be + provided for a system assigned identity. + :vartype principal_id: str + :ivar tenant_id: The tenant id associated with the virtual machine. This property will only be + provided for a system assigned identity. + :vartype tenant_id: str + :param type: The type of identity used for the virtual machine. The type 'SystemAssigned, + UserAssigned' includes both an implicitly created identity and a set of user assigned + identities. The type 'None' will remove any identities from the virtual machine. Possible + values include: "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned", "None". + :type type: str or ~azure.mgmt.compute.v2020_06_01.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated with the Virtual + Machine. The user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.compute.v2020_06_01.models.Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs.get('type', None) + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + + +class VirtualMachineImageResource(SubResource): + """Virtual machine image resource information. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource Id. + :type id: str + :param name: Required. The name of the resource. + :type name: str + :param location: Required. The supported Azure location of the resource. + :type location: str + :param tags: A set of tags. Specifies the tags that are assigned to the virtual machine. For + more information about using tags, see `Using tags to organize your Azure resources + `_. + :type tags: dict[str, str] + """ + + _validation = { + 'name': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineImageResource, self).__init__(**kwargs) + self.name = kwargs['name'] + self.location = kwargs['location'] + self.tags = kwargs.get('tags', None) + + +class VirtualMachineImage(VirtualMachineImageResource): + """Describes a Virtual Machine Image. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource Id. + :type id: str + :param name: Required. The name of the resource. + :type name: str + :param location: Required. The supported Azure location of the resource. + :type location: str + :param tags: A set of tags. Specifies the tags that are assigned to the virtual machine. For + more information about using tags, see `Using tags to organize your Azure resources + `_. + :type tags: dict[str, str] + :param plan: Used for establishing the purchase context of any 3rd Party artifact through + MarketPlace. + :type plan: ~azure.mgmt.compute.v2020_06_01.models.PurchasePlan + :param os_disk_image: Contains the os disk image information. + :type os_disk_image: ~azure.mgmt.compute.v2020_06_01.models.OSDiskImage + :param data_disk_images: + :type data_disk_images: list[~azure.mgmt.compute.v2020_06_01.models.DataDiskImage] + :param automatic_os_upgrade_properties: Describes automatic OS upgrade properties on the image. + :type automatic_os_upgrade_properties: + ~azure.mgmt.compute.v2020_06_01.models.AutomaticOSUpgradeProperties + :param hyper_v_generation: Specifies the HyperVGeneration Type. Possible values include: "V1", + "V2". + :type hyper_v_generation: str or ~azure.mgmt.compute.v2020_06_01.models.HyperVGenerationTypes + :param disallowed: Specifies disallowed configuration for the VirtualMachine created from the + image. + :type disallowed: ~azure.mgmt.compute.v2020_06_01.models.DisallowedConfiguration + """ + + _validation = { + 'name': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'properties.plan', 'type': 'PurchasePlan'}, + 'os_disk_image': {'key': 'properties.osDiskImage', 'type': 'OSDiskImage'}, + 'data_disk_images': {'key': 'properties.dataDiskImages', 'type': '[DataDiskImage]'}, + 'automatic_os_upgrade_properties': {'key': 'properties.automaticOSUpgradeProperties', 'type': 'AutomaticOSUpgradeProperties'}, + 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, + 'disallowed': {'key': 'properties.disallowed', 'type': 'DisallowedConfiguration'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineImage, self).__init__(**kwargs) + self.plan = kwargs.get('plan', None) + self.os_disk_image = kwargs.get('os_disk_image', None) + self.data_disk_images = kwargs.get('data_disk_images', None) + self.automatic_os_upgrade_properties = kwargs.get('automatic_os_upgrade_properties', None) + self.hyper_v_generation = kwargs.get('hyper_v_generation', None) + self.disallowed = kwargs.get('disallowed', None) + + +class VirtualMachineInstanceView(msrest.serialization.Model): + """The instance view of a virtual machine. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param platform_update_domain: Specifies the update domain of the virtual machine. + :type platform_update_domain: int + :param platform_fault_domain: Specifies the fault domain of the virtual machine. + :type platform_fault_domain: int + :param computer_name: The computer name assigned to the virtual machine. + :type computer_name: str + :param os_name: The Operating System running on the virtual machine. + :type os_name: str + :param os_version: The version of Operating System running on the virtual machine. + :type os_version: str + :param hyper_v_generation: Specifies the HyperVGeneration Type associated with a resource. + Possible values include: "V1", "V2". + :type hyper_v_generation: str or ~azure.mgmt.compute.v2020_06_01.models.HyperVGenerationType + :param rdp_thumb_print: The Remote desktop certificate thumbprint. + :type rdp_thumb_print: str + :param vm_agent: The VM Agent running on the virtual machine. + :type vm_agent: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineAgentInstanceView + :param maintenance_redeploy_status: The Maintenance Operation status on the virtual machine. + :type maintenance_redeploy_status: + ~azure.mgmt.compute.v2020_06_01.models.MaintenanceRedeployStatus + :param disks: The virtual machine disk information. + :type disks: list[~azure.mgmt.compute.v2020_06_01.models.DiskInstanceView] + :param extensions: The extensions information. + :type extensions: + list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtensionInstanceView] + :ivar vm_health: The health status for the VM. + :vartype vm_health: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineHealthStatus + :param boot_diagnostics: Boot Diagnostics is a debugging feature which allows you to view + Console Output and Screenshot to diagnose VM status. :code:`
    `:code:`
    ` You can easily + view the output of your console log. :code:`
    `:code:`
    ` Azure also enables you to see a + screenshot of the VM from the hypervisor. + :type boot_diagnostics: ~azure.mgmt.compute.v2020_06_01.models.BootDiagnosticsInstanceView + :ivar assigned_host: Resource id of the dedicated host, on which the virtual machine is + allocated through automatic placement, when the virtual machine is associated with a dedicated + host group that has automatic placement enabled. :code:`
    `:code:`
    `Minimum api-version: + 2020-06-01. + :vartype assigned_host: str + :param statuses: The resource status information. + :type statuses: list[~azure.mgmt.compute.v2020_06_01.models.InstanceViewStatus] + :param patch_status: The status of virtual machine patch operations. + :type patch_status: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachinePatchStatus + """ + + _validation = { + 'vm_health': {'readonly': True}, + 'assigned_host': {'readonly': True}, + } + + _attribute_map = { + 'platform_update_domain': {'key': 'platformUpdateDomain', 'type': 'int'}, + 'platform_fault_domain': {'key': 'platformFaultDomain', 'type': 'int'}, + 'computer_name': {'key': 'computerName', 'type': 'str'}, + 'os_name': {'key': 'osName', 'type': 'str'}, + 'os_version': {'key': 'osVersion', 'type': 'str'}, + 'hyper_v_generation': {'key': 'hyperVGeneration', 'type': 'str'}, + 'rdp_thumb_print': {'key': 'rdpThumbPrint', 'type': 'str'}, + 'vm_agent': {'key': 'vmAgent', 'type': 'VirtualMachineAgentInstanceView'}, + 'maintenance_redeploy_status': {'key': 'maintenanceRedeployStatus', 'type': 'MaintenanceRedeployStatus'}, + 'disks': {'key': 'disks', 'type': '[DiskInstanceView]'}, + 'extensions': {'key': 'extensions', 'type': '[VirtualMachineExtensionInstanceView]'}, + 'vm_health': {'key': 'vmHealth', 'type': 'VirtualMachineHealthStatus'}, + 'boot_diagnostics': {'key': 'bootDiagnostics', 'type': 'BootDiagnosticsInstanceView'}, + 'assigned_host': {'key': 'assignedHost', 'type': 'str'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + 'patch_status': {'key': 'patchStatus', 'type': 'VirtualMachinePatchStatus'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineInstanceView, self).__init__(**kwargs) + self.platform_update_domain = kwargs.get('platform_update_domain', None) + self.platform_fault_domain = kwargs.get('platform_fault_domain', None) + self.computer_name = kwargs.get('computer_name', None) + self.os_name = kwargs.get('os_name', None) + self.os_version = kwargs.get('os_version', None) + self.hyper_v_generation = kwargs.get('hyper_v_generation', None) + self.rdp_thumb_print = kwargs.get('rdp_thumb_print', None) + self.vm_agent = kwargs.get('vm_agent', None) + self.maintenance_redeploy_status = kwargs.get('maintenance_redeploy_status', None) + self.disks = kwargs.get('disks', None) + self.extensions = kwargs.get('extensions', None) + self.vm_health = None + self.boot_diagnostics = kwargs.get('boot_diagnostics', None) + self.assigned_host = None + self.statuses = kwargs.get('statuses', None) + self.patch_status = kwargs.get('patch_status', None) + + +class VirtualMachineListResult(msrest.serialization.Model): + """The List Virtual Machine operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of virtual machines. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachine] + :param next_link: The URI to fetch the next page of VMs. Call ListNext() with this URI to fetch + the next page of Virtual Machines. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualMachine]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineListResult, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class VirtualMachinePatchStatus(msrest.serialization.Model): + """The status of virtual machine patch operations. + + :param available_patch_summary: The available patch summary of the latest assessment operation + for the virtual machine. + :type available_patch_summary: ~azure.mgmt.compute.v2020_06_01.models.AvailablePatchSummary + :param last_patch_installation_summary: The installation summary of the latest installation + operation for the virtual machine. + :type last_patch_installation_summary: + ~azure.mgmt.compute.v2020_06_01.models.LastPatchInstallationSummary + """ + + _attribute_map = { + 'available_patch_summary': {'key': 'availablePatchSummary', 'type': 'AvailablePatchSummary'}, + 'last_patch_installation_summary': {'key': 'lastPatchInstallationSummary', 'type': 'LastPatchInstallationSummary'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachinePatchStatus, self).__init__(**kwargs) + self.available_patch_summary = kwargs.get('available_patch_summary', None) + self.last_patch_installation_summary = kwargs.get('last_patch_installation_summary', None) + + +class VirtualMachineReimageParameters(msrest.serialization.Model): + """Parameters for Reimaging Virtual Machine. NOTE: Virtual Machine OS disk will always be reimaged. + + :param temp_disk: Specifies whether to reimage temp disk. Default value: false. Note: This temp + disk reimage parameter is only supported for VM/VMSS with Ephemeral OS disk. + :type temp_disk: bool + """ + + _attribute_map = { + 'temp_disk': {'key': 'tempDisk', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineReimageParameters, self).__init__(**kwargs) + self.temp_disk = kwargs.get('temp_disk', None) + + +class VirtualMachineScaleSet(Resource): + """Describes a Virtual Machine Scale Set. + + 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 sku: The virtual machine scale set sku. + :type sku: ~azure.mgmt.compute.v2020_06_01.models.Sku + :param plan: Specifies information about the marketplace image used to create the virtual + machine. This element is only used for marketplace images. Before you can use a marketplace + image from an API, you must enable the image for programmatic use. In the Azure portal, find + the marketplace image that you want to use and then click **Want to deploy programmatically, + Get Started ->**. Enter any required information and then click **Save**. + :type plan: ~azure.mgmt.compute.v2020_06_01.models.Plan + :param identity: The identity of the virtual machine scale set, if configured. + :type identity: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetIdentity + :param zones: The virtual machine scale set zones. NOTE: Availability zones can only be set + when you create the scale set. + :type zones: list[str] + :param upgrade_policy: The upgrade policy. + :type upgrade_policy: ~azure.mgmt.compute.v2020_06_01.models.UpgradePolicy + :param automatic_repairs_policy: Policy for automatic repairs. + :type automatic_repairs_policy: ~azure.mgmt.compute.v2020_06_01.models.AutomaticRepairsPolicy + :param virtual_machine_profile: The virtual machine profile. + :type virtual_machine_profile: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMProfile + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :param overprovision: Specifies whether the Virtual Machine Scale Set should be + overprovisioned. + :type overprovision: bool + :param do_not_run_extensions_on_overprovisioned_v_ms: When Overprovision is enabled, extensions + are launched only on the requested number of VMs which are finally kept. This property will + hence ensure that the extensions do not run on the extra overprovisioned VMs. + :type do_not_run_extensions_on_overprovisioned_v_ms: bool + :ivar unique_id: Specifies the ID which uniquely identifies a Virtual Machine Scale Set. + :vartype unique_id: str + :param single_placement_group: When true this limits the scale set to a single placement group, + of max size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to + false. However, if singlePlacementGroup is false, it may not be modified to true. + :type single_placement_group: bool + :param zone_balance: Whether to force strictly even Virtual Machine distribution cross x-zones + in case there is zone outage. + :type zone_balance: bool + :param platform_fault_domain_count: Fault Domain count for each placement group. + :type platform_fault_domain_count: int + :param proximity_placement_group: Specifies information about the proximity placement group + that the virtual machine scale set should be assigned to. :code:`
    `:code:`
    `Minimum api- + version: 2018-04-01. + :type proximity_placement_group: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param host_group: Specifies information about the dedicated host group that the virtual + machine scale set resides in. :code:`
    `:code:`
    `Minimum api-version: 2020-06-01. + :type host_group: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param additional_capabilities: Specifies additional capabilities enabled or disabled on the + Virtual Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines + have the capability to support attaching managed data disks with UltraSSD_LRS storage account + type. + :type additional_capabilities: ~azure.mgmt.compute.v2020_06_01.models.AdditionalCapabilities + :param scale_in_policy: Specifies the scale-in policy that decides which virtual machines are + chosen for removal when a Virtual Machine Scale Set is scaled-in. + :type scale_in_policy: ~azure.mgmt.compute.v2020_06_01.models.ScaleInPolicy + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'unique_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}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'identity': {'key': 'identity', 'type': 'VirtualMachineScaleSetIdentity'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'upgrade_policy': {'key': 'properties.upgradePolicy', 'type': 'UpgradePolicy'}, + 'automatic_repairs_policy': {'key': 'properties.automaticRepairsPolicy', 'type': 'AutomaticRepairsPolicy'}, + 'virtual_machine_profile': {'key': 'properties.virtualMachineProfile', 'type': 'VirtualMachineScaleSetVMProfile'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'overprovision': {'key': 'properties.overprovision', 'type': 'bool'}, + 'do_not_run_extensions_on_overprovisioned_v_ms': {'key': 'properties.doNotRunExtensionsOnOverprovisionedVMs', 'type': 'bool'}, + 'unique_id': {'key': 'properties.uniqueId', 'type': 'str'}, + 'single_placement_group': {'key': 'properties.singlePlacementGroup', 'type': 'bool'}, + 'zone_balance': {'key': 'properties.zoneBalance', 'type': 'bool'}, + 'platform_fault_domain_count': {'key': 'properties.platformFaultDomainCount', 'type': 'int'}, + 'proximity_placement_group': {'key': 'properties.proximityPlacementGroup', 'type': 'SubResource'}, + 'host_group': {'key': 'properties.hostGroup', 'type': 'SubResource'}, + 'additional_capabilities': {'key': 'properties.additionalCapabilities', 'type': 'AdditionalCapabilities'}, + 'scale_in_policy': {'key': 'properties.scaleInPolicy', 'type': 'ScaleInPolicy'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSet, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.plan = kwargs.get('plan', None) + self.identity = kwargs.get('identity', None) + self.zones = kwargs.get('zones', None) + self.upgrade_policy = kwargs.get('upgrade_policy', None) + self.automatic_repairs_policy = kwargs.get('automatic_repairs_policy', None) + self.virtual_machine_profile = kwargs.get('virtual_machine_profile', None) + self.provisioning_state = None + self.overprovision = kwargs.get('overprovision', None) + self.do_not_run_extensions_on_overprovisioned_v_ms = kwargs.get('do_not_run_extensions_on_overprovisioned_v_ms', None) + self.unique_id = None + self.single_placement_group = kwargs.get('single_placement_group', None) + self.zone_balance = kwargs.get('zone_balance', None) + self.platform_fault_domain_count = kwargs.get('platform_fault_domain_count', None) + self.proximity_placement_group = kwargs.get('proximity_placement_group', None) + self.host_group = kwargs.get('host_group', None) + self.additional_capabilities = kwargs.get('additional_capabilities', None) + self.scale_in_policy = kwargs.get('scale_in_policy', None) + + +class VirtualMachineScaleSetDataDisk(msrest.serialization.Model): + """Describes a virtual machine scale set data disk. + + All required parameters must be populated in order to send to Azure. + + :param name: The disk name. + :type name: str + :param lun: Required. Specifies the logical unit number of the data disk. This value is used to + identify data disks within the VM and therefore must be unique for each data disk attached to a + VM. + :type lun: int + :param caching: Specifies the caching requirements. :code:`
    `:code:`
    ` Possible values + are: :code:`
    `:code:`
    ` **None** :code:`
    `:code:`
    ` **ReadOnly** + :code:`
    `:code:`
    ` **ReadWrite** :code:`
    `:code:`
    ` Default: **None for Standard + storage. ReadOnly for Premium storage**. Possible values include: "None", "ReadOnly", + "ReadWrite". + :type caching: str or ~azure.mgmt.compute.v2020_06_01.models.CachingTypes + :param write_accelerator_enabled: Specifies whether writeAccelerator should be enabled or + disabled on the disk. + :type write_accelerator_enabled: bool + :param create_option: Required. The create option. Possible values include: "FromImage", + "Empty", "Attach". + :type create_option: str or ~azure.mgmt.compute.v2020_06_01.models.DiskCreateOptionTypes + :param disk_size_gb: Specifies the size of an empty data disk in gigabytes. This element can be + used to overwrite the size of the disk in a virtual machine image. :code:`
    `:code:`
    ` + This value cannot be larger than 1023 GB. + :type disk_size_gb: int + :param managed_disk: The managed disk parameters. + :type managed_disk: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetManagedDiskParameters + :param disk_iops_read_write: Specifies the Read-Write IOPS for the managed disk. Should be used + only when StorageAccountType is UltraSSD_LRS. If not specified, a default value would be + assigned based on diskSizeGB. + :type disk_iops_read_write: long + :param disk_m_bps_read_write: Specifies the bandwidth in MB per second for the managed disk. + Should be used only when StorageAccountType is UltraSSD_LRS. If not specified, a default value + would be assigned based on diskSizeGB. + :type disk_m_bps_read_write: long + """ + + _validation = { + 'lun': {'required': True}, + 'create_option': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'lun': {'key': 'lun', 'type': 'int'}, + 'caching': {'key': 'caching', 'type': 'str'}, + 'write_accelerator_enabled': {'key': 'writeAcceleratorEnabled', 'type': 'bool'}, + 'create_option': {'key': 'createOption', 'type': 'str'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + 'managed_disk': {'key': 'managedDisk', 'type': 'VirtualMachineScaleSetManagedDiskParameters'}, + 'disk_iops_read_write': {'key': 'diskIOPSReadWrite', 'type': 'long'}, + 'disk_m_bps_read_write': {'key': 'diskMBpsReadWrite', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetDataDisk, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.lun = kwargs['lun'] + self.caching = kwargs.get('caching', None) + self.write_accelerator_enabled = kwargs.get('write_accelerator_enabled', None) + self.create_option = kwargs['create_option'] + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.managed_disk = kwargs.get('managed_disk', 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) + + +class VirtualMachineScaleSetExtension(SubResourceReadOnly): + """Describes a Virtual Machine Scale Set Extension. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :param name: The name of the extension. + :type name: str + :ivar type: Resource type. + :vartype type: str + :param force_update_tag: If a value is provided and is different from the previous value, the + extension handler will be forced to update even if the extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type_properties_type: Specifies the type of the extension; an example is + "CustomScriptExtension". + :type type_properties_type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param auto_upgrade_minor_version: Indicates whether the extension should use a newer minor + version if one is available at deployment time. Once deployed, however, the extension will not + upgrade minor versions unless redeployed, even with this property set to true. + :type auto_upgrade_minor_version: bool + :param enable_automatic_upgrade: Indicates whether the extension should be automatically + upgraded by the platform if there is a newer version of the extension available. + :type enable_automatic_upgrade: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: object + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :param provision_after_extensions: Collection of extension names after which this extension + needs to be provisioned. + :type provision_after_extensions: list[str] + """ + + _validation = { + 'id': {'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'}, + 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'properties.publisher', 'type': 'str'}, + 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, + 'type_handler_version': {'key': 'properties.typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'enable_automatic_upgrade': {'key': 'properties.enableAutomaticUpgrade', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': 'object'}, + 'protected_settings': {'key': 'properties.protectedSettings', 'type': 'object'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'provision_after_extensions': {'key': 'properties.provisionAfterExtensions', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetExtension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = None + self.force_update_tag = kwargs.get('force_update_tag', None) + self.publisher = kwargs.get('publisher', None) + self.type_properties_type = kwargs.get('type_properties_type', None) + self.type_handler_version = kwargs.get('type_handler_version', None) + self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) + self.enable_automatic_upgrade = kwargs.get('enable_automatic_upgrade', None) + self.settings = kwargs.get('settings', None) + self.protected_settings = kwargs.get('protected_settings', None) + self.provisioning_state = None + self.provision_after_extensions = kwargs.get('provision_after_extensions', None) + + +class VirtualMachineScaleSetExtensionListResult(msrest.serialization.Model): + """The List VM scale set extension operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of VM scale set extensions. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetExtension] + :param next_link: The uri to fetch the next page of VM scale set extensions. Call ListNext() + with this to fetch the next page of VM scale set extensions. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualMachineScaleSetExtension]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetExtensionListResult, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class VirtualMachineScaleSetExtensionProfile(msrest.serialization.Model): + """Describes a virtual machine scale set extension profile. + + :param extensions: The virtual machine scale set child extension resources. + :type extensions: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetExtension] + :param extensions_time_budget: Specifies the time alloted for all extensions to start. The time + duration should be between 15 minutes and 120 minutes (inclusive) and should be specified in + ISO 8601 format. The default value is 90 minutes (PT1H30M). :code:`
    `:code:`
    ` Minimum + api-version: 2020-06-01. + :type extensions_time_budget: str + """ + + _attribute_map = { + 'extensions': {'key': 'extensions', 'type': '[VirtualMachineScaleSetExtension]'}, + 'extensions_time_budget': {'key': 'extensionsTimeBudget', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetExtensionProfile, self).__init__(**kwargs) + self.extensions = kwargs.get('extensions', None) + self.extensions_time_budget = kwargs.get('extensions_time_budget', None) + + +class VirtualMachineScaleSetExtensionUpdate(SubResourceReadOnly): + """Describes a Virtual Machine Scale Set Extension. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: The name of the extension. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param force_update_tag: If a value is provided and is different from the previous value, the + extension handler will be forced to update even if the extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type_properties_type: Specifies the type of the extension; an example is + "CustomScriptExtension". + :type type_properties_type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param auto_upgrade_minor_version: Indicates whether the extension should use a newer minor + version if one is available at deployment time. Once deployed, however, the extension will not + upgrade minor versions unless redeployed, even with this property set to true. + :type auto_upgrade_minor_version: bool + :param enable_automatic_upgrade: Indicates whether the extension should be automatically + upgraded by the platform if there is a newer version of the extension available. + :type enable_automatic_upgrade: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: object + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :param provision_after_extensions: Collection of extension names after which this extension + needs to be provisioned. + :type provision_after_extensions: list[str] + """ + + _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'}, + 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'properties.publisher', 'type': 'str'}, + 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, + 'type_handler_version': {'key': 'properties.typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'enable_automatic_upgrade': {'key': 'properties.enableAutomaticUpgrade', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': 'object'}, + 'protected_settings': {'key': 'properties.protectedSettings', 'type': 'object'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'provision_after_extensions': {'key': 'properties.provisionAfterExtensions', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetExtensionUpdate, self).__init__(**kwargs) + self.name = None + self.type = None + self.force_update_tag = kwargs.get('force_update_tag', None) + self.publisher = kwargs.get('publisher', None) + self.type_properties_type = kwargs.get('type_properties_type', None) + self.type_handler_version = kwargs.get('type_handler_version', None) + self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) + self.enable_automatic_upgrade = kwargs.get('enable_automatic_upgrade', None) + self.settings = kwargs.get('settings', None) + self.protected_settings = kwargs.get('protected_settings', None) + self.provisioning_state = None + self.provision_after_extensions = kwargs.get('provision_after_extensions', None) + + +class VirtualMachineScaleSetIdentity(msrest.serialization.Model): + """Identity for the virtual machine scale set. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of virtual machine scale set identity. This property will + only be provided for a system assigned identity. + :vartype principal_id: str + :ivar tenant_id: The tenant id associated with the virtual machine scale set. This property + will only be provided for a system assigned identity. + :vartype tenant_id: str + :param type: The type of identity used for the virtual machine scale set. The type + 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user + assigned identities. The type 'None' will remove any identities from the virtual machine scale + set. Possible values include: "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned", + "None". + :type type: str or ~azure.mgmt.compute.v2020_06_01.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated with the virtual + machine scale set. The user identity dictionary key references will be ARM resource ids in the + form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.compute.v2020_06_01.models.ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs.get('type', None) + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + + +class VirtualMachineScaleSetInstanceView(msrest.serialization.Model): + """The instance view of a virtual machine scale set. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar virtual_machine: The instance view status summary for the virtual machine scale set. + :vartype virtual_machine: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetInstanceViewStatusesSummary + :ivar extensions: The extensions information. + :vartype extensions: + list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMExtensionsSummary] + :param statuses: The resource status information. + :type statuses: list[~azure.mgmt.compute.v2020_06_01.models.InstanceViewStatus] + :ivar orchestration_services: The orchestration services information. + :vartype orchestration_services: + list[~azure.mgmt.compute.v2020_06_01.models.OrchestrationServiceSummary] + """ + + _validation = { + 'virtual_machine': {'readonly': True}, + 'extensions': {'readonly': True}, + 'orchestration_services': {'readonly': True}, + } + + _attribute_map = { + 'virtual_machine': {'key': 'virtualMachine', 'type': 'VirtualMachineScaleSetInstanceViewStatusesSummary'}, + 'extensions': {'key': 'extensions', 'type': '[VirtualMachineScaleSetVMExtensionsSummary]'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + 'orchestration_services': {'key': 'orchestrationServices', 'type': '[OrchestrationServiceSummary]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetInstanceView, self).__init__(**kwargs) + self.virtual_machine = None + self.extensions = None + self.statuses = kwargs.get('statuses', None) + self.orchestration_services = None + + +class VirtualMachineScaleSetInstanceViewStatusesSummary(msrest.serialization.Model): + """Instance view statuses summary for virtual machines of a virtual machine scale set. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar statuses_summary: The extensions information. + :vartype statuses_summary: + list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineStatusCodeCount] + """ + + _validation = { + 'statuses_summary': {'readonly': True}, + } + + _attribute_map = { + 'statuses_summary': {'key': 'statusesSummary', 'type': '[VirtualMachineStatusCodeCount]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetInstanceViewStatusesSummary, self).__init__(**kwargs) + self.statuses_summary = None + + +class VirtualMachineScaleSetIPConfiguration(SubResource): + """Describes a virtual machine scale set network profile's IP configuration. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource Id. + :type id: str + :param name: Required. The IP configuration name. + :type name: str + :param subnet: Specifies the identifier of the subnet. + :type subnet: ~azure.mgmt.compute.v2020_06_01.models.ApiEntityReference + :param primary: Specifies the primary network interface in case the virtual machine has more + than 1 network interface. + :type primary: bool + :param public_ip_address_configuration: The publicIPAddressConfiguration. + :type public_ip_address_configuration: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetPublicIPAddressConfiguration + :param private_ip_address_version: Available from Api-Version 2017-03-30 onwards, it represents + whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible + values are: 'IPv4' and 'IPv6'. Possible values include: "IPv4", "IPv6". + :type private_ip_address_version: str or ~azure.mgmt.compute.v2020_06_01.models.IPVersion + :param application_gateway_backend_address_pools: Specifies an array of references to backend + address pools of application gateways. A scale set can reference backend address pools of + multiple application gateways. Multiple scale sets cannot use the same application gateway. + :type application_gateway_backend_address_pools: + list[~azure.mgmt.compute.v2020_06_01.models.SubResource] + :param application_security_groups: Specifies an array of references to application security + group. + :type application_security_groups: list[~azure.mgmt.compute.v2020_06_01.models.SubResource] + :param load_balancer_backend_address_pools: Specifies an array of references to backend address + pools of load balancers. A scale set can reference backend address pools of one public and one + internal load balancer. Multiple scale sets cannot use the same basic sku load balancer. + :type load_balancer_backend_address_pools: + list[~azure.mgmt.compute.v2020_06_01.models.SubResource] + :param load_balancer_inbound_nat_pools: Specifies an array of references to inbound Nat pools + of the load balancers. A scale set can reference inbound nat pools of one public and one + internal load balancer. Multiple scale sets cannot use the same basic sku load balancer. + :type load_balancer_inbound_nat_pools: list[~azure.mgmt.compute.v2020_06_01.models.SubResource] + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'ApiEntityReference'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'public_ip_address_configuration': {'key': 'properties.publicIPAddressConfiguration', 'type': 'VirtualMachineScaleSetPublicIPAddressConfiguration'}, + 'private_ip_address_version': {'key': 'properties.privateIPAddressVersion', 'type': 'str'}, + 'application_gateway_backend_address_pools': {'key': 'properties.applicationGatewayBackendAddressPools', 'type': '[SubResource]'}, + 'application_security_groups': {'key': 'properties.applicationSecurityGroups', 'type': '[SubResource]'}, + 'load_balancer_backend_address_pools': {'key': 'properties.loadBalancerBackendAddressPools', 'type': '[SubResource]'}, + 'load_balancer_inbound_nat_pools': {'key': 'properties.loadBalancerInboundNatPools', 'type': '[SubResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetIPConfiguration, self).__init__(**kwargs) + self.name = kwargs['name'] + self.subnet = kwargs.get('subnet', None) + self.primary = kwargs.get('primary', None) + self.public_ip_address_configuration = kwargs.get('public_ip_address_configuration', None) + self.private_ip_address_version = kwargs.get('private_ip_address_version', None) + self.application_gateway_backend_address_pools = kwargs.get('application_gateway_backend_address_pools', None) + self.application_security_groups = kwargs.get('application_security_groups', None) + self.load_balancer_backend_address_pools = kwargs.get('load_balancer_backend_address_pools', None) + self.load_balancer_inbound_nat_pools = kwargs.get('load_balancer_inbound_nat_pools', None) + + +class VirtualMachineScaleSetIpTag(msrest.serialization.Model): + """Contains the IP tag associated with the public IP address. + + :param ip_tag_type: IP tag type. Example: FirstPartyUsage. + :type ip_tag_type: str + :param tag: IP tag associated with the public IP. Example: SQL, Storage etc. + :type tag: str + """ + + _attribute_map = { + 'ip_tag_type': {'key': 'ipTagType', 'type': 'str'}, + 'tag': {'key': 'tag', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetIpTag, self).__init__(**kwargs) + self.ip_tag_type = kwargs.get('ip_tag_type', None) + self.tag = kwargs.get('tag', None) + + +class VirtualMachineScaleSetListOSUpgradeHistory(msrest.serialization.Model): + """List of Virtual Machine Scale Set OS Upgrade History operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of OS upgrades performed on the virtual machine scale set. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.UpgradeOperationHistoricalStatusInfo] + :param next_link: The uri to fetch the next page of OS Upgrade History. Call ListNext() with + this to fetch the next page of history of upgrades. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[UpgradeOperationHistoricalStatusInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetListOSUpgradeHistory, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class VirtualMachineScaleSetListResult(msrest.serialization.Model): + """The List Virtual Machine operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of virtual machine scale sets. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSet] + :param next_link: The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() + with this to fetch the next page of VMSS. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualMachineScaleSet]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetListResult, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class VirtualMachineScaleSetListSkusResult(msrest.serialization.Model): + """The Virtual Machine Scale Set List Skus operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of skus available for the virtual machine scale set. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetSku] + :param next_link: The uri to fetch the next page of Virtual Machine Scale Set Skus. Call + ListNext() with this to fetch the next page of VMSS Skus. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualMachineScaleSetSku]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetListSkusResult, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class VirtualMachineScaleSetListWithLinkResult(msrest.serialization.Model): + """The List Virtual Machine operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of virtual machine scale sets. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSet] + :param next_link: The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() + with this to fetch the next page of Virtual Machine Scale Sets. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualMachineScaleSet]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetListWithLinkResult, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class VirtualMachineScaleSetManagedDiskParameters(msrest.serialization.Model): + """Describes the parameters of a ScaleSet managed disk. + + :param storage_account_type: Specifies the storage account type for the managed disk. NOTE: + UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values + include: "Standard_LRS", "Premium_LRS", "StandardSSD_LRS", "UltraSSD_LRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2020_06_01.models.StorageAccountTypes + :param disk_encryption_set: Specifies the customer managed disk encryption set resource id for + the managed disk. + :type disk_encryption_set: ~azure.mgmt.compute.v2020_06_01.models.SubResource + """ + + _attribute_map = { + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'disk_encryption_set': {'key': 'diskEncryptionSet', 'type': 'SubResource'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetManagedDiskParameters, self).__init__(**kwargs) + self.storage_account_type = kwargs.get('storage_account_type', None) + self.disk_encryption_set = kwargs.get('disk_encryption_set', None) + + +class VirtualMachineScaleSetNetworkConfiguration(SubResource): + """Describes a virtual machine scale set network profile's network configurations. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource Id. + :type id: str + :param name: Required. The network configuration name. + :type name: str + :param primary: Specifies the primary network interface in case the virtual machine has more + than 1 network interface. + :type primary: bool + :param enable_accelerated_networking: Specifies whether the network interface is accelerated + networking-enabled. + :type enable_accelerated_networking: 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. + :type dns_settings: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetNetworkConfigurationDnsSettings + :param ip_configurations: Specifies the IP configurations of the network interface. + :type ip_configurations: + list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetIPConfiguration] + :param enable_ip_forwarding: Whether IP forwarding enabled on this NIC. + :type enable_ip_forwarding: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'enable_accelerated_networking': {'key': 'properties.enableAcceleratedNetworking', 'type': 'bool'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'SubResource'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'VirtualMachineScaleSetNetworkConfigurationDnsSettings'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualMachineScaleSetIPConfiguration]'}, + 'enable_ip_forwarding': {'key': 'properties.enableIPForwarding', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetNetworkConfiguration, self).__init__(**kwargs) + self.name = kwargs['name'] + self.primary = kwargs.get('primary', None) + self.enable_accelerated_networking = kwargs.get('enable_accelerated_networking', 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) + self.enable_ip_forwarding = kwargs.get('enable_ip_forwarding', None) + + +class VirtualMachineScaleSetNetworkConfigurationDnsSettings(msrest.serialization.Model): + """Describes a virtual machines scale sets network configuration's DNS settings. + + :param dns_servers: List of DNS servers IP addresses. + :type dns_servers: list[str] + """ + + _attribute_map = { + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetNetworkConfigurationDnsSettings, self).__init__(**kwargs) + self.dns_servers = kwargs.get('dns_servers', None) + + +class VirtualMachineScaleSetNetworkProfile(msrest.serialization.Model): + """Describes a virtual machine scale set network profile. + + :param health_probe: A reference to a load balancer probe used to determine the health of an + instance in the virtual machine scale set. The reference will be in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + :type health_probe: ~azure.mgmt.compute.v2020_06_01.models.ApiEntityReference + :param network_interface_configurations: The list of network configurations. + :type network_interface_configurations: + list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetNetworkConfiguration] + """ + + _attribute_map = { + 'health_probe': {'key': 'healthProbe', 'type': 'ApiEntityReference'}, + 'network_interface_configurations': {'key': 'networkInterfaceConfigurations', 'type': '[VirtualMachineScaleSetNetworkConfiguration]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetNetworkProfile, self).__init__(**kwargs) + self.health_probe = kwargs.get('health_probe', None) + self.network_interface_configurations = kwargs.get('network_interface_configurations', None) + + +class VirtualMachineScaleSetOSDisk(msrest.serialization.Model): + """Describes a virtual machine scale set operating system disk. + + All required parameters must be populated in order to send to Azure. + + :param name: The disk name. + :type name: str + :param caching: Specifies the caching requirements. :code:`
    `:code:`
    ` Possible values + are: :code:`
    `:code:`
    ` **None** :code:`
    `:code:`
    ` **ReadOnly** + :code:`
    `:code:`
    ` **ReadWrite** :code:`
    `:code:`
    ` Default: **None for Standard + storage. ReadOnly for Premium storage**. Possible values include: "None", "ReadOnly", + "ReadWrite". + :type caching: str or ~azure.mgmt.compute.v2020_06_01.models.CachingTypes + :param write_accelerator_enabled: Specifies whether writeAccelerator should be enabled or + disabled on the disk. + :type write_accelerator_enabled: bool + :param create_option: Required. Specifies how the virtual machines in the scale set should be + created.:code:`
    `:code:`
    ` The only allowed value is: **FromImage** \u2013 This value is + used when you are using an image to create the virtual machine. If you are using a platform + image, you also use the imageReference element described above. If you are using a marketplace + image, you also use the plan element previously described. Possible values include: + "FromImage", "Empty", "Attach". + :type create_option: str or ~azure.mgmt.compute.v2020_06_01.models.DiskCreateOptionTypes + :param diff_disk_settings: Specifies the ephemeral disk Settings for the operating system disk + used by the virtual machine scale set. + :type diff_disk_settings: ~azure.mgmt.compute.v2020_06_01.models.DiffDiskSettings + :param disk_size_gb: Specifies the size of the operating system disk in gigabytes. This element + can be used to overwrite the size of the disk in a virtual machine image. + :code:`
    `:code:`
    ` This value cannot be larger than 1023 GB. + :type disk_size_gb: int + :param os_type: This property allows you to specify the type of the OS that is included in the + disk if creating a VM from user-image or a specialized VHD. :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_06_01.models.OperatingSystemTypes + :param image: Specifies information about the unmanaged user image to base the scale set on. + :type image: ~azure.mgmt.compute.v2020_06_01.models.VirtualHardDisk + :param vhd_containers: Specifies the container urls that are used to store operating system + disks for the scale set. + :type vhd_containers: list[str] + :param managed_disk: The managed disk parameters. + :type managed_disk: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetManagedDiskParameters + """ + + _validation = { + 'create_option': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'caching': {'key': 'caching', 'type': 'str'}, + 'write_accelerator_enabled': {'key': 'writeAcceleratorEnabled', 'type': 'bool'}, + 'create_option': {'key': 'createOption', 'type': 'str'}, + 'diff_disk_settings': {'key': 'diffDiskSettings', 'type': 'DiffDiskSettings'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'VirtualHardDisk'}, + 'vhd_containers': {'key': 'vhdContainers', 'type': '[str]'}, + 'managed_disk': {'key': 'managedDisk', 'type': 'VirtualMachineScaleSetManagedDiskParameters'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetOSDisk, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.caching = kwargs.get('caching', None) + self.write_accelerator_enabled = kwargs.get('write_accelerator_enabled', None) + self.create_option = kwargs['create_option'] + self.diff_disk_settings = kwargs.get('diff_disk_settings', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.os_type = kwargs.get('os_type', None) + self.image = kwargs.get('image', None) + self.vhd_containers = kwargs.get('vhd_containers', None) + self.managed_disk = kwargs.get('managed_disk', None) + + +class VirtualMachineScaleSetOSProfile(msrest.serialization.Model): + """Describes a virtual machine scale set OS profile. + + :param computer_name_prefix: Specifies the computer name prefix for all of the virtual machines + in the scale set. Computer name prefixes must be 1 to 15 characters long. + :type computer_name_prefix: str + :param admin_username: Specifies the name of the administrator account. + :code:`
    `:code:`
    ` **Windows-only restriction:** Cannot end in "." + :code:`
    `:code:`
    ` **Disallowed values:** "administrator", "admin", "user", "user1", + "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", + "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", + "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". + :code:`
    `:code:`
    ` **Minimum-length (Linux):** 1 character :code:`
    `:code:`
    ` + **Max-length (Linux):** 64 characters :code:`
    `:code:`
    ` **Max-length (Windows):** 20 + characters :code:`
    `:code:`
    `:code:`
  • ` For root access to the Linux VM, see `Using + root privileges on Linux virtual machines in Azure `_\ :code:`
    `:code:`
  • ` For a list of built-in system users on + Linux that should not be used in this field, see `Selecting User Names for Linux on Azure + `_. + :type admin_username: str + :param admin_password: Specifies the password of the administrator account. + :code:`
    `:code:`
    ` **Minimum-length (Windows):** 8 characters :code:`
    `:code:`
    ` + **Minimum-length (Linux):** 6 characters :code:`
    `:code:`
    ` **Max-length (Windows):** 123 + characters :code:`
    `:code:`
    ` **Max-length (Linux):** 72 characters + :code:`
    `:code:`
    ` **Complexity requirements:** 3 out of 4 conditions below need to be + fulfilled :code:`
    ` Has lower characters :code:`
    `Has upper characters :code:`
    ` Has a + digit :code:`
    ` Has a special character (Regex match [\W_]) :code:`
    `:code:`
    ` + **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", + "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" :code:`
    `:code:`
    ` For + resetting the password, see `How to reset the Remote Desktop service or its login password in a + Windows VM `_ :code:`
    `:code:`
    ` For + resetting root password, see `Manage users, SSH, and check or repair disks on Azure Linux VMs + using the VMAccess Extension `_. + :type admin_password: str + :param custom_data: Specifies a base-64 encoded string of custom data. The base-64 encoded + string is decoded to a binary array that is saved as a file on the Virtual Machine. The maximum + length of the binary array is 65535 bytes. :code:`
    `:code:`
    ` For using cloud-init for + your VM, see `Using cloud-init to customize a Linux VM during creation + `_. + :type custom_data: str + :param windows_configuration: Specifies Windows operating system settings on the virtual + machine. + :type windows_configuration: ~azure.mgmt.compute.v2020_06_01.models.WindowsConfiguration + :param linux_configuration: Specifies the Linux operating system settings on the virtual + machine. :code:`
    `:code:`
    `For a list of supported Linux distributions, see `Linux on + Azure-Endorsed Distributions `_ + :code:`
    `:code:`
    ` For running non-endorsed distributions, see `Information for Non- + Endorsed Distributions `_. + :type linux_configuration: ~azure.mgmt.compute.v2020_06_01.models.LinuxConfiguration + :param secrets: Specifies set of certificates that should be installed onto the virtual + machines in the scale set. + :type secrets: list[~azure.mgmt.compute.v2020_06_01.models.VaultSecretGroup] + """ + + _attribute_map = { + 'computer_name_prefix': {'key': 'computerNamePrefix', 'type': 'str'}, + 'admin_username': {'key': 'adminUsername', 'type': 'str'}, + 'admin_password': {'key': 'adminPassword', 'type': 'str'}, + 'custom_data': {'key': 'customData', 'type': 'str'}, + 'windows_configuration': {'key': 'windowsConfiguration', 'type': 'WindowsConfiguration'}, + 'linux_configuration': {'key': 'linuxConfiguration', 'type': 'LinuxConfiguration'}, + 'secrets': {'key': 'secrets', 'type': '[VaultSecretGroup]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetOSProfile, self).__init__(**kwargs) + self.computer_name_prefix = kwargs.get('computer_name_prefix', None) + self.admin_username = kwargs.get('admin_username', None) + self.admin_password = kwargs.get('admin_password', None) + self.custom_data = kwargs.get('custom_data', None) + self.windows_configuration = kwargs.get('windows_configuration', None) + self.linux_configuration = kwargs.get('linux_configuration', None) + self.secrets = kwargs.get('secrets', None) + + +class VirtualMachineScaleSetPublicIPAddressConfiguration(msrest.serialization.Model): + """Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The publicIP address configuration name. + :type name: str + :param idle_timeout_in_minutes: The idle timeout of the public IP address. + :type idle_timeout_in_minutes: int + :param dns_settings: The dns settings to be applied on the publicIP addresses . + :type dns_settings: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings + :param ip_tags: The list of IP tags associated with the public IP address. + :type ip_tags: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetIpTag] + :param public_ip_prefix: The PublicIPPrefix from which to allocate publicIP addresses. + :type public_ip_prefix: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param public_ip_address_version: Available from Api-Version 2019-07-01 onwards, it represents + whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values + are: 'IPv4' and 'IPv6'. Possible values include: "IPv4", "IPv6". + :type public_ip_address_version: str or ~azure.mgmt.compute.v2020_06_01.models.IPVersion + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings'}, + 'ip_tags': {'key': 'properties.ipTags', 'type': '[VirtualMachineScaleSetIpTag]'}, + 'public_ip_prefix': {'key': 'properties.publicIPPrefix', 'type': 'SubResource'}, + 'public_ip_address_version': {'key': 'properties.publicIPAddressVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetPublicIPAddressConfiguration, self).__init__(**kwargs) + self.name = kwargs['name'] + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.dns_settings = kwargs.get('dns_settings', None) + self.ip_tags = kwargs.get('ip_tags', None) + self.public_ip_prefix = kwargs.get('public_ip_prefix', None) + self.public_ip_address_version = kwargs.get('public_ip_address_version', None) + + +class VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings(msrest.serialization.Model): + """Describes a virtual machines scale sets network configuration's DNS settings. + + All required parameters must be populated in order to send to Azure. + + :param domain_name_label: Required. The Domain name label.The concatenation of the domain name + label and vm index will be the domain name labels of the PublicIPAddress resources that will be + created. + :type domain_name_label: str + """ + + _validation = { + 'domain_name_label': {'required': True}, + } + + _attribute_map = { + 'domain_name_label': {'key': 'domainNameLabel', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings, self).__init__(**kwargs) + self.domain_name_label = kwargs['domain_name_label'] + + +class VirtualMachineScaleSetReimageParameters(VirtualMachineReimageParameters): + """Describes a Virtual Machine Scale Set VM Reimage Parameters. + + :param temp_disk: Specifies whether to reimage temp disk. Default value: false. Note: This temp + disk reimage parameter is only supported for VM/VMSS with Ephemeral OS disk. + :type temp_disk: bool + :param instance_ids: The virtual machine scale set instance ids. Omitting the virtual machine + scale set instance ids will result in the operation being performed on all virtual machines in + the virtual machine scale set. + :type instance_ids: list[str] + """ + + _attribute_map = { + 'temp_disk': {'key': 'tempDisk', 'type': 'bool'}, + 'instance_ids': {'key': 'instanceIds', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetReimageParameters, self).__init__(**kwargs) + self.instance_ids = kwargs.get('instance_ids', None) + + +class VirtualMachineScaleSetSku(msrest.serialization.Model): + """Describes an available virtual machine scale set sku. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar resource_type: The type of resource the sku applies to. + :vartype resource_type: str + :ivar sku: The Sku. + :vartype sku: ~azure.mgmt.compute.v2020_06_01.models.Sku + :ivar capacity: Specifies the number of virtual machines in the scale set. + :vartype capacity: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetSkuCapacity + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'sku': {'readonly': True}, + 'capacity': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'capacity': {'key': 'capacity', 'type': 'VirtualMachineScaleSetSkuCapacity'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetSku, self).__init__(**kwargs) + self.resource_type = None + self.sku = None + self.capacity = None + + +class VirtualMachineScaleSetSkuCapacity(msrest.serialization.Model): + """Describes scaling information of a sku. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar minimum: The minimum capacity. + :vartype minimum: long + :ivar maximum: The maximum capacity that can be set. + :vartype maximum: long + :ivar default_capacity: The default capacity. + :vartype default_capacity: long + :ivar scale_type: The scale type applicable to the sku. Possible values include: "Automatic", + "None". + :vartype scale_type: str or + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetSkuScaleType + """ + + _validation = { + 'minimum': {'readonly': True}, + 'maximum': {'readonly': True}, + 'default_capacity': {'readonly': True}, + 'scale_type': {'readonly': True}, + } + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'long'}, + 'maximum': {'key': 'maximum', 'type': 'long'}, + 'default_capacity': {'key': 'defaultCapacity', 'type': 'long'}, + 'scale_type': {'key': 'scaleType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetSkuCapacity, self).__init__(**kwargs) + self.minimum = None + self.maximum = None + self.default_capacity = None + self.scale_type = None + + +class VirtualMachineScaleSetStorageProfile(msrest.serialization.Model): + """Describes a virtual machine scale set storage profile. + + :param image_reference: Specifies information about the image to use. You can specify + information about platform images, marketplace images, or virtual machine images. This element + is required when you want to use a platform image, marketplace image, or virtual machine image, + but is not used in other creation operations. + :type image_reference: ~azure.mgmt.compute.v2020_06_01.models.ImageReference + :param os_disk: Specifies information about the operating system disk used by the virtual + machines in the scale set. :code:`
    `:code:`
    ` For more information about disks, see + `About disks and VHDs for Azure virtual machines `_. + :type os_disk: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetOSDisk + :param data_disks: Specifies the parameters that are used to add data disks to the virtual + machines in the scale set. :code:`
    `:code:`
    ` For more information about disks, see + `About disks and VHDs for Azure virtual machines `_. + :type data_disks: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetDataDisk] + """ + + _attribute_map = { + 'image_reference': {'key': 'imageReference', 'type': 'ImageReference'}, + 'os_disk': {'key': 'osDisk', 'type': 'VirtualMachineScaleSetOSDisk'}, + 'data_disks': {'key': 'dataDisks', 'type': '[VirtualMachineScaleSetDataDisk]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetStorageProfile, self).__init__(**kwargs) + self.image_reference = kwargs.get('image_reference', None) + self.os_disk = kwargs.get('os_disk', None) + self.data_disks = kwargs.get('data_disks', None) + + +class VirtualMachineScaleSetUpdate(UpdateResource): + """Describes a Virtual Machine Scale Set. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param sku: The virtual machine scale set sku. + :type sku: ~azure.mgmt.compute.v2020_06_01.models.Sku + :param plan: The purchase plan when deploying a virtual machine scale set from VM Marketplace + images. + :type plan: ~azure.mgmt.compute.v2020_06_01.models.Plan + :param identity: The identity of the virtual machine scale set, if configured. + :type identity: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetIdentity + :param upgrade_policy: The upgrade policy. + :type upgrade_policy: ~azure.mgmt.compute.v2020_06_01.models.UpgradePolicy + :param automatic_repairs_policy: Policy for automatic repairs. + :type automatic_repairs_policy: ~azure.mgmt.compute.v2020_06_01.models.AutomaticRepairsPolicy + :param virtual_machine_profile: The virtual machine profile. + :type virtual_machine_profile: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetUpdateVMProfile + :param overprovision: Specifies whether the Virtual Machine Scale Set should be + overprovisioned. + :type overprovision: bool + :param do_not_run_extensions_on_overprovisioned_v_ms: When Overprovision is enabled, extensions + are launched only on the requested number of VMs which are finally kept. This property will + hence ensure that the extensions do not run on the extra overprovisioned VMs. + :type do_not_run_extensions_on_overprovisioned_v_ms: bool + :param single_placement_group: When true this limits the scale set to a single placement group, + of max size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to + false. However, if singlePlacementGroup is false, it may not be modified to true. + :type single_placement_group: bool + :param additional_capabilities: Specifies additional capabilities enabled or disabled on the + Virtual Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines + have the capability to support attaching managed data disks with UltraSSD_LRS storage account + type. + :type additional_capabilities: ~azure.mgmt.compute.v2020_06_01.models.AdditionalCapabilities + :param scale_in_policy: Specifies the scale-in policy that decides which virtual machines are + chosen for removal when a Virtual Machine Scale Set is scaled-in. + :type scale_in_policy: ~azure.mgmt.compute.v2020_06_01.models.ScaleInPolicy + :param proximity_placement_group: Specifies information about the proximity placement group + that the virtual machine scale set should be assigned to. :code:`
    `:code:`
    `Minimum api- + version: 2018-04-01. + :type proximity_placement_group: ~azure.mgmt.compute.v2020_06_01.models.SubResource + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'identity': {'key': 'identity', 'type': 'VirtualMachineScaleSetIdentity'}, + 'upgrade_policy': {'key': 'properties.upgradePolicy', 'type': 'UpgradePolicy'}, + 'automatic_repairs_policy': {'key': 'properties.automaticRepairsPolicy', 'type': 'AutomaticRepairsPolicy'}, + 'virtual_machine_profile': {'key': 'properties.virtualMachineProfile', 'type': 'VirtualMachineScaleSetUpdateVMProfile'}, + 'overprovision': {'key': 'properties.overprovision', 'type': 'bool'}, + 'do_not_run_extensions_on_overprovisioned_v_ms': {'key': 'properties.doNotRunExtensionsOnOverprovisionedVMs', 'type': 'bool'}, + 'single_placement_group': {'key': 'properties.singlePlacementGroup', 'type': 'bool'}, + 'additional_capabilities': {'key': 'properties.additionalCapabilities', 'type': 'AdditionalCapabilities'}, + 'scale_in_policy': {'key': 'properties.scaleInPolicy', 'type': 'ScaleInPolicy'}, + 'proximity_placement_group': {'key': 'properties.proximityPlacementGroup', 'type': 'SubResource'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetUpdate, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.plan = kwargs.get('plan', None) + self.identity = kwargs.get('identity', None) + self.upgrade_policy = kwargs.get('upgrade_policy', None) + self.automatic_repairs_policy = kwargs.get('automatic_repairs_policy', None) + self.virtual_machine_profile = kwargs.get('virtual_machine_profile', None) + self.overprovision = kwargs.get('overprovision', None) + self.do_not_run_extensions_on_overprovisioned_v_ms = kwargs.get('do_not_run_extensions_on_overprovisioned_v_ms', None) + self.single_placement_group = kwargs.get('single_placement_group', None) + self.additional_capabilities = kwargs.get('additional_capabilities', None) + self.scale_in_policy = kwargs.get('scale_in_policy', None) + self.proximity_placement_group = kwargs.get('proximity_placement_group', None) + + +class VirtualMachineScaleSetUpdateIPConfiguration(SubResource): + """Describes a virtual machine scale set network profile's IP configuration. NOTE: The subnet of a scale set may be modified as long as the original subnet and the new subnet are in the same virtual network. + + :param id: Resource Id. + :type id: str + :param name: The IP configuration name. + :type name: str + :param subnet: The subnet. + :type subnet: ~azure.mgmt.compute.v2020_06_01.models.ApiEntityReference + :param primary: Specifies the primary IP Configuration in case the network interface has more + than one IP Configuration. + :type primary: bool + :param public_ip_address_configuration: The publicIPAddressConfiguration. + :type public_ip_address_configuration: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetUpdatePublicIPAddressConfiguration + :param private_ip_address_version: Available from Api-Version 2017-03-30 onwards, it represents + whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible + values are: 'IPv4' and 'IPv6'. Possible values include: "IPv4", "IPv6". + :type private_ip_address_version: str or ~azure.mgmt.compute.v2020_06_01.models.IPVersion + :param application_gateway_backend_address_pools: The application gateway backend address + pools. + :type application_gateway_backend_address_pools: + list[~azure.mgmt.compute.v2020_06_01.models.SubResource] + :param application_security_groups: Specifies an array of references to application security + group. + :type application_security_groups: list[~azure.mgmt.compute.v2020_06_01.models.SubResource] + :param load_balancer_backend_address_pools: The load balancer backend address pools. + :type load_balancer_backend_address_pools: + list[~azure.mgmt.compute.v2020_06_01.models.SubResource] + :param load_balancer_inbound_nat_pools: The load balancer inbound nat pools. + :type load_balancer_inbound_nat_pools: list[~azure.mgmt.compute.v2020_06_01.models.SubResource] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'ApiEntityReference'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'public_ip_address_configuration': {'key': 'properties.publicIPAddressConfiguration', 'type': 'VirtualMachineScaleSetUpdatePublicIPAddressConfiguration'}, + 'private_ip_address_version': {'key': 'properties.privateIPAddressVersion', 'type': 'str'}, + 'application_gateway_backend_address_pools': {'key': 'properties.applicationGatewayBackendAddressPools', 'type': '[SubResource]'}, + 'application_security_groups': {'key': 'properties.applicationSecurityGroups', 'type': '[SubResource]'}, + 'load_balancer_backend_address_pools': {'key': 'properties.loadBalancerBackendAddressPools', 'type': '[SubResource]'}, + 'load_balancer_inbound_nat_pools': {'key': 'properties.loadBalancerInboundNatPools', 'type': '[SubResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetUpdateIPConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.subnet = kwargs.get('subnet', None) + self.primary = kwargs.get('primary', None) + self.public_ip_address_configuration = kwargs.get('public_ip_address_configuration', None) + self.private_ip_address_version = kwargs.get('private_ip_address_version', None) + self.application_gateway_backend_address_pools = kwargs.get('application_gateway_backend_address_pools', None) + self.application_security_groups = kwargs.get('application_security_groups', None) + self.load_balancer_backend_address_pools = kwargs.get('load_balancer_backend_address_pools', None) + self.load_balancer_inbound_nat_pools = kwargs.get('load_balancer_inbound_nat_pools', None) + + +class VirtualMachineScaleSetUpdateNetworkConfiguration(SubResource): + """Describes a virtual machine scale set network profile's network configurations. + + :param id: Resource Id. + :type id: str + :param name: The network configuration name. + :type name: str + :param primary: Whether this is a primary NIC on a virtual machine. + :type primary: bool + :param enable_accelerated_networking: Specifies whether the network interface is accelerated + networking-enabled. + :type enable_accelerated_networking: 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. + :type dns_settings: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetNetworkConfigurationDnsSettings + :param ip_configurations: The virtual machine scale set IP Configuration. + :type ip_configurations: + list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetUpdateIPConfiguration] + :param enable_ip_forwarding: Whether IP forwarding enabled on this NIC. + :type enable_ip_forwarding: bool + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'enable_accelerated_networking': {'key': 'properties.enableAcceleratedNetworking', 'type': 'bool'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'SubResource'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'VirtualMachineScaleSetNetworkConfigurationDnsSettings'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualMachineScaleSetUpdateIPConfiguration]'}, + 'enable_ip_forwarding': {'key': 'properties.enableIPForwarding', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetUpdateNetworkConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.primary = kwargs.get('primary', None) + self.enable_accelerated_networking = kwargs.get('enable_accelerated_networking', 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) + self.enable_ip_forwarding = kwargs.get('enable_ip_forwarding', None) + + +class VirtualMachineScaleSetUpdateNetworkProfile(msrest.serialization.Model): + """Describes a virtual machine scale set network profile. + + :param health_probe: A reference to a load balancer probe used to determine the health of an + instance in the virtual machine scale set. The reference will be in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + :type health_probe: ~azure.mgmt.compute.v2020_06_01.models.ApiEntityReference + :param network_interface_configurations: The list of network configurations. + :type network_interface_configurations: + list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetUpdateNetworkConfiguration] + """ + + _attribute_map = { + 'health_probe': {'key': 'healthProbe', 'type': 'ApiEntityReference'}, + 'network_interface_configurations': {'key': 'networkInterfaceConfigurations', 'type': '[VirtualMachineScaleSetUpdateNetworkConfiguration]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetUpdateNetworkProfile, self).__init__(**kwargs) + self.health_probe = kwargs.get('health_probe', None) + self.network_interface_configurations = kwargs.get('network_interface_configurations', None) + + +class VirtualMachineScaleSetUpdateOSDisk(msrest.serialization.Model): + """Describes virtual machine scale set operating system disk Update Object. This should be used for Updating VMSS OS Disk. + + :param caching: The caching type. Possible values include: "None", "ReadOnly", "ReadWrite". + :type caching: str or ~azure.mgmt.compute.v2020_06_01.models.CachingTypes + :param write_accelerator_enabled: Specifies whether writeAccelerator should be enabled or + disabled on the disk. + :type write_accelerator_enabled: bool + :param disk_size_gb: Specifies the size of the operating system disk in gigabytes. This element + can be used to overwrite the size of the disk in a virtual machine image. + :code:`
    `:code:`
    ` This value cannot be larger than 1023 GB. + :type disk_size_gb: int + :param image: The Source User Image VirtualHardDisk. This VirtualHardDisk will be copied before + using it to attach to the Virtual Machine. If SourceImage is provided, the destination + VirtualHardDisk should not exist. + :type image: ~azure.mgmt.compute.v2020_06_01.models.VirtualHardDisk + :param vhd_containers: The list of virtual hard disk container uris. + :type vhd_containers: list[str] + :param managed_disk: The managed disk parameters. + :type managed_disk: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetManagedDiskParameters + """ + + _attribute_map = { + 'caching': {'key': 'caching', 'type': 'str'}, + 'write_accelerator_enabled': {'key': 'writeAcceleratorEnabled', 'type': 'bool'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + 'image': {'key': 'image', 'type': 'VirtualHardDisk'}, + 'vhd_containers': {'key': 'vhdContainers', 'type': '[str]'}, + 'managed_disk': {'key': 'managedDisk', 'type': 'VirtualMachineScaleSetManagedDiskParameters'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetUpdateOSDisk, self).__init__(**kwargs) + self.caching = kwargs.get('caching', None) + self.write_accelerator_enabled = kwargs.get('write_accelerator_enabled', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.image = kwargs.get('image', None) + self.vhd_containers = kwargs.get('vhd_containers', None) + self.managed_disk = kwargs.get('managed_disk', None) + + +class VirtualMachineScaleSetUpdateOSProfile(msrest.serialization.Model): + """Describes a virtual machine scale set OS profile. + + :param custom_data: A base-64 encoded string of custom data. + :type custom_data: str + :param windows_configuration: The Windows Configuration of the OS profile. + :type windows_configuration: ~azure.mgmt.compute.v2020_06_01.models.WindowsConfiguration + :param linux_configuration: The Linux Configuration of the OS profile. + :type linux_configuration: ~azure.mgmt.compute.v2020_06_01.models.LinuxConfiguration + :param secrets: The List of certificates for addition to the VM. + :type secrets: list[~azure.mgmt.compute.v2020_06_01.models.VaultSecretGroup] + """ + + _attribute_map = { + 'custom_data': {'key': 'customData', 'type': 'str'}, + 'windows_configuration': {'key': 'windowsConfiguration', 'type': 'WindowsConfiguration'}, + 'linux_configuration': {'key': 'linuxConfiguration', 'type': 'LinuxConfiguration'}, + 'secrets': {'key': 'secrets', 'type': '[VaultSecretGroup]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetUpdateOSProfile, self).__init__(**kwargs) + self.custom_data = kwargs.get('custom_data', None) + self.windows_configuration = kwargs.get('windows_configuration', None) + self.linux_configuration = kwargs.get('linux_configuration', None) + self.secrets = kwargs.get('secrets', None) + + +class VirtualMachineScaleSetUpdatePublicIPAddressConfiguration(msrest.serialization.Model): + """Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration. + + :param name: The publicIP address configuration name. + :type name: str + :param idle_timeout_in_minutes: The idle timeout of the public IP address. + :type idle_timeout_in_minutes: int + :param dns_settings: The dns settings to be applied on the publicIP addresses . + :type dns_settings: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetUpdatePublicIPAddressConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.dns_settings = kwargs.get('dns_settings', None) + + +class VirtualMachineScaleSetUpdateStorageProfile(msrest.serialization.Model): + """Describes a virtual machine scale set storage profile. + + :param image_reference: The image reference. + :type image_reference: ~azure.mgmt.compute.v2020_06_01.models.ImageReference + :param os_disk: The OS disk. + :type os_disk: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetUpdateOSDisk + :param data_disks: The data disks. + :type data_disks: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetDataDisk] + """ + + _attribute_map = { + 'image_reference': {'key': 'imageReference', 'type': 'ImageReference'}, + 'os_disk': {'key': 'osDisk', 'type': 'VirtualMachineScaleSetUpdateOSDisk'}, + 'data_disks': {'key': 'dataDisks', 'type': '[VirtualMachineScaleSetDataDisk]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetUpdateStorageProfile, self).__init__(**kwargs) + self.image_reference = kwargs.get('image_reference', None) + self.os_disk = kwargs.get('os_disk', None) + self.data_disks = kwargs.get('data_disks', None) + + +class VirtualMachineScaleSetUpdateVMProfile(msrest.serialization.Model): + """Describes a virtual machine scale set virtual machine profile. + + :param os_profile: The virtual machine scale set OS profile. + :type os_profile: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetUpdateOSProfile + :param storage_profile: The virtual machine scale set storage profile. + :type storage_profile: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetUpdateStorageProfile + :param network_profile: The virtual machine scale set network profile. + :type network_profile: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetUpdateNetworkProfile + :param security_profile: The virtual machine scale set Security profile. + :type security_profile: ~azure.mgmt.compute.v2020_06_01.models.SecurityProfile + :param diagnostics_profile: The virtual machine scale set diagnostics profile. + :type diagnostics_profile: ~azure.mgmt.compute.v2020_06_01.models.DiagnosticsProfile + :param extension_profile: The virtual machine scale set extension profile. + :type extension_profile: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetExtensionProfile + :param license_type: The license type, which is for bring your own license scenario. + :type license_type: str + :param billing_profile: Specifies the billing related details of a Azure Spot VMSS. + :code:`
    `:code:`
    `Minimum api-version: 2019-03-01. + :type billing_profile: ~azure.mgmt.compute.v2020_06_01.models.BillingProfile + :param scheduled_events_profile: Specifies Scheduled Event related configurations. + :type scheduled_events_profile: ~azure.mgmt.compute.v2020_06_01.models.ScheduledEventsProfile + """ + + _attribute_map = { + 'os_profile': {'key': 'osProfile', 'type': 'VirtualMachineScaleSetUpdateOSProfile'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'VirtualMachineScaleSetUpdateStorageProfile'}, + 'network_profile': {'key': 'networkProfile', 'type': 'VirtualMachineScaleSetUpdateNetworkProfile'}, + 'security_profile': {'key': 'securityProfile', 'type': 'SecurityProfile'}, + 'diagnostics_profile': {'key': 'diagnosticsProfile', 'type': 'DiagnosticsProfile'}, + 'extension_profile': {'key': 'extensionProfile', 'type': 'VirtualMachineScaleSetExtensionProfile'}, + 'license_type': {'key': 'licenseType', 'type': 'str'}, + 'billing_profile': {'key': 'billingProfile', 'type': 'BillingProfile'}, + 'scheduled_events_profile': {'key': 'scheduledEventsProfile', 'type': 'ScheduledEventsProfile'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetUpdateVMProfile, self).__init__(**kwargs) + self.os_profile = kwargs.get('os_profile', None) + self.storage_profile = kwargs.get('storage_profile', None) + self.network_profile = kwargs.get('network_profile', None) + self.security_profile = kwargs.get('security_profile', None) + self.diagnostics_profile = kwargs.get('diagnostics_profile', None) + self.extension_profile = kwargs.get('extension_profile', None) + self.license_type = kwargs.get('license_type', None) + self.billing_profile = kwargs.get('billing_profile', None) + self.scheduled_events_profile = kwargs.get('scheduled_events_profile', None) + + +class VirtualMachineScaleSetVM(Resource): + """Describes a virtual machine scale set virtual machine. + + 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 instance_id: The virtual machine instance ID. + :vartype instance_id: str + :ivar sku: The virtual machine SKU. + :vartype sku: ~azure.mgmt.compute.v2020_06_01.models.Sku + :param plan: Specifies information about the marketplace image used to create the virtual + machine. This element is only used for marketplace images. Before you can use a marketplace + image from an API, you must enable the image for programmatic use. In the Azure portal, find + the marketplace image that you want to use and then click **Want to deploy programmatically, + Get Started ->**. Enter any required information and then click **Save**. + :type plan: ~azure.mgmt.compute.v2020_06_01.models.Plan + :ivar resources: The virtual machine child extension resources. + :vartype resources: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtension] + :ivar zones: The virtual machine zones. + :vartype zones: list[str] + :ivar latest_model_applied: Specifies whether the latest model has been applied to the virtual + machine. + :vartype latest_model_applied: bool + :ivar vm_id: Azure VM unique ID. + :vartype vm_id: str + :ivar instance_view: The virtual machine instance view. + :vartype instance_view: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMInstanceView + :param hardware_profile: Specifies the hardware settings for the virtual machine. + :type hardware_profile: ~azure.mgmt.compute.v2020_06_01.models.HardwareProfile + :param storage_profile: Specifies the storage settings for the virtual machine disks. + :type storage_profile: ~azure.mgmt.compute.v2020_06_01.models.StorageProfile + :param additional_capabilities: Specifies additional capabilities enabled or disabled on the + virtual machine in the scale set. For instance: whether the virtual machine has the capability + to support attaching managed data disks with UltraSSD_LRS storage account type. + :type additional_capabilities: ~azure.mgmt.compute.v2020_06_01.models.AdditionalCapabilities + :param os_profile: Specifies the operating system settings for the virtual machine. + :type os_profile: ~azure.mgmt.compute.v2020_06_01.models.OSProfile + :param security_profile: Specifies the Security related profile settings for the virtual + machine. + :type security_profile: ~azure.mgmt.compute.v2020_06_01.models.SecurityProfile + :param network_profile: Specifies the network interfaces of the virtual machine. + :type network_profile: ~azure.mgmt.compute.v2020_06_01.models.NetworkProfile + :param network_profile_configuration: Specifies the network profile configuration of the + virtual machine. + :type network_profile_configuration: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMNetworkProfileConfiguration + :param diagnostics_profile: Specifies the boot diagnostic settings state. + :code:`
    `:code:`
    `Minimum api-version: 2015-06-15. + :type diagnostics_profile: ~azure.mgmt.compute.v2020_06_01.models.DiagnosticsProfile + :param availability_set: Specifies information about the availability set that the virtual + machine should be assigned to. Virtual machines specified in the same availability set are + allocated to different nodes to maximize availability. For more information about availability + sets, see `Manage the availability of virtual machines + `_. :code:`
    `:code:`
    ` + For more information on Azure planned maintenance, see `Planned maintenance for virtual + machines in Azure `_ + :code:`
    `:code:`
    ` Currently, a VM can only be added to availability set at creation + time. An existing VM cannot be added to an availability set. + :type availability_set: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :param license_type: Specifies that the image or disk that is being used was licensed on- + premises. This element is only used for images that contain the Windows Server operating + system. :code:`
    `:code:`
    ` Possible values are: :code:`
    `:code:`
    ` Windows_Client + :code:`
    `:code:`
    ` Windows_Server :code:`
    `:code:`
    ` If this element is included in + a request for an update, the value must match the initial value. This value cannot be updated. + :code:`
    `:code:`
    ` For more information, see `Azure Hybrid Use Benefit for Windows Server + `_ :code:`
    `:code:`
    ` + Minimum api-version: 2015-06-15. + :type license_type: str + :ivar model_definition_applied: Specifies whether the model applied to the virtual machine is + the model of the virtual machine scale set or the customized model for the virtual machine. + :vartype model_definition_applied: str + :param protection_policy: Specifies the protection policy of the virtual machine. + :type protection_policy: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMProtectionPolicy + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'instance_id': {'readonly': True}, + 'sku': {'readonly': True}, + 'resources': {'readonly': True}, + 'zones': {'readonly': True}, + 'latest_model_applied': {'readonly': True}, + 'vm_id': {'readonly': True}, + 'instance_view': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'model_definition_applied': {'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}'}, + 'instance_id': {'key': 'instanceId', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'resources': {'key': 'resources', 'type': '[VirtualMachineExtension]'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'latest_model_applied': {'key': 'properties.latestModelApplied', 'type': 'bool'}, + 'vm_id': {'key': 'properties.vmId', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineScaleSetVMInstanceView'}, + 'hardware_profile': {'key': 'properties.hardwareProfile', 'type': 'HardwareProfile'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, + 'additional_capabilities': {'key': 'properties.additionalCapabilities', 'type': 'AdditionalCapabilities'}, + 'os_profile': {'key': 'properties.osProfile', 'type': 'OSProfile'}, + 'security_profile': {'key': 'properties.securityProfile', 'type': 'SecurityProfile'}, + 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'}, + 'network_profile_configuration': {'key': 'properties.networkProfileConfiguration', 'type': 'VirtualMachineScaleSetVMNetworkProfileConfiguration'}, + 'diagnostics_profile': {'key': 'properties.diagnosticsProfile', 'type': 'DiagnosticsProfile'}, + 'availability_set': {'key': 'properties.availabilitySet', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, + 'model_definition_applied': {'key': 'properties.modelDefinitionApplied', 'type': 'str'}, + 'protection_policy': {'key': 'properties.protectionPolicy', 'type': 'VirtualMachineScaleSetVMProtectionPolicy'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetVM, self).__init__(**kwargs) + self.instance_id = None + self.sku = None + self.plan = kwargs.get('plan', None) + self.resources = None + self.zones = None + self.latest_model_applied = None + self.vm_id = None + self.instance_view = None + self.hardware_profile = kwargs.get('hardware_profile', None) + self.storage_profile = kwargs.get('storage_profile', None) + self.additional_capabilities = kwargs.get('additional_capabilities', None) + self.os_profile = kwargs.get('os_profile', None) + self.security_profile = kwargs.get('security_profile', None) + self.network_profile = kwargs.get('network_profile', None) + self.network_profile_configuration = kwargs.get('network_profile_configuration', None) + self.diagnostics_profile = kwargs.get('diagnostics_profile', None) + self.availability_set = kwargs.get('availability_set', None) + self.provisioning_state = None + self.license_type = kwargs.get('license_type', None) + self.model_definition_applied = None + self.protection_policy = kwargs.get('protection_policy', None) + + +class VirtualMachineScaleSetVMExtensionsSummary(msrest.serialization.Model): + """Extensions summary for virtual machines of a virtual machine scale set. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The extension name. + :vartype name: str + :ivar statuses_summary: The extensions information. + :vartype statuses_summary: + list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineStatusCodeCount] + """ + + _validation = { + 'name': {'readonly': True}, + 'statuses_summary': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'statuses_summary': {'key': 'statusesSummary', 'type': '[VirtualMachineStatusCodeCount]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetVMExtensionsSummary, self).__init__(**kwargs) + self.name = None + self.statuses_summary = None + + +class VirtualMachineScaleSetVMInstanceIDs(msrest.serialization.Model): + """Specifies a list of virtual machine instance IDs from the VM scale set. + + :param instance_ids: The virtual machine scale set instance ids. Omitting the virtual machine + scale set instance ids will result in the operation being performed on all virtual machines in + the virtual machine scale set. + :type instance_ids: list[str] + """ + + _attribute_map = { + 'instance_ids': {'key': 'instanceIds', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetVMInstanceIDs, self).__init__(**kwargs) + self.instance_ids = kwargs.get('instance_ids', None) + + +class VirtualMachineScaleSetVMInstanceRequiredIDs(msrest.serialization.Model): + """Specifies a list of virtual machine instance IDs from the VM scale set. + + All required parameters must be populated in order to send to Azure. + + :param instance_ids: Required. The virtual machine scale set instance ids. + :type instance_ids: list[str] + """ + + _validation = { + 'instance_ids': {'required': True}, + } + + _attribute_map = { + 'instance_ids': {'key': 'instanceIds', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetVMInstanceRequiredIDs, self).__init__(**kwargs) + self.instance_ids = kwargs['instance_ids'] + + +class VirtualMachineScaleSetVMInstanceView(msrest.serialization.Model): + """The instance view of a virtual machine scale set VM. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param platform_update_domain: The Update Domain count. + :type platform_update_domain: int + :param platform_fault_domain: The Fault Domain count. + :type platform_fault_domain: int + :param rdp_thumb_print: The Remote desktop certificate thumbprint. + :type rdp_thumb_print: str + :param vm_agent: The VM Agent running on the virtual machine. + :type vm_agent: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineAgentInstanceView + :param maintenance_redeploy_status: The Maintenance Operation status on the virtual machine. + :type maintenance_redeploy_status: + ~azure.mgmt.compute.v2020_06_01.models.MaintenanceRedeployStatus + :param disks: The disks information. + :type disks: list[~azure.mgmt.compute.v2020_06_01.models.DiskInstanceView] + :param extensions: The extensions information. + :type extensions: + list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtensionInstanceView] + :ivar vm_health: The health status for the VM. + :vartype vm_health: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineHealthStatus + :param boot_diagnostics: Boot Diagnostics is a debugging feature which allows you to view + Console Output and Screenshot to diagnose VM status. :code:`
    `:code:`
    ` You can easily + view the output of your console log. :code:`
    `:code:`
    ` Azure also enables you to see a + screenshot of the VM from the hypervisor. + :type boot_diagnostics: ~azure.mgmt.compute.v2020_06_01.models.BootDiagnosticsInstanceView + :param statuses: The resource status information. + :type statuses: list[~azure.mgmt.compute.v2020_06_01.models.InstanceViewStatus] + :ivar assigned_host: Resource id of the dedicated host, on which the virtual machine is + allocated through automatic placement, when the virtual machine is associated with a dedicated + host group that has automatic placement enabled. :code:`
    `:code:`
    `Minimum api-version: + 2020-06-01. + :vartype assigned_host: str + :param placement_group_id: The placement group in which the VM is running. If the VM is + deallocated it will not have a placementGroupId. + :type placement_group_id: str + """ + + _validation = { + 'vm_health': {'readonly': True}, + 'assigned_host': {'readonly': True}, + } + + _attribute_map = { + 'platform_update_domain': {'key': 'platformUpdateDomain', 'type': 'int'}, + 'platform_fault_domain': {'key': 'platformFaultDomain', 'type': 'int'}, + 'rdp_thumb_print': {'key': 'rdpThumbPrint', 'type': 'str'}, + 'vm_agent': {'key': 'vmAgent', 'type': 'VirtualMachineAgentInstanceView'}, + 'maintenance_redeploy_status': {'key': 'maintenanceRedeployStatus', 'type': 'MaintenanceRedeployStatus'}, + 'disks': {'key': 'disks', 'type': '[DiskInstanceView]'}, + 'extensions': {'key': 'extensions', 'type': '[VirtualMachineExtensionInstanceView]'}, + 'vm_health': {'key': 'vmHealth', 'type': 'VirtualMachineHealthStatus'}, + 'boot_diagnostics': {'key': 'bootDiagnostics', 'type': 'BootDiagnosticsInstanceView'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + 'assigned_host': {'key': 'assignedHost', 'type': 'str'}, + 'placement_group_id': {'key': 'placementGroupId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetVMInstanceView, self).__init__(**kwargs) + self.platform_update_domain = kwargs.get('platform_update_domain', None) + self.platform_fault_domain = kwargs.get('platform_fault_domain', None) + self.rdp_thumb_print = kwargs.get('rdp_thumb_print', None) + self.vm_agent = kwargs.get('vm_agent', None) + self.maintenance_redeploy_status = kwargs.get('maintenance_redeploy_status', None) + self.disks = kwargs.get('disks', None) + self.extensions = kwargs.get('extensions', None) + self.vm_health = None + self.boot_diagnostics = kwargs.get('boot_diagnostics', None) + self.statuses = kwargs.get('statuses', None) + self.assigned_host = None + self.placement_group_id = kwargs.get('placement_group_id', None) + + +class VirtualMachineScaleSetVMListResult(msrest.serialization.Model): + """The List Virtual Machine Scale Set VMs operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of virtual machine scale sets VMs. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVM] + :param next_link: The uri to fetch the next page of Virtual Machine Scale Set VMs. Call + ListNext() with this to fetch the next page of VMSS VMs. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualMachineScaleSetVM]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetVMListResult, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class VirtualMachineScaleSetVMNetworkProfileConfiguration(msrest.serialization.Model): + """Describes a virtual machine scale set VM network profile. + + :param network_interface_configurations: The list of network configurations. + :type network_interface_configurations: + list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetNetworkConfiguration] + """ + + _attribute_map = { + 'network_interface_configurations': {'key': 'networkInterfaceConfigurations', 'type': '[VirtualMachineScaleSetNetworkConfiguration]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetVMNetworkProfileConfiguration, self).__init__(**kwargs) + self.network_interface_configurations = kwargs.get('network_interface_configurations', None) + + +class VirtualMachineScaleSetVMProfile(msrest.serialization.Model): + """Describes a virtual machine scale set virtual machine profile. + + :param os_profile: Specifies the operating system settings for the virtual machines in the + scale set. + :type os_profile: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetOSProfile + :param storage_profile: Specifies the storage settings for the virtual machine disks. + :type storage_profile: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetStorageProfile + :param network_profile: Specifies properties of the network interfaces of the virtual machines + in the scale set. + :type network_profile: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetNetworkProfile + :param security_profile: Specifies the Security related profile settings for the virtual + machines in the scale set. + :type security_profile: ~azure.mgmt.compute.v2020_06_01.models.SecurityProfile + :param diagnostics_profile: Specifies the boot diagnostic settings state. + :code:`
    `:code:`
    `Minimum api-version: 2015-06-15. + :type diagnostics_profile: ~azure.mgmt.compute.v2020_06_01.models.DiagnosticsProfile + :param extension_profile: Specifies a collection of settings for extensions installed on + virtual machines in the scale set. + :type extension_profile: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetExtensionProfile + :param license_type: Specifies that the image or disk that is being used was licensed on- + premises. This element is only used for images that contain the Windows Server operating + system. :code:`
    `:code:`
    ` Possible values are: :code:`
    `:code:`
    ` Windows_Client + :code:`
    `:code:`
    ` Windows_Server :code:`
    `:code:`
    ` If this element is included in + a request for an update, the value must match the initial value. This value cannot be updated. + :code:`
    `:code:`
    ` For more information, see `Azure Hybrid Use Benefit for Windows Server + `_ :code:`
    `:code:`
    ` + Minimum api-version: 2015-06-15. + :type license_type: str + :param priority: Specifies the priority for the virtual machines in the scale set. + :code:`
    `:code:`
    `Minimum api-version: 2017-10-30-preview. Possible values include: + "Regular", "Low", "Spot". + :type priority: str or ~azure.mgmt.compute.v2020_06_01.models.VirtualMachinePriorityTypes + :param eviction_policy: Specifies the eviction policy for the Azure Spot virtual machine and + Azure Spot scale set. :code:`
    `:code:`
    `For Azure Spot virtual machines, both + 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01. + :code:`
    `:code:`
    `For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported + and the minimum api-version is 2017-10-30-preview. Possible values include: "Deallocate", + "Delete". + :type eviction_policy: str or + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineEvictionPolicyTypes + :param billing_profile: Specifies the billing related details of a Azure Spot VMSS. + :code:`
    `:code:`
    `Minimum api-version: 2019-03-01. + :type billing_profile: ~azure.mgmt.compute.v2020_06_01.models.BillingProfile + :param scheduled_events_profile: Specifies Scheduled Event related configurations. + :type scheduled_events_profile: ~azure.mgmt.compute.v2020_06_01.models.ScheduledEventsProfile + """ + + _attribute_map = { + 'os_profile': {'key': 'osProfile', 'type': 'VirtualMachineScaleSetOSProfile'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'VirtualMachineScaleSetStorageProfile'}, + 'network_profile': {'key': 'networkProfile', 'type': 'VirtualMachineScaleSetNetworkProfile'}, + 'security_profile': {'key': 'securityProfile', 'type': 'SecurityProfile'}, + 'diagnostics_profile': {'key': 'diagnosticsProfile', 'type': 'DiagnosticsProfile'}, + 'extension_profile': {'key': 'extensionProfile', 'type': 'VirtualMachineScaleSetExtensionProfile'}, + 'license_type': {'key': 'licenseType', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'str'}, + 'eviction_policy': {'key': 'evictionPolicy', 'type': 'str'}, + 'billing_profile': {'key': 'billingProfile', 'type': 'BillingProfile'}, + 'scheduled_events_profile': {'key': 'scheduledEventsProfile', 'type': 'ScheduledEventsProfile'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetVMProfile, self).__init__(**kwargs) + self.os_profile = kwargs.get('os_profile', None) + self.storage_profile = kwargs.get('storage_profile', None) + self.network_profile = kwargs.get('network_profile', None) + self.security_profile = kwargs.get('security_profile', None) + self.diagnostics_profile = kwargs.get('diagnostics_profile', None) + self.extension_profile = kwargs.get('extension_profile', None) + self.license_type = kwargs.get('license_type', None) + self.priority = kwargs.get('priority', None) + self.eviction_policy = kwargs.get('eviction_policy', None) + self.billing_profile = kwargs.get('billing_profile', None) + self.scheduled_events_profile = kwargs.get('scheduled_events_profile', None) + + +class VirtualMachineScaleSetVMProtectionPolicy(msrest.serialization.Model): + """The protection policy of a virtual machine scale set VM. + + :param protect_from_scale_in: Indicates that the virtual machine scale set VM shouldn't be + considered for deletion during a scale-in operation. + :type protect_from_scale_in: bool + :param protect_from_scale_set_actions: Indicates that model updates or actions (including + scale-in) initiated on the virtual machine scale set should not be applied to the virtual + machine scale set VM. + :type protect_from_scale_set_actions: bool + """ + + _attribute_map = { + 'protect_from_scale_in': {'key': 'protectFromScaleIn', 'type': 'bool'}, + 'protect_from_scale_set_actions': {'key': 'protectFromScaleSetActions', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetVMProtectionPolicy, self).__init__(**kwargs) + self.protect_from_scale_in = kwargs.get('protect_from_scale_in', None) + self.protect_from_scale_set_actions = kwargs.get('protect_from_scale_set_actions', None) + + +class VirtualMachineScaleSetVMReimageParameters(VirtualMachineReimageParameters): + """Describes a Virtual Machine Scale Set VM Reimage Parameters. + + :param temp_disk: Specifies whether to reimage temp disk. Default value: false. Note: This temp + disk reimage parameter is only supported for VM/VMSS with Ephemeral OS disk. + :type temp_disk: bool + """ + + _attribute_map = { + 'temp_disk': {'key': 'tempDisk', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetVMReimageParameters, self).__init__(**kwargs) + + +class VirtualMachineSize(msrest.serialization.Model): + """Describes the properties of a VM size. + + :param name: The name of the virtual machine size. + :type name: str + :param number_of_cores: The number of cores supported by the virtual machine size. + :type number_of_cores: int + :param os_disk_size_in_mb: The OS disk size, in MB, allowed by the virtual machine size. + :type os_disk_size_in_mb: int + :param resource_disk_size_in_mb: The resource disk size, in MB, allowed by the virtual machine + size. + :type resource_disk_size_in_mb: int + :param memory_in_mb: The amount of memory, in MB, supported by the virtual machine size. + :type memory_in_mb: int + :param max_data_disk_count: The maximum number of data disks that can be attached to the + virtual machine size. + :type max_data_disk_count: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'number_of_cores': {'key': 'numberOfCores', 'type': 'int'}, + 'os_disk_size_in_mb': {'key': 'osDiskSizeInMB', 'type': 'int'}, + 'resource_disk_size_in_mb': {'key': 'resourceDiskSizeInMB', 'type': 'int'}, + 'memory_in_mb': {'key': 'memoryInMB', 'type': 'int'}, + 'max_data_disk_count': {'key': 'maxDataDiskCount', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineSize, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.number_of_cores = kwargs.get('number_of_cores', None) + self.os_disk_size_in_mb = kwargs.get('os_disk_size_in_mb', None) + self.resource_disk_size_in_mb = kwargs.get('resource_disk_size_in_mb', None) + self.memory_in_mb = kwargs.get('memory_in_mb', None) + self.max_data_disk_count = kwargs.get('max_data_disk_count', None) + + +class VirtualMachineSizeListResult(msrest.serialization.Model): + """The List Virtual Machine operation response. + + :param value: The list of virtual machine sizes. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineSize] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualMachineSize]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineSizeListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class VirtualMachineSoftwarePatchProperties(msrest.serialization.Model): + """Describes the properties of a Virtual Machine software patch. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar patch_id: A unique identifier for the patch. + :vartype patch_id: str + :ivar name: The friendly name of the patch. + :vartype name: str + :ivar version: The version number of the patch. This property applies only to Linux patches. + :vartype version: str + :ivar kbid: The KBID of the patch. Only applies to Windows patches. + :vartype kbid: str + :ivar classifications: The classification(s) of the patch as provided by the patch publisher. + :vartype classifications: list[str] + :ivar reboot_behavior: Describes the reboot requirements of the patch. Possible values include: + "NeverReboots", "AlwaysRequiresReboot", "CanRequestReboot". + :vartype reboot_behavior: str or + ~azure.mgmt.compute.v2020_06_01.models.SoftwareUpdateRebootBehavior + :ivar activity_id: The activity ID of the operation that produced this result. It is used to + correlate across CRP and extension logs. + :vartype activity_id: str + :ivar published_date: The UTC timestamp when the repository published this patch. + :vartype published_date: ~datetime.datetime + :ivar last_modified_date_time: The UTC timestamp of the last update to this patch record. + :vartype last_modified_date_time: ~datetime.datetime + :ivar assessment_state: Describes the outcome of an install operation for a given patch. + Possible values include: "Installed", "Failed", "Excluded", "NotSelected", "Pending", + "Available". + :vartype assessment_state: str or ~azure.mgmt.compute.v2020_06_01.models.PatchAssessmentState + """ + + _validation = { + 'patch_id': {'readonly': True}, + 'name': {'readonly': True}, + 'version': {'readonly': True}, + 'kbid': {'readonly': True}, + 'classifications': {'readonly': True}, + 'reboot_behavior': {'readonly': True}, + 'activity_id': {'readonly': True}, + 'published_date': {'readonly': True}, + 'last_modified_date_time': {'readonly': True}, + 'assessment_state': {'readonly': True}, + } + + _attribute_map = { + 'patch_id': {'key': 'patchId', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'kbid': {'key': 'kbid', 'type': 'str'}, + 'classifications': {'key': 'classifications', 'type': '[str]'}, + 'reboot_behavior': {'key': 'rebootBehavior', 'type': 'str'}, + 'activity_id': {'key': 'activityId', 'type': 'str'}, + 'published_date': {'key': 'publishedDate', 'type': 'iso-8601'}, + 'last_modified_date_time': {'key': 'lastModifiedDateTime', 'type': 'iso-8601'}, + 'assessment_state': {'key': 'assessmentState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineSoftwarePatchProperties, self).__init__(**kwargs) + self.patch_id = None + self.name = None + self.version = None + self.kbid = None + self.classifications = None + self.reboot_behavior = None + self.activity_id = None + self.published_date = None + self.last_modified_date_time = None + self.assessment_state = None + + +class VirtualMachineStatusCodeCount(msrest.serialization.Model): + """The status code and count of the virtual machine scale set instance view status summary. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The instance view status code. + :vartype code: str + :ivar count: The number of instances having a particular status code. + :vartype count: int + """ + + _validation = { + 'code': {'readonly': True}, + 'count': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineStatusCodeCount, self).__init__(**kwargs) + self.code = None + self.count = None + + +class VirtualMachineUpdate(UpdateResource): + """Describes a Virtual Machine Update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param plan: Specifies information about the marketplace image used to create the virtual + machine. This element is only used for marketplace images. Before you can use a marketplace + image from an API, you must enable the image for programmatic use. In the Azure portal, find + the marketplace image that you want to use and then click **Want to deploy programmatically, + Get Started ->**. Enter any required information and then click **Save**. + :type plan: ~azure.mgmt.compute.v2020_06_01.models.Plan + :param identity: The identity of the virtual machine, if configured. + :type identity: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineIdentity + :param zones: The virtual machine zones. + :type zones: list[str] + :param hardware_profile: Specifies the hardware settings for the virtual machine. + :type hardware_profile: ~azure.mgmt.compute.v2020_06_01.models.HardwareProfile + :param storage_profile: Specifies the storage settings for the virtual machine disks. + :type storage_profile: ~azure.mgmt.compute.v2020_06_01.models.StorageProfile + :param additional_capabilities: Specifies additional capabilities enabled or disabled on the + virtual machine. + :type additional_capabilities: ~azure.mgmt.compute.v2020_06_01.models.AdditionalCapabilities + :param os_profile: Specifies the operating system settings used while creating the virtual + machine. Some of the settings cannot be changed once VM is provisioned. + :type os_profile: ~azure.mgmt.compute.v2020_06_01.models.OSProfile + :param network_profile: Specifies the network interfaces of the virtual machine. + :type network_profile: ~azure.mgmt.compute.v2020_06_01.models.NetworkProfile + :param security_profile: Specifies the Security related profile settings for the virtual + machine. + :type security_profile: ~azure.mgmt.compute.v2020_06_01.models.SecurityProfile + :param diagnostics_profile: Specifies the boot diagnostic settings state. + :code:`
    `:code:`
    `Minimum api-version: 2015-06-15. + :type diagnostics_profile: ~azure.mgmt.compute.v2020_06_01.models.DiagnosticsProfile + :param availability_set: Specifies information about the availability set that the virtual + machine should be assigned to. Virtual machines specified in the same availability set are + allocated to different nodes to maximize availability. For more information about availability + sets, see `Manage the availability of virtual machines + `_. :code:`
    `:code:`
    ` + For more information on Azure planned maintenance, see `Planned maintenance for virtual + machines in Azure `_ + :code:`
    `:code:`
    ` Currently, a VM can only be added to availability set at creation + time. The availability set to which the VM is being added should be under the same resource + group as the availability set resource. An existing VM cannot be added to an availability set. + :code:`
    `:code:`
    `This property cannot exist along with a non-null + properties.virtualMachineScaleSet reference. + :type availability_set: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param virtual_machine_scale_set: Specifies information about the virtual machine scale set + that the virtual machine should be assigned to. Virtual machines specified in the same virtual + machine scale set are allocated to different nodes to maximize availability. Currently, a VM + can only be added to virtual machine scale set at creation time. An existing VM cannot be added + to a virtual machine scale set. :code:`
    `:code:`
    `This property cannot exist along with a + non-null properties.availabilitySet reference. :code:`
    `:code:`
    `Minimum api‐version: + 2019‐03‐01. + :type virtual_machine_scale_set: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param proximity_placement_group: Specifies information about the proximity placement group + that the virtual machine should be assigned to. :code:`
    `:code:`
    `Minimum api-version: + 2018-04-01. + :type proximity_placement_group: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param priority: Specifies the priority for the virtual machine. + :code:`
    `:code:`
    `Minimum api-version: 2019-03-01. Possible values include: "Regular", + "Low", "Spot". + :type priority: str or ~azure.mgmt.compute.v2020_06_01.models.VirtualMachinePriorityTypes + :param eviction_policy: Specifies the eviction policy for the Azure Spot virtual machine and + Azure Spot scale set. :code:`
    `:code:`
    `For Azure Spot virtual machines, both + 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01. + :code:`
    `:code:`
    `For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported + and the minimum api-version is 2017-10-30-preview. Possible values include: "Deallocate", + "Delete". + :type eviction_policy: str or + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineEvictionPolicyTypes + :param billing_profile: Specifies the billing related details of a Azure Spot virtual machine. + :code:`
    `:code:`
    `Minimum api-version: 2019-03-01. + :type billing_profile: ~azure.mgmt.compute.v2020_06_01.models.BillingProfile + :param host: Specifies information about the dedicated host that the virtual machine resides + in. :code:`
    `:code:`
    `Minimum api-version: 2018-10-01. + :type host: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param host_group: Specifies information about the dedicated host group that the virtual + machine resides in. :code:`
    `:code:`
    `Minimum api-version: 2020-06-01. + :code:`
    `:code:`
    `NOTE: User cannot specify both host and hostGroup properties. + :type host_group: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :ivar instance_view: The virtual machine instance view. + :vartype instance_view: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineInstanceView + :param license_type: Specifies that the image or disk that is being used was licensed on- + premises. This element is only used for images that contain the Windows Server operating + system. :code:`
    `:code:`
    ` Possible values are: :code:`
    `:code:`
    ` Windows_Client + :code:`
    `:code:`
    ` Windows_Server :code:`
    `:code:`
    ` If this element is included in + a request for an update, the value must match the initial value. This value cannot be updated. + :code:`
    `:code:`
    ` For more information, see `Azure Hybrid Use Benefit for Windows Server + `_ :code:`
    `:code:`
    ` + Minimum api-version: 2015-06-15. + :type license_type: str + :ivar vm_id: Specifies the VM unique ID which is a 128-bits identifier that is encoded and + stored in all Azure IaaS VMs SMBIOS and can be read using platform BIOS commands. + :vartype vm_id: str + :param extensions_time_budget: Specifies the time alloted for all extensions to start. The time + duration should be between 15 minutes and 120 minutes (inclusive) and should be specified in + ISO 8601 format. The default value is 90 minutes (PT1H30M). :code:`
    `:code:`
    ` Minimum + api-version: 2020-06-01. + :type extensions_time_budget: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'instance_view': {'readonly': True}, + 'vm_id': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'identity': {'key': 'identity', 'type': 'VirtualMachineIdentity'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'hardware_profile': {'key': 'properties.hardwareProfile', 'type': 'HardwareProfile'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, + 'additional_capabilities': {'key': 'properties.additionalCapabilities', 'type': 'AdditionalCapabilities'}, + 'os_profile': {'key': 'properties.osProfile', 'type': 'OSProfile'}, + 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'}, + 'security_profile': {'key': 'properties.securityProfile', 'type': 'SecurityProfile'}, + 'diagnostics_profile': {'key': 'properties.diagnosticsProfile', 'type': 'DiagnosticsProfile'}, + 'availability_set': {'key': 'properties.availabilitySet', 'type': 'SubResource'}, + 'virtual_machine_scale_set': {'key': 'properties.virtualMachineScaleSet', 'type': 'SubResource'}, + 'proximity_placement_group': {'key': 'properties.proximityPlacementGroup', 'type': 'SubResource'}, + 'priority': {'key': 'properties.priority', 'type': 'str'}, + 'eviction_policy': {'key': 'properties.evictionPolicy', 'type': 'str'}, + 'billing_profile': {'key': 'properties.billingProfile', 'type': 'BillingProfile'}, + 'host': {'key': 'properties.host', 'type': 'SubResource'}, + 'host_group': {'key': 'properties.hostGroup', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineInstanceView'}, + 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, + 'vm_id': {'key': 'properties.vmId', 'type': 'str'}, + 'extensions_time_budget': {'key': 'properties.extensionsTimeBudget', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineUpdate, self).__init__(**kwargs) + self.plan = kwargs.get('plan', None) + self.identity = kwargs.get('identity', None) + self.zones = kwargs.get('zones', None) + self.hardware_profile = kwargs.get('hardware_profile', None) + self.storage_profile = kwargs.get('storage_profile', None) + self.additional_capabilities = kwargs.get('additional_capabilities', None) + self.os_profile = kwargs.get('os_profile', None) + self.network_profile = kwargs.get('network_profile', None) + self.security_profile = kwargs.get('security_profile', None) + self.diagnostics_profile = kwargs.get('diagnostics_profile', None) + self.availability_set = kwargs.get('availability_set', None) + self.virtual_machine_scale_set = kwargs.get('virtual_machine_scale_set', None) + self.proximity_placement_group = kwargs.get('proximity_placement_group', None) + self.priority = kwargs.get('priority', None) + self.eviction_policy = kwargs.get('eviction_policy', None) + self.billing_profile = kwargs.get('billing_profile', None) + self.host = kwargs.get('host', None) + self.host_group = kwargs.get('host_group', None) + self.provisioning_state = None + self.instance_view = None + self.license_type = kwargs.get('license_type', None) + self.vm_id = None + self.extensions_time_budget = kwargs.get('extensions_time_budget', None) + + +class VMScaleSetConvertToSinglePlacementGroupInput(msrest.serialization.Model): + """VMScaleSetConvertToSinglePlacementGroupInput. + + :param active_placement_group_id: Id of the placement group in which you want future virtual + machine instances to be placed. To query placement group Id, please use Virtual Machine Scale + Set VMs - Get API. If not provided, the platform will choose one with maximum number of virtual + machine instances. + :type active_placement_group_id: str + """ + + _attribute_map = { + 'active_placement_group_id': {'key': 'activePlacementGroupId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VMScaleSetConvertToSinglePlacementGroupInput, self).__init__(**kwargs) + self.active_placement_group_id = kwargs.get('active_placement_group_id', None) + + +class WindowsConfiguration(msrest.serialization.Model): + """Specifies Windows operating system settings on the virtual machine. + + :param provision_vm_agent: Indicates whether virtual machine agent should be provisioned on the + virtual machine. :code:`
    `:code:`
    ` When this property is not specified in the request + body, default behavior is to set it to true. This will ensure that VM Agent is installed on + the VM so that extensions can be added to the VM later. + :type provision_vm_agent: bool + :param enable_automatic_updates: Indicates whether Automatic Updates is enabled for the Windows + virtual machine. Default value is true. :code:`
    `:code:`
    ` For virtual machine scale + sets, this property can be updated and updates will take effect on OS reprovisioning. + :type enable_automatic_updates: bool + :param time_zone: Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time". + :code:`
    `:code:`
    ` Possible values can be `TimeZoneInfo.Id + `_ + value from time zones returned by `TimeZoneInfo.GetSystemTimeZones + `_. + :type time_zone: str + :param additional_unattend_content: Specifies additional base-64 encoded XML formatted + information that can be included in the Unattend.xml file, which is used by Windows Setup. + :type additional_unattend_content: + list[~azure.mgmt.compute.v2020_06_01.models.AdditionalUnattendContent] + :param patch_settings: Specifies settings related to in-guest patching (KBs). + :type patch_settings: ~azure.mgmt.compute.v2020_06_01.models.PatchSettings + :param win_rm: Specifies the Windows Remote Management listeners. This enables remote Windows + PowerShell. + :type win_rm: ~azure.mgmt.compute.v2020_06_01.models.WinRMConfiguration + """ + + _attribute_map = { + 'provision_vm_agent': {'key': 'provisionVMAgent', 'type': 'bool'}, + 'enable_automatic_updates': {'key': 'enableAutomaticUpdates', 'type': 'bool'}, + 'time_zone': {'key': 'timeZone', 'type': 'str'}, + 'additional_unattend_content': {'key': 'additionalUnattendContent', 'type': '[AdditionalUnattendContent]'}, + 'patch_settings': {'key': 'patchSettings', 'type': 'PatchSettings'}, + 'win_rm': {'key': 'winRM', 'type': 'WinRMConfiguration'}, + } + + def __init__( + self, + **kwargs + ): + super(WindowsConfiguration, self).__init__(**kwargs) + self.provision_vm_agent = kwargs.get('provision_vm_agent', None) + self.enable_automatic_updates = kwargs.get('enable_automatic_updates', None) + self.time_zone = kwargs.get('time_zone', None) + self.additional_unattend_content = kwargs.get('additional_unattend_content', None) + self.patch_settings = kwargs.get('patch_settings', None) + self.win_rm = kwargs.get('win_rm', None) + + +class WinRMConfiguration(msrest.serialization.Model): + """Describes Windows Remote Management configuration of the VM. + + :param listeners: The list of Windows Remote Management listeners. + :type listeners: list[~azure.mgmt.compute.v2020_06_01.models.WinRMListener] + """ + + _attribute_map = { + 'listeners': {'key': 'listeners', 'type': '[WinRMListener]'}, + } + + def __init__( + self, + **kwargs + ): + super(WinRMConfiguration, self).__init__(**kwargs) + self.listeners = kwargs.get('listeners', None) + + +class WinRMListener(msrest.serialization.Model): + """Describes Protocol and thumbprint of Windows Remote Management listener. + + :param protocol: Specifies the protocol of WinRM listener. :code:`
    `:code:`
    ` Possible + values are: :code:`
    `\ **http** :code:`
    `:code:`
    ` **https**. Possible values include: + "Http", "Https". + :type protocol: str or ~azure.mgmt.compute.v2020_06_01.models.ProtocolTypes + :param certificate_url: This is the URL of a certificate that has been uploaded to Key Vault as + a secret. For adding a secret to the Key Vault, see `Add a key or secret to the key vault + `_. In this case, your + certificate needs to be It is the Base64 encoding of the following JSON Object which is encoded + in UTF-8: :code:`
    `:code:`
    ` {:code:`
    ` "data":":code:``",:code:`
    ` "dataType":"pfx",:code:`
    ` "password":":code:``":code:`
    `}. + :type certificate_url: str + """ + + _attribute_map = { + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'certificate_url': {'key': 'certificateUrl', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WinRMListener, self).__init__(**kwargs) + self.protocol = kwargs.get('protocol', None) + self.certificate_url = kwargs.get('certificate_url', 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 new file mode 100644 index 000000000000..f1280078a910 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/_models_py3.py @@ -0,0 +1,8742 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import datetime +from typing import Dict, List, Optional, Union + +import msrest.serialization + +from ._compute_management_client_enums import * + + +class AdditionalCapabilities(msrest.serialization.Model): + """Enables or disables a capability on the virtual machine or virtual machine scale set. + + :param ultra_ssd_enabled: The flag that enables or disables a capability to have one or more + managed data disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed disks with + storage account type UltraSSD_LRS can be added to a virtual machine or virtual machine scale + set only if this property is enabled. + :type ultra_ssd_enabled: bool + """ + + _attribute_map = { + 'ultra_ssd_enabled': {'key': 'ultraSSDEnabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + ultra_ssd_enabled: Optional[bool] = None, + **kwargs + ): + super(AdditionalCapabilities, self).__init__(**kwargs) + self.ultra_ssd_enabled = ultra_ssd_enabled + + +class AdditionalUnattendContent(msrest.serialization.Model): + """Specifies additional XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup. Contents are defined by setting name, component name, and the pass in which the content is applied. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar pass_name: The pass name. Currently, the only allowable value is OobeSystem. Default + value: "OobeSystem". + :vartype pass_name: str + :ivar component_name: The component name. Currently, the only allowable value is Microsoft- + Windows-Shell-Setup. Default value: "Microsoft-Windows-Shell-Setup". + :vartype component_name: str + :param setting_name: Specifies the name of the setting to which the content applies. Possible + values are: FirstLogonCommands and AutoLogon. Possible values include: "AutoLogon", + "FirstLogonCommands". + :type setting_name: str or ~azure.mgmt.compute.v2020_06_01.models.SettingNames + :param content: Specifies the XML formatted content that is added to the unattend.xml file for + the specified path and component. The XML must be less than 4KB and must include the root + element for the setting or feature that is being inserted. + :type content: str + """ + + _validation = { + 'pass_name': {'constant': True}, + 'component_name': {'constant': True}, + } + + _attribute_map = { + 'pass_name': {'key': 'passName', 'type': 'str'}, + 'component_name': {'key': 'componentName', 'type': 'str'}, + 'setting_name': {'key': 'settingName', 'type': 'str'}, + 'content': {'key': 'content', 'type': 'str'}, + } + + pass_name = "OobeSystem" + component_name = "Microsoft-Windows-Shell-Setup" + + def __init__( + self, + *, + setting_name: Optional[Union[str, "SettingNames"]] = None, + content: Optional[str] = None, + **kwargs + ): + super(AdditionalUnattendContent, self).__init__(**kwargs) + self.setting_name = setting_name + self.content = content + + +class ApiEntityReference(msrest.serialization.Model): + """The API entity reference. + + :param id: The ARM resource id in the form of + /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(ApiEntityReference, self).__init__(**kwargs) + self.id = id + + +class ApiError(msrest.serialization.Model): + """Api error. + + :param details: The Api error details. + :type details: list[~azure.mgmt.compute.v2020_06_01.models.ApiErrorBase] + :param innererror: The Api inner error. + :type innererror: ~azure.mgmt.compute.v2020_06_01.models.InnerError + :param code: The error code. + :type code: str + :param target: The target of the particular error. + :type target: str + :param message: The error message. + :type message: str + """ + + _attribute_map = { + 'details': {'key': 'details', 'type': '[ApiErrorBase]'}, + 'innererror': {'key': 'innererror', 'type': 'InnerError'}, + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + details: Optional[List["ApiErrorBase"]] = None, + innererror: Optional["InnerError"] = None, + code: Optional[str] = None, + target: Optional[str] = None, + message: Optional[str] = None, + **kwargs + ): + super(ApiError, self).__init__(**kwargs) + self.details = details + self.innererror = innererror + self.code = code + self.target = target + self.message = message + + +class ApiErrorBase(msrest.serialization.Model): + """Api error base. + + :param code: The error code. + :type code: str + :param target: The target of the particular error. + :type target: str + :param message: The error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + target: Optional[str] = None, + message: Optional[str] = None, + **kwargs + ): + super(ApiErrorBase, self).__init__(**kwargs) + self.code = code + self.target = target + self.message = message + + +class AutomaticOSUpgradePolicy(msrest.serialization.Model): + """The configuration parameters used for performing automatic OS upgrade. + + :param enable_automatic_os_upgrade: Indicates whether OS upgrades should automatically be + applied to scale set instances in a rolling fashion when a newer version of the OS image + becomes available. Default value is false. :code:`
    `:code:`
    ` If this is set to true for + Windows based scale sets, `enableAutomaticUpdates + `_ is automatically set to false and cannot be set to true. + :type enable_automatic_os_upgrade: bool + :param disable_automatic_rollback: Whether OS image rollback feature should be disabled. + Default value is false. + :type disable_automatic_rollback: bool + """ + + _attribute_map = { + 'enable_automatic_os_upgrade': {'key': 'enableAutomaticOSUpgrade', 'type': 'bool'}, + 'disable_automatic_rollback': {'key': 'disableAutomaticRollback', 'type': 'bool'}, + } + + def __init__( + self, + *, + enable_automatic_os_upgrade: Optional[bool] = None, + disable_automatic_rollback: Optional[bool] = None, + **kwargs + ): + super(AutomaticOSUpgradePolicy, self).__init__(**kwargs) + self.enable_automatic_os_upgrade = enable_automatic_os_upgrade + self.disable_automatic_rollback = disable_automatic_rollback + + +class AutomaticOSUpgradeProperties(msrest.serialization.Model): + """Describes automatic OS upgrade properties on the image. + + All required parameters must be populated in order to send to Azure. + + :param automatic_os_upgrade_supported: Required. Specifies whether automatic OS upgrade is + supported on the image. + :type automatic_os_upgrade_supported: bool + """ + + _validation = { + 'automatic_os_upgrade_supported': {'required': True}, + } + + _attribute_map = { + 'automatic_os_upgrade_supported': {'key': 'automaticOSUpgradeSupported', 'type': 'bool'}, + } + + def __init__( + self, + *, + automatic_os_upgrade_supported: bool, + **kwargs + ): + super(AutomaticOSUpgradeProperties, self).__init__(**kwargs) + self.automatic_os_upgrade_supported = automatic_os_upgrade_supported + + +class AutomaticRepairsPolicy(msrest.serialization.Model): + """Specifies the configuration parameters for automatic repairs on the virtual machine scale set. + + :param enabled: Specifies whether automatic repairs should be enabled on the virtual machine + scale set. The default value is false. + :type enabled: bool + :param grace_period: The amount of time for which automatic repairs are suspended due to a + state change on VM. The grace time starts after the state change has completed. This helps + avoid premature or accidental repairs. The time duration should be specified in ISO 8601 + format. The minimum allowed grace period is 30 minutes (PT30M), which is also the default + value. The maximum allowed grace period is 90 minutes (PT90M). + :type grace_period: str + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'grace_period': {'key': 'gracePeriod', 'type': 'str'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + grace_period: Optional[str] = None, + **kwargs + ): + super(AutomaticRepairsPolicy, self).__init__(**kwargs) + self.enabled = enabled + self.grace_period = grace_period + + +class Resource(msrest.serialization.Model): + """The 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. + + :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] + """ + + _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}'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + + +class AvailabilitySet(Resource): + """Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see `Manage the availability of virtual machines `_. :code:`
    `:code:`
    ` For more information on Azure planned maintenance, see `Planned maintenance for virtual machines in Azure `_ :code:`
    `:code:`
    ` Currently, a VM can only be added to availability set at creation time. An existing VM cannot be added to an availability set. + + 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 sku: Sku of the availability set, only name is required to be set. See + AvailabilitySetSkuTypes for possible set of values. Use 'Aligned' for virtual machines with + managed disks and 'Classic' for virtual machines with unmanaged disks. Default value is + 'Classic'. + :type sku: ~azure.mgmt.compute.v2020_06_01.models.Sku + :param platform_update_domain_count: Update Domain count. + :type platform_update_domain_count: int + :param platform_fault_domain_count: Fault Domain count. + :type platform_fault_domain_count: int + :param virtual_machines: A list of references to all virtual machines in the availability set. + :type virtual_machines: list[~azure.mgmt.compute.v2020_06_01.models.SubResource] + :param proximity_placement_group: Specifies information about the proximity placement group + that the availability set should be assigned to. :code:`
    `:code:`
    `Minimum api-version: + 2018-04-01. + :type proximity_placement_group: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :ivar statuses: The resource status information. + :vartype statuses: list[~azure.mgmt.compute.v2020_06_01.models.InstanceViewStatus] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'statuses': {'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}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'platform_update_domain_count': {'key': 'properties.platformUpdateDomainCount', 'type': 'int'}, + 'platform_fault_domain_count': {'key': 'properties.platformFaultDomainCount', 'type': 'int'}, + 'virtual_machines': {'key': 'properties.virtualMachines', 'type': '[SubResource]'}, + 'proximity_placement_group': {'key': 'properties.proximityPlacementGroup', 'type': 'SubResource'}, + 'statuses': {'key': 'properties.statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + sku: Optional["Sku"] = None, + platform_update_domain_count: Optional[int] = None, + platform_fault_domain_count: Optional[int] = None, + virtual_machines: Optional[List["SubResource"]] = None, + proximity_placement_group: Optional["SubResource"] = None, + **kwargs + ): + super(AvailabilitySet, self).__init__(location=location, tags=tags, **kwargs) + self.sku = sku + self.platform_update_domain_count = platform_update_domain_count + self.platform_fault_domain_count = platform_fault_domain_count + self.virtual_machines = virtual_machines + self.proximity_placement_group = proximity_placement_group + self.statuses = None + + +class AvailabilitySetListResult(msrest.serialization.Model): + """The List Availability Set operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of availability sets. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.AvailabilitySet] + :param next_link: The URI to fetch the next page of AvailabilitySets. Call ListNext() with this + URI to fetch the next page of AvailabilitySets. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AvailabilitySet]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["AvailabilitySet"], + next_link: Optional[str] = None, + **kwargs + ): + super(AvailabilitySetListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class UpdateResource(msrest.serialization.Model): + """The Update Resource model definition. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(UpdateResource, self).__init__(**kwargs) + self.tags = tags + + +class AvailabilitySetUpdate(UpdateResource): + """Specifies information about the availability set that the virtual machine should be assigned to. Only tags may be updated. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param sku: Sku of the availability set. + :type sku: ~azure.mgmt.compute.v2020_06_01.models.Sku + :param platform_update_domain_count: Update Domain count. + :type platform_update_domain_count: int + :param platform_fault_domain_count: Fault Domain count. + :type platform_fault_domain_count: int + :param virtual_machines: A list of references to all virtual machines in the availability set. + :type virtual_machines: list[~azure.mgmt.compute.v2020_06_01.models.SubResource] + :param proximity_placement_group: Specifies information about the proximity placement group + that the availability set should be assigned to. :code:`
    `:code:`
    `Minimum api-version: + 2018-04-01. + :type proximity_placement_group: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :ivar statuses: The resource status information. + :vartype statuses: list[~azure.mgmt.compute.v2020_06_01.models.InstanceViewStatus] + """ + + _validation = { + 'statuses': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'platform_update_domain_count': {'key': 'properties.platformUpdateDomainCount', 'type': 'int'}, + 'platform_fault_domain_count': {'key': 'properties.platformFaultDomainCount', 'type': 'int'}, + 'virtual_machines': {'key': 'properties.virtualMachines', 'type': '[SubResource]'}, + 'proximity_placement_group': {'key': 'properties.proximityPlacementGroup', 'type': 'SubResource'}, + 'statuses': {'key': 'properties.statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + sku: Optional["Sku"] = None, + platform_update_domain_count: Optional[int] = None, + platform_fault_domain_count: Optional[int] = None, + virtual_machines: Optional[List["SubResource"]] = None, + proximity_placement_group: Optional["SubResource"] = None, + **kwargs + ): + super(AvailabilitySetUpdate, self).__init__(tags=tags, **kwargs) + self.sku = sku + self.platform_update_domain_count = platform_update_domain_count + self.platform_fault_domain_count = platform_fault_domain_count + self.virtual_machines = virtual_machines + self.proximity_placement_group = proximity_placement_group + self.statuses = None + + +class AvailablePatchSummary(msrest.serialization.Model): + """Describes the properties of an virtual machine instance view for available patch summary. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status: The overall success or failure status of the operation. It remains "InProgress" + until the operation completes. At that point it will become "Failed", "Succeeded", or + "CompletedWithWarnings.". Possible values include: "InProgress", "Failed", "Succeeded", + "CompletedWithWarnings". + :vartype status: str or ~azure.mgmt.compute.v2020_06_01.models.PatchOperationStatus + :ivar assessment_activity_id: The activity ID of the operation that produced this result. It is + used to correlate across CRP and extension logs. + :vartype assessment_activity_id: str + :ivar reboot_pending: The overall reboot status of the VM. It will be true when partially + installed patches require a reboot to complete installation but the reboot has not yet + occurred. + :vartype reboot_pending: bool + :ivar critical_and_security_patch_count: The number of critical or security patches that have + been detected as available and not yet installed. + :vartype critical_and_security_patch_count: int + :ivar other_patch_count: The number of all available patches excluding critical and security. + :vartype other_patch_count: int + :ivar start_time: The UTC timestamp when the operation began. + :vartype start_time: ~datetime.datetime + :ivar last_modified_time: The UTC timestamp when the operation began. + :vartype last_modified_time: ~datetime.datetime + :ivar error: The errors that were encountered during execution of the operation. The details + array contains the list of them. + :vartype error: ~azure.mgmt.compute.v2020_06_01.models.ApiError + """ + + _validation = { + 'status': {'readonly': True}, + 'assessment_activity_id': {'readonly': True}, + 'reboot_pending': {'readonly': True}, + 'critical_and_security_patch_count': {'readonly': True}, + 'other_patch_count': {'readonly': True}, + 'start_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'assessment_activity_id': {'key': 'assessmentActivityId', 'type': 'str'}, + 'reboot_pending': {'key': 'rebootPending', 'type': 'bool'}, + 'critical_and_security_patch_count': {'key': 'criticalAndSecurityPatchCount', 'type': 'int'}, + 'other_patch_count': {'key': 'otherPatchCount', 'type': 'int'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'lastModifiedTime', 'type': 'iso-8601'}, + 'error': {'key': 'error', 'type': 'ApiError'}, + } + + def __init__( + self, + **kwargs + ): + super(AvailablePatchSummary, self).__init__(**kwargs) + self.status = None + self.assessment_activity_id = None + self.reboot_pending = None + self.critical_and_security_patch_count = None + self.other_patch_count = None + self.start_time = None + self.last_modified_time = None + self.error = None + + +class BillingProfile(msrest.serialization.Model): + """Specifies the billing related details of a Azure Spot VM or VMSS. :code:`
    `:code:`
    `Minimum api-version: 2019-03-01. + + :param max_price: Specifies the maximum price you are willing to pay for a Azure Spot VM/VMSS. + This price is in US Dollars. :code:`
    `:code:`
    ` This price will be compared with the + current Azure Spot price for the VM size. Also, the prices are compared at the time of + create/update of Azure Spot VM/VMSS and the operation will only succeed if the maxPrice is + greater than the current Azure Spot price. :code:`
    `:code:`
    ` The maxPrice will also be + used for evicting a Azure Spot VM/VMSS if the current Azure Spot price goes beyond the maxPrice + after creation of VM/VMSS. :code:`
    `:code:`
    ` Possible values are: + :code:`
    `:code:`
    ` - Any decimal value greater than zero. Example: 0.01538 + :code:`
    `:code:`
    ` -1 – indicates default price to be up-to on-demand. + :code:`
    `:code:`
    ` You can set the maxPrice to -1 to indicate that the Azure Spot VM/VMSS + should not be evicted for price reasons. Also, the default max price is -1 if it is not + provided by you. :code:`
    `:code:`
    `Minimum api-version: 2019-03-01. + :type max_price: float + """ + + _attribute_map = { + 'max_price': {'key': 'maxPrice', 'type': 'float'}, + } + + def __init__( + self, + *, + max_price: Optional[float] = None, + **kwargs + ): + super(BillingProfile, self).__init__(**kwargs) + self.max_price = max_price + + +class BootDiagnostics(msrest.serialization.Model): + """Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status. :code:`
    `:code:`
    ` You can easily view the output of your console log. :code:`
    `:code:`
    ` Azure also enables you to see a screenshot of the VM from the hypervisor. + + :param enabled: Whether boot diagnostics should be enabled on the Virtual Machine. + :type enabled: bool + :param storage_uri: Uri of the storage account to use for placing the console output and + screenshot. :code:`
    `:code:`
    `If storageUri is not specified while enabling boot + diagnostics, managed storage will be used. + :type storage_uri: str + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'storage_uri': {'key': 'storageUri', 'type': 'str'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + storage_uri: Optional[str] = None, + **kwargs + ): + super(BootDiagnostics, self).__init__(**kwargs) + self.enabled = enabled + self.storage_uri = storage_uri + + +class BootDiagnosticsInstanceView(msrest.serialization.Model): + """The instance view of a virtual machine boot diagnostics. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar console_screenshot_blob_uri: The console screenshot blob URI. + :code:`
    `:code:`
    `NOTE: This will **not** be set if boot diagnostics is currently enabled + with managed storage. + :vartype console_screenshot_blob_uri: str + :ivar serial_console_log_blob_uri: The serial console log blob Uri. + :code:`
    `:code:`
    `NOTE: This will **not** be set if boot diagnostics is currently enabled + with managed storage. + :vartype serial_console_log_blob_uri: str + :ivar status: The boot diagnostics status information for the VM. :code:`
    `:code:`
    ` + NOTE: It will be set only if there are errors encountered in enabling boot diagnostics. + :vartype status: ~azure.mgmt.compute.v2020_06_01.models.InstanceViewStatus + """ + + _validation = { + 'console_screenshot_blob_uri': {'readonly': True}, + 'serial_console_log_blob_uri': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'console_screenshot_blob_uri': {'key': 'consoleScreenshotBlobUri', 'type': 'str'}, + 'serial_console_log_blob_uri': {'key': 'serialConsoleLogBlobUri', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'InstanceViewStatus'}, + } + + def __init__( + self, + **kwargs + ): + super(BootDiagnosticsInstanceView, self).__init__(**kwargs) + self.console_screenshot_blob_uri = None + self.serial_console_log_blob_uri = None + self.status = None + + +class Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): + """Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): + """ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class ComputeOperationListResult(msrest.serialization.Model): + """The List Compute Operation operation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of compute operations. + :vartype value: list[~azure.mgmt.compute.v2020_06_01.models.ComputeOperationValue] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ComputeOperationValue]'}, + } + + def __init__( + self, + **kwargs + ): + super(ComputeOperationListResult, self).__init__(**kwargs) + self.value = None + + +class ComputeOperationValue(msrest.serialization.Model): + """Describes the properties of a Compute Operation value. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar origin: The origin of the compute operation. + :vartype origin: str + :ivar name: The name of the compute operation. + :vartype name: str + :ivar operation: The display name of the compute operation. + :vartype operation: str + :ivar resource: The display name of the resource the operation applies to. + :vartype resource: str + :ivar description: The description of the operation. + :vartype description: str + :ivar provider: The resource provider for the operation. + :vartype provider: str + """ + + _validation = { + 'origin': {'readonly': True}, + 'name': {'readonly': True}, + 'operation': {'readonly': True}, + 'resource': {'readonly': True}, + 'description': {'readonly': True}, + 'provider': {'readonly': True}, + } + + _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'operation': {'key': 'display.operation', 'type': 'str'}, + 'resource': {'key': 'display.resource', 'type': 'str'}, + 'description': {'key': 'display.description', 'type': 'str'}, + 'provider': {'key': 'display.provider', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ComputeOperationValue, self).__init__(**kwargs) + self.origin = None + self.name = None + self.operation = None + self.resource = None + self.description = None + self.provider = None + + +class DataDisk(msrest.serialization.Model): + """Describes a data 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 lun: Required. Specifies the logical unit number of the data disk. This value is used to + identify data disks within the VM and therefore must be unique for each data disk attached to a + VM. + :type lun: int + :param name: The disk name. + :type name: str + :param vhd: The virtual hard disk. + :type vhd: ~azure.mgmt.compute.v2020_06_01.models.VirtualHardDisk + :param image: The source user image virtual hard disk. The virtual hard disk will be copied + before being attached to the virtual machine. If SourceImage is provided, the destination + virtual hard drive must not exist. + :type image: ~azure.mgmt.compute.v2020_06_01.models.VirtualHardDisk + :param caching: Specifies the caching requirements. :code:`
    `:code:`
    ` Possible values + are: :code:`
    `:code:`
    ` **None** :code:`
    `:code:`
    ` **ReadOnly** + :code:`
    `:code:`
    ` **ReadWrite** :code:`
    `:code:`
    ` Default: **None for Standard + storage. ReadOnly for Premium storage**. Possible values include: "None", "ReadOnly", + "ReadWrite". + :type caching: str or ~azure.mgmt.compute.v2020_06_01.models.CachingTypes + :param write_accelerator_enabled: Specifies whether writeAccelerator should be enabled or + disabled on the disk. + :type write_accelerator_enabled: bool + :param create_option: Required. Specifies how the virtual machine should be + created.:code:`
    `:code:`
    ` Possible values are::code:`
    `:code:`
    ` **Attach** \u2013 + This value is used when you are using a specialized disk to create the virtual + machine.:code:`
    `:code:`
    ` **FromImage** \u2013 This value is used when you are using an + image to create the virtual machine. If you are using a platform image, you also use the + imageReference element described above. If you are using a marketplace image, you also use the + plan element previously described. Possible values include: "FromImage", "Empty", "Attach". + :type create_option: str or ~azure.mgmt.compute.v2020_06_01.models.DiskCreateOptionTypes + :param disk_size_gb: Specifies the size of an empty data disk in gigabytes. This element can be + used to overwrite the size of the disk in a virtual machine image. :code:`
    `:code:`
    ` + This value cannot be larger than 1023 GB. + :type disk_size_gb: int + :param managed_disk: The managed disk parameters. + :type managed_disk: ~azure.mgmt.compute.v2020_06_01.models.ManagedDiskParameters + :param to_be_detached: Specifies whether the data disk is in process of detachment from the + VirtualMachine/VirtualMachineScaleset. + :type to_be_detached: bool + :ivar disk_iops_read_write: Specifies the Read-Write IOPS for the managed disk when + StorageAccountType is UltraSSD_LRS. Returned only for VirtualMachine ScaleSet VM disks. Can be + updated only via updates to the VirtualMachine Scale Set. + :vartype disk_iops_read_write: long + :ivar disk_m_bps_read_write: Specifies the bandwidth in MB per second for the managed disk when + StorageAccountType is UltraSSD_LRS. Returned only for VirtualMachine ScaleSet VM disks. Can be + updated only via updates to the VirtualMachine Scale Set. + :vartype disk_m_bps_read_write: long + """ + + _validation = { + 'lun': {'required': True}, + 'create_option': {'required': True}, + 'disk_iops_read_write': {'readonly': True}, + 'disk_m_bps_read_write': {'readonly': True}, + } + + _attribute_map = { + 'lun': {'key': 'lun', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'vhd': {'key': 'vhd', 'type': 'VirtualHardDisk'}, + 'image': {'key': 'image', 'type': 'VirtualHardDisk'}, + 'caching': {'key': 'caching', 'type': 'str'}, + 'write_accelerator_enabled': {'key': 'writeAcceleratorEnabled', 'type': 'bool'}, + 'create_option': {'key': 'createOption', 'type': 'str'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + 'managed_disk': {'key': 'managedDisk', 'type': 'ManagedDiskParameters'}, + 'to_be_detached': {'key': 'toBeDetached', 'type': 'bool'}, + 'disk_iops_read_write': {'key': 'diskIOPSReadWrite', 'type': 'long'}, + 'disk_m_bps_read_write': {'key': 'diskMBpsReadWrite', 'type': 'long'}, + } + + def __init__( + self, + *, + lun: int, + create_option: Union[str, "DiskCreateOptionTypes"], + name: Optional[str] = None, + vhd: Optional["VirtualHardDisk"] = None, + image: Optional["VirtualHardDisk"] = None, + caching: Optional[Union[str, "CachingTypes"]] = None, + write_accelerator_enabled: Optional[bool] = None, + disk_size_gb: Optional[int] = None, + managed_disk: Optional["ManagedDiskParameters"] = None, + to_be_detached: Optional[bool] = None, + **kwargs + ): + super(DataDisk, self).__init__(**kwargs) + self.lun = lun + self.name = name + self.vhd = vhd + self.image = image + self.caching = caching + self.write_accelerator_enabled = write_accelerator_enabled + self.create_option = create_option + self.disk_size_gb = disk_size_gb + self.managed_disk = managed_disk + self.to_be_detached = to_be_detached + self.disk_iops_read_write = None + self.disk_m_bps_read_write = None + + +class DataDiskImage(msrest.serialization.Model): + """Contains the data disk images information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar lun: Specifies the logical unit number of the data disk. This value is used to identify + data disks within the VM and therefore must be unique for each data disk attached to a VM. + :vartype lun: int + """ + + _validation = { + 'lun': {'readonly': True}, + } + + _attribute_map = { + 'lun': {'key': 'lun', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(DataDiskImage, self).__init__(**kwargs) + self.lun = None + + +class DedicatedHost(Resource): + """Specifies information about the Dedicated host. + + 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 sku: Required. SKU of the dedicated host for Hardware Generation and VM family. Only + name is required to be set. List Microsoft.Compute SKUs for a list of possible values. + :type sku: ~azure.mgmt.compute.v2020_06_01.models.Sku + :param platform_fault_domain: Fault domain of the dedicated host within a dedicated host group. + :type platform_fault_domain: int + :param auto_replace_on_failure: Specifies whether the dedicated host should be replaced + automatically in case of a failure. The value is defaulted to 'true' when not provided. + :type auto_replace_on_failure: bool + :ivar host_id: A unique id generated and assigned to the dedicated host by the platform. + :code:`
    `:code:`
    ` Does not change throughout the lifetime of the host. + :vartype host_id: str + :ivar virtual_machines: A list of references to all virtual machines in the Dedicated Host. + :vartype virtual_machines: list[~azure.mgmt.compute.v2020_06_01.models.SubResourceReadOnly] + :param license_type: Specifies the software license type that will be applied to the VMs + deployed on the dedicated host. :code:`
    `:code:`
    ` Possible values are: + :code:`
    `:code:`
    ` **None** :code:`
    `:code:`
    ` **Windows_Server_Hybrid** + :code:`
    `:code:`
    ` **Windows_Server_Perpetual** :code:`
    `:code:`
    ` Default: + **None**. Possible values include: "None", "Windows_Server_Hybrid", "Windows_Server_Perpetual". + :type license_type: str or ~azure.mgmt.compute.v2020_06_01.models.DedicatedHostLicenseTypes + :ivar provisioning_time: The date when the host was first provisioned. + :vartype provisioning_time: ~datetime.datetime + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :ivar instance_view: The dedicated host instance view. + :vartype instance_view: ~azure.mgmt.compute.v2020_06_01.models.DedicatedHostInstanceView + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'required': True}, + 'platform_fault_domain': {'maximum': 2, 'minimum': 0}, + 'host_id': {'readonly': True}, + 'virtual_machines': {'readonly': True}, + 'provisioning_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'instance_view': {'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}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'platform_fault_domain': {'key': 'properties.platformFaultDomain', 'type': 'int'}, + 'auto_replace_on_failure': {'key': 'properties.autoReplaceOnFailure', 'type': 'bool'}, + 'host_id': {'key': 'properties.hostId', 'type': 'str'}, + 'virtual_machines': {'key': 'properties.virtualMachines', 'type': '[SubResourceReadOnly]'}, + 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, + 'provisioning_time': {'key': 'properties.provisioningTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'DedicatedHostInstanceView'}, + } + + def __init__( + self, + *, + location: str, + sku: "Sku", + tags: Optional[Dict[str, str]] = None, + platform_fault_domain: Optional[int] = None, + auto_replace_on_failure: Optional[bool] = None, + license_type: Optional[Union[str, "DedicatedHostLicenseTypes"]] = None, + **kwargs + ): + super(DedicatedHost, self).__init__(location=location, tags=tags, **kwargs) + self.sku = sku + self.platform_fault_domain = platform_fault_domain + self.auto_replace_on_failure = auto_replace_on_failure + self.host_id = None + self.virtual_machines = None + self.license_type = license_type + self.provisioning_time = None + self.provisioning_state = None + self.instance_view = None + + +class DedicatedHostAllocatableVM(msrest.serialization.Model): + """Represents the dedicated host unutilized capacity in terms of a specific VM size. + + :param vm_size: VM size in terms of which the unutilized capacity is represented. + :type vm_size: str + :param count: Maximum number of VMs of size vmSize that can fit in the dedicated host's + remaining capacity. + :type count: float + """ + + _attribute_map = { + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'float'}, + } + + def __init__( + self, + *, + vm_size: Optional[str] = None, + count: Optional[float] = None, + **kwargs + ): + super(DedicatedHostAllocatableVM, self).__init__(**kwargs) + self.vm_size = vm_size + self.count = count + + +class DedicatedHostAvailableCapacity(msrest.serialization.Model): + """Dedicated host unutilized capacity. + + :param allocatable_v_ms: The unutilized capacity of the dedicated host represented in terms of + each VM size that is allowed to be deployed to the dedicated host. + :type allocatable_v_ms: list[~azure.mgmt.compute.v2020_06_01.models.DedicatedHostAllocatableVM] + """ + + _attribute_map = { + 'allocatable_v_ms': {'key': 'allocatableVMs', 'type': '[DedicatedHostAllocatableVM]'}, + } + + def __init__( + self, + *, + allocatable_v_ms: Optional[List["DedicatedHostAllocatableVM"]] = None, + **kwargs + ): + super(DedicatedHostAvailableCapacity, self).__init__(**kwargs) + self.allocatable_v_ms = allocatable_v_ms + + +class DedicatedHostGroup(Resource): + """Specifies information about the dedicated host group that the dedicated hosts should be assigned to. :code:`
    `:code:`
    ` Currently, a dedicated host can only be added to a dedicated host group at creation time. An existing dedicated host cannot be added to another dedicated host group. + + 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 zones: Availability Zone to use for this host group. Only single zone is supported. The + zone can be assigned only during creation. If not provided, the group supports all zones in the + region. If provided, enforces each host in the group to be in the same zone. + :type zones: list[str] + :param platform_fault_domain_count: Number of fault domains that the host group can span. + :type platform_fault_domain_count: int + :ivar hosts: A list of references to all dedicated hosts in the dedicated host group. + :vartype hosts: list[~azure.mgmt.compute.v2020_06_01.models.SubResourceReadOnly] + :ivar instance_view: The dedicated host group instance view, which has the list of instance + view of the dedicated hosts under the dedicated host group. + :vartype instance_view: ~azure.mgmt.compute.v2020_06_01.models.DedicatedHostGroupInstanceView + :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. + :type support_automatic_placement: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'platform_fault_domain_count': {'maximum': 3, 'minimum': 1}, + 'hosts': {'readonly': True}, + 'instance_view': {'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}'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'platform_fault_domain_count': {'key': 'properties.platformFaultDomainCount', 'type': 'int'}, + 'hosts': {'key': 'properties.hosts', 'type': '[SubResourceReadOnly]'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'DedicatedHostGroupInstanceView'}, + 'support_automatic_placement': {'key': 'properties.supportAutomaticPlacement', 'type': 'bool'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + zones: Optional[List[str]] = None, + platform_fault_domain_count: Optional[int] = None, + support_automatic_placement: Optional[bool] = None, + **kwargs + ): + super(DedicatedHostGroup, self).__init__(location=location, tags=tags, **kwargs) + self.zones = zones + self.platform_fault_domain_count = platform_fault_domain_count + self.hosts = None + self.instance_view = None + self.support_automatic_placement = support_automatic_placement + + +class DedicatedHostGroupInstanceView(msrest.serialization.Model): + """DedicatedHostGroupInstanceView. + + :param hosts: List of instance view of the dedicated hosts under the dedicated host group. + :type hosts: list[~azure.mgmt.compute.v2020_06_01.models.DedicatedHostInstanceViewWithName] + """ + + _attribute_map = { + 'hosts': {'key': 'hosts', 'type': '[DedicatedHostInstanceViewWithName]'}, + } + + def __init__( + self, + *, + hosts: Optional[List["DedicatedHostInstanceViewWithName"]] = None, + **kwargs + ): + super(DedicatedHostGroupInstanceView, self).__init__(**kwargs) + self.hosts = hosts + + +class DedicatedHostGroupListResult(msrest.serialization.Model): + """The List Dedicated Host Group with resource group response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of dedicated host groups. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.DedicatedHostGroup] + :param next_link: The URI to fetch the next page of Dedicated Host Groups. Call ListNext() with + this URI to fetch the next page of Dedicated Host Groups. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DedicatedHostGroup]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["DedicatedHostGroup"], + next_link: Optional[str] = None, + **kwargs + ): + super(DedicatedHostGroupListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class DedicatedHostGroupUpdate(UpdateResource): + """Specifies information about the dedicated host group that the dedicated host should be assigned to. Only tags may be updated. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param zones: Availability Zone to use for this host group. Only single zone is supported. The + zone can be assigned only during creation. If not provided, the group supports all zones in the + region. If provided, enforces each host in the group to be in the same zone. + :type zones: list[str] + :param platform_fault_domain_count: Number of fault domains that the host group can span. + :type platform_fault_domain_count: int + :ivar hosts: A list of references to all dedicated hosts in the dedicated host group. + :vartype hosts: list[~azure.mgmt.compute.v2020_06_01.models.SubResourceReadOnly] + :ivar instance_view: The dedicated host group instance view, which has the list of instance + view of the dedicated hosts under the dedicated host group. + :vartype instance_view: ~azure.mgmt.compute.v2020_06_01.models.DedicatedHostGroupInstanceView + :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. + :type support_automatic_placement: bool + """ + + _validation = { + 'platform_fault_domain_count': {'maximum': 3, 'minimum': 1}, + 'hosts': {'readonly': True}, + 'instance_view': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'platform_fault_domain_count': {'key': 'properties.platformFaultDomainCount', 'type': 'int'}, + 'hosts': {'key': 'properties.hosts', 'type': '[SubResourceReadOnly]'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'DedicatedHostGroupInstanceView'}, + 'support_automatic_placement': {'key': 'properties.supportAutomaticPlacement', 'type': 'bool'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + zones: Optional[List[str]] = None, + platform_fault_domain_count: Optional[int] = None, + support_automatic_placement: Optional[bool] = None, + **kwargs + ): + super(DedicatedHostGroupUpdate, self).__init__(tags=tags, **kwargs) + self.zones = zones + self.platform_fault_domain_count = platform_fault_domain_count + self.hosts = None + self.instance_view = None + self.support_automatic_placement = support_automatic_placement + + +class DedicatedHostInstanceView(msrest.serialization.Model): + """The instance view of a dedicated host. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar asset_id: Specifies the unique id of the dedicated physical machine on which the + dedicated host resides. + :vartype asset_id: str + :param available_capacity: Unutilized capacity of the dedicated host. + :type available_capacity: ~azure.mgmt.compute.v2020_06_01.models.DedicatedHostAvailableCapacity + :param statuses: The resource status information. + :type statuses: list[~azure.mgmt.compute.v2020_06_01.models.InstanceViewStatus] + """ + + _validation = { + 'asset_id': {'readonly': True}, + } + + _attribute_map = { + 'asset_id': {'key': 'assetId', 'type': 'str'}, + 'available_capacity': {'key': 'availableCapacity', 'type': 'DedicatedHostAvailableCapacity'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__( + self, + *, + available_capacity: Optional["DedicatedHostAvailableCapacity"] = None, + statuses: Optional[List["InstanceViewStatus"]] = None, + **kwargs + ): + super(DedicatedHostInstanceView, self).__init__(**kwargs) + self.asset_id = None + self.available_capacity = available_capacity + self.statuses = statuses + + +class DedicatedHostInstanceViewWithName(DedicatedHostInstanceView): + """The instance view of a dedicated host that includes the name of the dedicated host. It is used for the response to the instance view of a dedicated host group. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar asset_id: Specifies the unique id of the dedicated physical machine on which the + dedicated host resides. + :vartype asset_id: str + :param available_capacity: Unutilized capacity of the dedicated host. + :type available_capacity: ~azure.mgmt.compute.v2020_06_01.models.DedicatedHostAvailableCapacity + :param statuses: The resource status information. + :type statuses: list[~azure.mgmt.compute.v2020_06_01.models.InstanceViewStatus] + :ivar name: The name of the dedicated host. + :vartype name: str + """ + + _validation = { + 'asset_id': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'asset_id': {'key': 'assetId', 'type': 'str'}, + 'available_capacity': {'key': 'availableCapacity', 'type': 'DedicatedHostAvailableCapacity'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + available_capacity: Optional["DedicatedHostAvailableCapacity"] = None, + statuses: Optional[List["InstanceViewStatus"]] = None, + **kwargs + ): + super(DedicatedHostInstanceViewWithName, self).__init__(available_capacity=available_capacity, statuses=statuses, **kwargs) + self.name = None + + +class DedicatedHostListResult(msrest.serialization.Model): + """The list dedicated host operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of dedicated hosts. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.DedicatedHost] + :param next_link: The URI to fetch the next page of dedicated hosts. Call ListNext() with this + URI to fetch the next page of dedicated hosts. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DedicatedHost]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["DedicatedHost"], + next_link: Optional[str] = None, + **kwargs + ): + super(DedicatedHostListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class DedicatedHostUpdate(UpdateResource): + """Specifies information about the dedicated host. Only tags, autoReplaceOnFailure and licenseType may be updated. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param platform_fault_domain: Fault domain of the dedicated host within a dedicated host group. + :type platform_fault_domain: int + :param auto_replace_on_failure: Specifies whether the dedicated host should be replaced + automatically in case of a failure. The value is defaulted to 'true' when not provided. + :type auto_replace_on_failure: bool + :ivar host_id: A unique id generated and assigned to the dedicated host by the platform. + :code:`
    `:code:`
    ` Does not change throughout the lifetime of the host. + :vartype host_id: str + :ivar virtual_machines: A list of references to all virtual machines in the Dedicated Host. + :vartype virtual_machines: list[~azure.mgmt.compute.v2020_06_01.models.SubResourceReadOnly] + :param license_type: Specifies the software license type that will be applied to the VMs + deployed on the dedicated host. :code:`
    `:code:`
    ` Possible values are: + :code:`
    `:code:`
    ` **None** :code:`
    `:code:`
    ` **Windows_Server_Hybrid** + :code:`
    `:code:`
    ` **Windows_Server_Perpetual** :code:`
    `:code:`
    ` Default: + **None**. Possible values include: "None", "Windows_Server_Hybrid", "Windows_Server_Perpetual". + :type license_type: str or ~azure.mgmt.compute.v2020_06_01.models.DedicatedHostLicenseTypes + :ivar provisioning_time: The date when the host was first provisioned. + :vartype provisioning_time: ~datetime.datetime + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :ivar instance_view: The dedicated host instance view. + :vartype instance_view: ~azure.mgmt.compute.v2020_06_01.models.DedicatedHostInstanceView + """ + + _validation = { + 'platform_fault_domain': {'maximum': 2, 'minimum': 0}, + 'host_id': {'readonly': True}, + 'virtual_machines': {'readonly': True}, + 'provisioning_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'instance_view': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'platform_fault_domain': {'key': 'properties.platformFaultDomain', 'type': 'int'}, + 'auto_replace_on_failure': {'key': 'properties.autoReplaceOnFailure', 'type': 'bool'}, + 'host_id': {'key': 'properties.hostId', 'type': 'str'}, + 'virtual_machines': {'key': 'properties.virtualMachines', 'type': '[SubResourceReadOnly]'}, + 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, + 'provisioning_time': {'key': 'properties.provisioningTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'DedicatedHostInstanceView'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + platform_fault_domain: Optional[int] = None, + auto_replace_on_failure: Optional[bool] = None, + license_type: Optional[Union[str, "DedicatedHostLicenseTypes"]] = None, + **kwargs + ): + super(DedicatedHostUpdate, self).__init__(tags=tags, **kwargs) + self.platform_fault_domain = platform_fault_domain + self.auto_replace_on_failure = auto_replace_on_failure + self.host_id = None + self.virtual_machines = None + self.license_type = license_type + self.provisioning_time = None + self.provisioning_state = None + self.instance_view = None + + +class DiagnosticsProfile(msrest.serialization.Model): + """Specifies the boot diagnostic settings state. :code:`
    `:code:`
    `Minimum api-version: 2015-06-15. + + :param boot_diagnostics: Boot Diagnostics is a debugging feature which allows you to view + Console Output and Screenshot to diagnose VM status. :code:`
    `:code:`
    ` You can easily + view the output of your console log. :code:`
    `:code:`
    ` Azure also enables you to see a + screenshot of the VM from the hypervisor. + :type boot_diagnostics: ~azure.mgmt.compute.v2020_06_01.models.BootDiagnostics + """ + + _attribute_map = { + 'boot_diagnostics': {'key': 'bootDiagnostics', 'type': 'BootDiagnostics'}, + } + + def __init__( + self, + *, + boot_diagnostics: Optional["BootDiagnostics"] = None, + **kwargs + ): + super(DiagnosticsProfile, self).__init__(**kwargs) + self.boot_diagnostics = boot_diagnostics + + +class DiffDiskSettings(msrest.serialization.Model): + """Describes the parameters of ephemeral disk settings that can be specified for operating system disk. :code:`
    `:code:`
    ` NOTE: The ephemeral disk settings can only be specified for managed disk. + + :param option: Specifies the ephemeral disk settings for operating system disk. Possible values + include: "Local". + :type option: str or ~azure.mgmt.compute.v2020_06_01.models.DiffDiskOptions + :param placement: Specifies the ephemeral disk placement for operating system + disk.:code:`
    `:code:`
    ` Possible values are: :code:`
    `:code:`
    ` **CacheDisk** + :code:`
    `:code:`
    ` **ResourceDisk** :code:`
    `:code:`
    ` Default: **CacheDisk** if + one is configured for the VM size otherwise **ResourceDisk** is used.:code:`
    `:code:`
    ` + Refer to VM size documentation for Windows VM at https://docs.microsoft.com/en- + us/azure/virtual-machines/windows/sizes and Linux VM at https://docs.microsoft.com/en- + us/azure/virtual-machines/linux/sizes to check which VM sizes exposes a cache disk. Possible + values include: "CacheDisk", "ResourceDisk". + :type placement: str or ~azure.mgmt.compute.v2020_06_01.models.DiffDiskPlacement + """ + + _attribute_map = { + 'option': {'key': 'option', 'type': 'str'}, + 'placement': {'key': 'placement', 'type': 'str'}, + } + + def __init__( + self, + *, + option: Optional[Union[str, "DiffDiskOptions"]] = None, + placement: Optional[Union[str, "DiffDiskPlacement"]] = None, + **kwargs + ): + super(DiffDiskSettings, self).__init__(**kwargs) + self.option = option + self.placement = placement + + +class DisallowedConfiguration(msrest.serialization.Model): + """Specifies the disallowed configuration for a virtual machine image. + + :param vm_disk_type: VM disk types which are disallowed. Possible values include: "None", + "Unmanaged". + :type vm_disk_type: str or ~azure.mgmt.compute.v2020_06_01.models.VmDiskTypes + """ + + _attribute_map = { + 'vm_disk_type': {'key': 'vmDiskType', 'type': 'str'}, + } + + def __init__( + self, + *, + vm_disk_type: Optional[Union[str, "VmDiskTypes"]] = None, + **kwargs + ): + super(DisallowedConfiguration, self).__init__(**kwargs) + self.vm_disk_type = vm_disk_type + + +class SubResource(msrest.serialization.Model): + """SubResource. + + :param id: Resource Id. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(SubResource, self).__init__(**kwargs) + self.id = id + + +class DiskEncryptionSetParameters(SubResource): + """Describes the parameter of customer managed disk encryption set resource id that can be specified for disk. :code:`
    `:code:`
    ` NOTE: The disk encryption set resource id can only be specified for managed disk. Please refer https://aka.ms/mdssewithcmkoverview for more details. + + :param id: Resource Id. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(DiskEncryptionSetParameters, self).__init__(id=id, **kwargs) + + +class DiskEncryptionSettings(msrest.serialization.Model): + """Describes a Encryption Settings for a Disk. + + :param disk_encryption_key: Specifies the location of the disk encryption key, which is a Key + Vault Secret. + :type disk_encryption_key: ~azure.mgmt.compute.v2020_06_01.models.KeyVaultSecretReference + :param key_encryption_key: Specifies the location of the key encryption key in Key Vault. + :type key_encryption_key: ~azure.mgmt.compute.v2020_06_01.models.KeyVaultKeyReference + :param enabled: Specifies whether disk encryption should be enabled on the virtual machine. + :type enabled: bool + """ + + _attribute_map = { + 'disk_encryption_key': {'key': 'diskEncryptionKey', 'type': 'KeyVaultSecretReference'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyVaultKeyReference'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + disk_encryption_key: Optional["KeyVaultSecretReference"] = None, + key_encryption_key: Optional["KeyVaultKeyReference"] = None, + enabled: Optional[bool] = None, + **kwargs + ): + super(DiskEncryptionSettings, self).__init__(**kwargs) + self.disk_encryption_key = disk_encryption_key + self.key_encryption_key = key_encryption_key + self.enabled = enabled + + +class DiskInstanceView(msrest.serialization.Model): + """The instance view of the disk. + + :param name: The disk name. + :type name: str + :param encryption_settings: Specifies the encryption settings for the OS Disk. + :code:`
    `:code:`
    ` Minimum api-version: 2015-06-15. + :type encryption_settings: list[~azure.mgmt.compute.v2020_06_01.models.DiskEncryptionSettings] + :param statuses: The resource status information. + :type statuses: list[~azure.mgmt.compute.v2020_06_01.models.InstanceViewStatus] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'encryption_settings': {'key': 'encryptionSettings', 'type': '[DiskEncryptionSettings]'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + encryption_settings: Optional[List["DiskEncryptionSettings"]] = None, + statuses: Optional[List["InstanceViewStatus"]] = None, + **kwargs + ): + super(DiskInstanceView, self).__init__(**kwargs) + self.name = name + self.encryption_settings = encryption_settings + self.statuses = statuses + + +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 + `_ + :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", + "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", + "Standard_DS14", "Standard_DS1_v2", "Standard_DS2_v2", "Standard_DS3_v2", "Standard_DS4_v2", + "Standard_DS5_v2", "Standard_DS11_v2", "Standard_DS12_v2", "Standard_DS13_v2", + "Standard_DS14_v2", "Standard_DS15_v2", "Standard_DS13-4_v2", "Standard_DS13-2_v2", + "Standard_DS14-8_v2", "Standard_DS14-4_v2", "Standard_E2_v3", "Standard_E4_v3", + "Standard_E8_v3", "Standard_E16_v3", "Standard_E32_v3", "Standard_E64_v3", "Standard_E2s_v3", + "Standard_E4s_v3", "Standard_E8s_v3", "Standard_E16s_v3", "Standard_E32s_v3", + "Standard_E64s_v3", "Standard_E32-16_v3", "Standard_E32-8s_v3", "Standard_E64-32s_v3", + "Standard_E64-16s_v3", "Standard_F1", "Standard_F2", "Standard_F4", "Standard_F8", + "Standard_F16", "Standard_F1s", "Standard_F2s", "Standard_F4s", "Standard_F8s", + "Standard_F16s", "Standard_F2s_v2", "Standard_F4s_v2", "Standard_F8s_v2", "Standard_F16s_v2", + "Standard_F32s_v2", "Standard_F64s_v2", "Standard_F72s_v2", "Standard_G1", "Standard_G2", + "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", "Standard_GS3", + "Standard_GS4", "Standard_GS5", "Standard_GS4-8", "Standard_GS4-4", "Standard_GS5-16", + "Standard_GS5-8", "Standard_H8", "Standard_H16", "Standard_H8m", "Standard_H16m", + "Standard_H16r", "Standard_H16mr", "Standard_L4s", "Standard_L8s", "Standard_L16s", + "Standard_L32s", "Standard_M64s", "Standard_M64ms", "Standard_M128s", "Standard_M128ms", + "Standard_M64-32ms", "Standard_M64-16ms", "Standard_M128-64ms", "Standard_M128-32ms", + "Standard_NC6", "Standard_NC12", "Standard_NC24", "Standard_NC24r", "Standard_NC6s_v2", + "Standard_NC12s_v2", "Standard_NC24s_v2", "Standard_NC24rs_v2", "Standard_NC6s_v3", + "Standard_NC12s_v3", "Standard_NC24s_v3", "Standard_NC24rs_v3", "Standard_ND6s", + "Standard_ND12s", "Standard_ND24s", "Standard_ND24rs", "Standard_NV6", "Standard_NV12", + "Standard_NV24". + :type vm_size: str or ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineSizeTypes + """ + + _attribute_map = { + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + } + + def __init__( + self, + *, + vm_size: Optional[Union[str, "VirtualMachineSizeTypes"]] = None, + **kwargs + ): + super(HardwareProfile, self).__init__(**kwargs) + self.vm_size = vm_size + + +class Image(Resource): + """The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist. + + 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 source_virtual_machine: The source virtual machine from which Image is created. + :type source_virtual_machine: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param storage_profile: Specifies the storage settings for the virtual machine disks. + :type storage_profile: ~azure.mgmt.compute.v2020_06_01.models.ImageStorageProfile + :ivar provisioning_state: The provisioning state. + :vartype provisioning_state: str + :param hyper_v_generation: Gets the HyperVGenerationType of the VirtualMachine created from the + image. Possible values include: "V1", "V2". + :type hyper_v_generation: str or ~azure.mgmt.compute.v2020_06_01.models.HyperVGenerationTypes + """ + + _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}'}, + 'source_virtual_machine': {'key': 'properties.sourceVirtualMachine', 'type': 'SubResource'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'ImageStorageProfile'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + source_virtual_machine: Optional["SubResource"] = None, + storage_profile: Optional["ImageStorageProfile"] = None, + hyper_v_generation: Optional[Union[str, "HyperVGenerationTypes"]] = None, + **kwargs + ): + super(Image, self).__init__(location=location, tags=tags, **kwargs) + self.source_virtual_machine = source_virtual_machine + self.storage_profile = storage_profile + self.provisioning_state = None + self.hyper_v_generation = hyper_v_generation + + +class ImageDisk(msrest.serialization.Model): + """Describes a image disk. + + :param snapshot: The snapshot. + :type snapshot: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param managed_disk: The managedDisk. + :type managed_disk: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param blob_uri: The Virtual Hard Disk. + :type blob_uri: str + :param caching: Specifies the caching requirements. :code:`
    `:code:`
    ` Possible values + are: :code:`
    `:code:`
    ` **None** :code:`
    `:code:`
    ` **ReadOnly** + :code:`
    `:code:`
    ` **ReadWrite** :code:`
    `:code:`
    ` Default: **None for Standard + storage. ReadOnly for Premium storage**. Possible values include: "None", "ReadOnly", + "ReadWrite". + :type caching: str or ~azure.mgmt.compute.v2020_06_01.models.CachingTypes + :param disk_size_gb: Specifies the size of empty data disks in gigabytes. This element can be + used to overwrite the name of the disk in a virtual machine image. :code:`
    `:code:`
    ` + This value cannot be larger than 1023 GB. + :type disk_size_gb: int + :param storage_account_type: Specifies the storage account type for the managed disk. NOTE: + UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values + include: "Standard_LRS", "Premium_LRS", "StandardSSD_LRS", "UltraSSD_LRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2020_06_01.models.StorageAccountTypes + :param disk_encryption_set: Specifies the customer managed disk encryption set resource id for + the managed image disk. + :type disk_encryption_set: ~azure.mgmt.compute.v2020_06_01.models.SubResource + """ + + _attribute_map = { + 'snapshot': {'key': 'snapshot', 'type': 'SubResource'}, + 'managed_disk': {'key': 'managedDisk', 'type': 'SubResource'}, + 'blob_uri': {'key': 'blobUri', 'type': 'str'}, + 'caching': {'key': 'caching', 'type': 'str'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'disk_encryption_set': {'key': 'diskEncryptionSet', 'type': 'SubResource'}, + } + + def __init__( + self, + *, + snapshot: Optional["SubResource"] = None, + managed_disk: Optional["SubResource"] = None, + blob_uri: Optional[str] = None, + caching: Optional[Union[str, "CachingTypes"]] = None, + disk_size_gb: Optional[int] = None, + storage_account_type: Optional[Union[str, "StorageAccountTypes"]] = None, + disk_encryption_set: Optional["SubResource"] = None, + **kwargs + ): + super(ImageDisk, self).__init__(**kwargs) + self.snapshot = snapshot + self.managed_disk = managed_disk + self.blob_uri = blob_uri + self.caching = caching + self.disk_size_gb = disk_size_gb + self.storage_account_type = storage_account_type + self.disk_encryption_set = disk_encryption_set + + +class ImageDataDisk(ImageDisk): + """Describes a data disk. + + All required parameters must be populated in order to send to Azure. + + :param snapshot: The snapshot. + :type snapshot: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param managed_disk: The managedDisk. + :type managed_disk: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param blob_uri: The Virtual Hard Disk. + :type blob_uri: str + :param caching: Specifies the caching requirements. :code:`
    `:code:`
    ` Possible values + are: :code:`
    `:code:`
    ` **None** :code:`
    `:code:`
    ` **ReadOnly** + :code:`
    `:code:`
    ` **ReadWrite** :code:`
    `:code:`
    ` Default: **None for Standard + storage. ReadOnly for Premium storage**. Possible values include: "None", "ReadOnly", + "ReadWrite". + :type caching: str or ~azure.mgmt.compute.v2020_06_01.models.CachingTypes + :param disk_size_gb: Specifies the size of empty data disks in gigabytes. This element can be + used to overwrite the name of the disk in a virtual machine image. :code:`
    `:code:`
    ` + This value cannot be larger than 1023 GB. + :type disk_size_gb: int + :param storage_account_type: Specifies the storage account type for the managed disk. NOTE: + UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values + include: "Standard_LRS", "Premium_LRS", "StandardSSD_LRS", "UltraSSD_LRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2020_06_01.models.StorageAccountTypes + :param disk_encryption_set: Specifies the customer managed disk encryption set resource id for + the managed image disk. + :type disk_encryption_set: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param lun: Required. Specifies the logical unit number of the data disk. This value is used to + identify data disks within the VM and therefore must be unique for each data disk attached to a + VM. + :type lun: int + """ + + _validation = { + 'lun': {'required': True}, + } + + _attribute_map = { + 'snapshot': {'key': 'snapshot', 'type': 'SubResource'}, + 'managed_disk': {'key': 'managedDisk', 'type': 'SubResource'}, + 'blob_uri': {'key': 'blobUri', 'type': 'str'}, + 'caching': {'key': 'caching', 'type': 'str'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'disk_encryption_set': {'key': 'diskEncryptionSet', 'type': 'SubResource'}, + 'lun': {'key': 'lun', 'type': 'int'}, + } + + def __init__( + self, + *, + lun: int, + snapshot: Optional["SubResource"] = None, + managed_disk: Optional["SubResource"] = None, + blob_uri: Optional[str] = None, + caching: Optional[Union[str, "CachingTypes"]] = None, + disk_size_gb: Optional[int] = None, + storage_account_type: Optional[Union[str, "StorageAccountTypes"]] = None, + disk_encryption_set: Optional["SubResource"] = None, + **kwargs + ): + super(ImageDataDisk, self).__init__(snapshot=snapshot, managed_disk=managed_disk, blob_uri=blob_uri, caching=caching, disk_size_gb=disk_size_gb, storage_account_type=storage_account_type, disk_encryption_set=disk_encryption_set, **kwargs) + self.lun = lun + + +class ImageListResult(msrest.serialization.Model): + """The List Image operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of Images. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.Image] + :param next_link: The uri to fetch the next page of Images. Call ListNext() with this to fetch + the next page of Images. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Image]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["Image"], + next_link: Optional[str] = None, + **kwargs + ): + super(ImageListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ImageOSDisk(ImageDisk): + """Describes an Operating System disk. + + All required parameters must be populated in order to send to Azure. + + :param snapshot: The snapshot. + :type snapshot: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param managed_disk: The managedDisk. + :type managed_disk: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param blob_uri: The Virtual Hard Disk. + :type blob_uri: str + :param caching: Specifies the caching requirements. :code:`
    `:code:`
    ` Possible values + are: :code:`
    `:code:`
    ` **None** :code:`
    `:code:`
    ` **ReadOnly** + :code:`
    `:code:`
    ` **ReadWrite** :code:`
    `:code:`
    ` Default: **None for Standard + storage. ReadOnly for Premium storage**. Possible values include: "None", "ReadOnly", + "ReadWrite". + :type caching: str or ~azure.mgmt.compute.v2020_06_01.models.CachingTypes + :param disk_size_gb: Specifies the size of empty data disks in gigabytes. This element can be + used to overwrite the name of the disk in a virtual machine image. :code:`
    `:code:`
    ` + This value cannot be larger than 1023 GB. + :type disk_size_gb: int + :param storage_account_type: Specifies the storage account type for the managed disk. NOTE: + UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values + include: "Standard_LRS", "Premium_LRS", "StandardSSD_LRS", "UltraSSD_LRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2020_06_01.models.StorageAccountTypes + :param disk_encryption_set: Specifies the customer managed disk encryption set resource id for + the managed image disk. + :type disk_encryption_set: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param os_type: Required. This property allows you to specify the type of the OS that is + included in the disk if creating a VM from a custom 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_06_01.models.OperatingSystemTypes + :param os_state: Required. The OS State. Possible values include: "Generalized", "Specialized". + :type os_state: str or ~azure.mgmt.compute.v2020_06_01.models.OperatingSystemStateTypes + """ + + _validation = { + 'os_type': {'required': True}, + 'os_state': {'required': True}, + } + + _attribute_map = { + 'snapshot': {'key': 'snapshot', 'type': 'SubResource'}, + 'managed_disk': {'key': 'managedDisk', 'type': 'SubResource'}, + 'blob_uri': {'key': 'blobUri', 'type': 'str'}, + 'caching': {'key': 'caching', 'type': 'str'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'disk_encryption_set': {'key': 'diskEncryptionSet', 'type': 'SubResource'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'os_state': {'key': 'osState', 'type': 'str'}, + } + + def __init__( + self, + *, + os_type: Union[str, "OperatingSystemTypes"], + os_state: Union[str, "OperatingSystemStateTypes"], + snapshot: Optional["SubResource"] = None, + managed_disk: Optional["SubResource"] = None, + blob_uri: Optional[str] = None, + caching: Optional[Union[str, "CachingTypes"]] = None, + disk_size_gb: Optional[int] = None, + storage_account_type: Optional[Union[str, "StorageAccountTypes"]] = None, + disk_encryption_set: Optional["SubResource"] = None, + **kwargs + ): + super(ImageOSDisk, self).__init__(snapshot=snapshot, managed_disk=managed_disk, blob_uri=blob_uri, caching=caching, disk_size_gb=disk_size_gb, storage_account_type=storage_account_type, disk_encryption_set=disk_encryption_set, **kwargs) + self.os_type = os_type + self.os_state = os_state + + +class ImageReference(SubResource): + """Specifies information about the image to use. You can specify information about platform images, marketplace images, or virtual machine images. This element is required when you want to use a platform image, marketplace image, or virtual machine image, but is not used in other creation operations. NOTE: Image reference publisher and offer can only be set when you create the scale set. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource Id. + :type id: str + :param publisher: The image publisher. + :type publisher: str + :param offer: Specifies the offer of the platform image or marketplace image used to create the + virtual machine. + :type offer: str + :param sku: The image SKU. + :type sku: str + :param version: Specifies the version of the platform image or marketplace image used to create + the virtual machine. The allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and + Build are decimal numbers. Specify 'latest' to use the latest version of an image available at + deploy time. Even if you use 'latest', the VM image will not automatically update after deploy + time even if a new version becomes available. + :type version: str + :ivar exact_version: Specifies in decimal numbers, the version of platform image or marketplace + image used to create the virtual machine. This readonly field differs from 'version', only if + the value specified in 'version' field is 'latest'. + :vartype exact_version: str + """ + + _validation = { + 'exact_version': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'offer': {'key': 'offer', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'exact_version': {'key': 'exactVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + publisher: Optional[str] = None, + offer: Optional[str] = None, + sku: Optional[str] = None, + version: Optional[str] = None, + **kwargs + ): + super(ImageReference, self).__init__(id=id, **kwargs) + self.publisher = publisher + self.offer = offer + self.sku = sku + self.version = version + self.exact_version = None + + +class ImageStorageProfile(msrest.serialization.Model): + """Describes a storage profile. + + :param os_disk: Specifies information about the operating system disk used by the virtual + machine. :code:`
    `:code:`
    ` For more information about disks, see `About disks and VHDs + for Azure virtual machines `_. + :type os_disk: ~azure.mgmt.compute.v2020_06_01.models.ImageOSDisk + :param data_disks: Specifies the parameters that are used to add a data disk to a virtual + machine. :code:`
    `:code:`
    ` For more information about disks, see `About disks and VHDs + for Azure virtual machines `_. + :type data_disks: list[~azure.mgmt.compute.v2020_06_01.models.ImageDataDisk] + :param zone_resilient: Specifies whether an image is zone resilient or not. Default is false. + Zone resilient images can be created only in regions that provide Zone Redundant Storage (ZRS). + :type zone_resilient: bool + """ + + _attribute_map = { + 'os_disk': {'key': 'osDisk', 'type': 'ImageOSDisk'}, + 'data_disks': {'key': 'dataDisks', 'type': '[ImageDataDisk]'}, + 'zone_resilient': {'key': 'zoneResilient', 'type': 'bool'}, + } + + def __init__( + self, + *, + os_disk: Optional["ImageOSDisk"] = None, + data_disks: Optional[List["ImageDataDisk"]] = None, + zone_resilient: Optional[bool] = None, + **kwargs + ): + super(ImageStorageProfile, self).__init__(**kwargs) + self.os_disk = os_disk + self.data_disks = data_disks + self.zone_resilient = zone_resilient + + +class ImageUpdate(UpdateResource): + """The source user image virtual hard disk. Only tags may be updated. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param source_virtual_machine: The source virtual machine from which Image is created. + :type source_virtual_machine: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param storage_profile: Specifies the storage settings for the virtual machine disks. + :type storage_profile: ~azure.mgmt.compute.v2020_06_01.models.ImageStorageProfile + :ivar provisioning_state: The provisioning state. + :vartype provisioning_state: str + :param hyper_v_generation: Gets the HyperVGenerationType of the VirtualMachine created from the + image. Possible values include: "V1", "V2". + :type hyper_v_generation: str or ~azure.mgmt.compute.v2020_06_01.models.HyperVGenerationTypes + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'source_virtual_machine': {'key': 'properties.sourceVirtualMachine', 'type': 'SubResource'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'ImageStorageProfile'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + source_virtual_machine: Optional["SubResource"] = None, + storage_profile: Optional["ImageStorageProfile"] = None, + hyper_v_generation: Optional[Union[str, "HyperVGenerationTypes"]] = None, + **kwargs + ): + super(ImageUpdate, self).__init__(tags=tags, **kwargs) + self.source_virtual_machine = source_virtual_machine + self.storage_profile = storage_profile + self.provisioning_state = None + self.hyper_v_generation = hyper_v_generation + + +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 InstanceViewStatus(msrest.serialization.Model): + """Instance view status. + + :param code: The status code. + :type code: str + :param level: The level code. Possible values include: "Info", "Warning", "Error". + :type level: str or ~azure.mgmt.compute.v2020_06_01.models.StatusLevelTypes + :param display_status: The short localizable label for the status. + :type display_status: str + :param message: The detailed status message, including for alerts and error messages. + :type message: str + :param time: The time of the status. + :type time: ~datetime.datetime + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'level': {'key': 'level', 'type': 'str'}, + 'display_status': {'key': 'displayStatus', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'time': {'key': 'time', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + level: Optional[Union[str, "StatusLevelTypes"]] = None, + display_status: Optional[str] = None, + message: Optional[str] = None, + time: Optional[datetime.datetime] = None, + **kwargs + ): + super(InstanceViewStatus, self).__init__(**kwargs) + self.code = code + self.level = level + self.display_status = display_status + self.message = message + self.time = time + + +class KeyVaultKeyReference(msrest.serialization.Model): + """Describes a reference to Key Vault Key. + + All required parameters must be populated in order to send to Azure. + + :param key_url: Required. The URL referencing a key encryption key in Key Vault. + :type key_url: str + :param source_vault: Required. The relative URL of the Key Vault containing the key. + :type source_vault: ~azure.mgmt.compute.v2020_06_01.models.SubResource + """ + + _validation = { + 'key_url': {'required': True}, + 'source_vault': {'required': True}, + } + + _attribute_map = { + 'key_url': {'key': 'keyUrl', 'type': 'str'}, + 'source_vault': {'key': 'sourceVault', 'type': 'SubResource'}, + } + + def __init__( + self, + *, + key_url: str, + source_vault: "SubResource", + **kwargs + ): + super(KeyVaultKeyReference, self).__init__(**kwargs) + self.key_url = key_url + self.source_vault = source_vault + + +class KeyVaultSecretReference(msrest.serialization.Model): + """Describes a reference to Key Vault Secret. + + All required parameters must be populated in order to send to Azure. + + :param secret_url: Required. The URL referencing a secret in a Key Vault. + :type secret_url: str + :param source_vault: Required. The relative URL of the Key Vault containing the secret. + :type source_vault: ~azure.mgmt.compute.v2020_06_01.models.SubResource + """ + + _validation = { + 'secret_url': {'required': True}, + 'source_vault': {'required': True}, + } + + _attribute_map = { + 'secret_url': {'key': 'secretUrl', 'type': 'str'}, + 'source_vault': {'key': 'sourceVault', 'type': 'SubResource'}, + } + + def __init__( + self, + *, + secret_url: str, + source_vault: "SubResource", + **kwargs + ): + super(KeyVaultSecretReference, self).__init__(**kwargs) + self.secret_url = secret_url + self.source_vault = source_vault + + +class LastPatchInstallationSummary(msrest.serialization.Model): + """Describes the properties of the last installed patch summary. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status: The overall success or failure status of the operation. It remains "InProgress" + until the operation completes. At that point it will become "Failed", "Succeeded", or + "CompletedWithWarnings.". Possible values include: "InProgress", "Failed", "Succeeded", + "CompletedWithWarnings". + :vartype status: str or ~azure.mgmt.compute.v2020_06_01.models.PatchOperationStatus + :ivar installation_activity_id: The activity ID of the operation that produced this result. It + is used to correlate across CRP and extension logs. + :vartype installation_activity_id: str + :ivar maintenance_window_exceeded: Describes whether the operation ran out of time before it + completed all its intended actions. + :vartype maintenance_window_exceeded: bool + :ivar reboot_status: The reboot status of the machine after the patch operation. It will be in + "NotNeeded" status if reboot is not needed after the patch operation. "Required" will be the + status once the patch is applied and machine is required to reboot. "Started" will be the + reboot status when the machine has started to reboot. "Failed" will be the status if the + machine is failed to reboot. "Completed" will be the status once the machine is rebooted + successfully. Possible values include: "NotNeeded", "Required", "Started", "Failed", + "Completed". + :vartype reboot_status: str or ~azure.mgmt.compute.v2020_06_01.models.RebootStatus + :ivar not_selected_patch_count: The number of all available patches but not going to be + installed because it didn't match a classification or inclusion list entry. + :vartype not_selected_patch_count: int + :ivar excluded_patch_count: The number of all available patches but excluded explicitly by a + customer-specified exclusion list match. + :vartype excluded_patch_count: int + :ivar pending_patch_count: The number of all available patches expected to be installed over + the course of the patch installation operation. + :vartype pending_patch_count: int + :ivar installed_patch_count: The count of patches that successfully installed. + :vartype installed_patch_count: int + :ivar failed_patch_count: The count of patches that failed installation. + :vartype failed_patch_count: int + :ivar start_time: The UTC timestamp when the operation began. + :vartype start_time: ~datetime.datetime + :ivar last_modified_time: The UTC timestamp when the operation began. + :vartype last_modified_time: ~datetime.datetime + :ivar started_by: The person or system account that started the operation. + :vartype started_by: str + :ivar error: The errors that were encountered during execution of the operation. The details + array contains the list of them. + :vartype error: ~azure.mgmt.compute.v2020_06_01.models.ApiError + """ + + _validation = { + 'status': {'readonly': True}, + 'installation_activity_id': {'readonly': True}, + 'maintenance_window_exceeded': {'readonly': True}, + 'reboot_status': {'readonly': True}, + 'not_selected_patch_count': {'readonly': True}, + 'excluded_patch_count': {'readonly': True}, + 'pending_patch_count': {'readonly': True}, + 'installed_patch_count': {'readonly': True}, + 'failed_patch_count': {'readonly': True}, + 'start_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'started_by': {'readonly': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'installation_activity_id': {'key': 'installationActivityId', 'type': 'str'}, + 'maintenance_window_exceeded': {'key': 'maintenanceWindowExceeded', 'type': 'bool'}, + 'reboot_status': {'key': 'rebootStatus', 'type': 'str'}, + 'not_selected_patch_count': {'key': 'notSelectedPatchCount', 'type': 'int'}, + 'excluded_patch_count': {'key': 'excludedPatchCount', 'type': 'int'}, + 'pending_patch_count': {'key': 'pendingPatchCount', 'type': 'int'}, + 'installed_patch_count': {'key': 'installedPatchCount', 'type': 'int'}, + 'failed_patch_count': {'key': 'failedPatchCount', 'type': 'int'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'lastModifiedTime', 'type': 'iso-8601'}, + 'started_by': {'key': 'startedBy', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ApiError'}, + } + + def __init__( + self, + **kwargs + ): + super(LastPatchInstallationSummary, self).__init__(**kwargs) + self.status = None + self.installation_activity_id = None + self.maintenance_window_exceeded = None + self.reboot_status = None + self.not_selected_patch_count = None + self.excluded_patch_count = None + self.pending_patch_count = None + self.installed_patch_count = None + self.failed_patch_count = None + self.start_time = None + self.last_modified_time = None + self.started_by = None + self.error = None + + +class LinuxConfiguration(msrest.serialization.Model): + """Specifies the Linux operating system settings on the virtual machine. :code:`
    `:code:`
    `For a list of supported Linux distributions, see `Linux on Azure-Endorsed Distributions `_ :code:`
    `:code:`
    ` For running non-endorsed distributions, see `Information for Non-Endorsed Distributions `_. + + :param disable_password_authentication: Specifies whether password authentication should be + disabled. + :type disable_password_authentication: bool + :param ssh: Specifies the ssh key configuration for a Linux OS. + :type ssh: ~azure.mgmt.compute.v2020_06_01.models.SshConfiguration + :param provision_vm_agent: Indicates whether virtual machine agent should be provisioned on the + virtual machine. :code:`
    `:code:`
    ` When this property is not specified in the request + body, default behavior is to set it to true. This will ensure that VM Agent is installed on + the VM so that extensions can be added to the VM later. + :type provision_vm_agent: bool + """ + + _attribute_map = { + 'disable_password_authentication': {'key': 'disablePasswordAuthentication', 'type': 'bool'}, + 'ssh': {'key': 'ssh', 'type': 'SshConfiguration'}, + 'provision_vm_agent': {'key': 'provisionVMAgent', 'type': 'bool'}, + } + + def __init__( + self, + *, + disable_password_authentication: Optional[bool] = None, + ssh: Optional["SshConfiguration"] = None, + provision_vm_agent: Optional[bool] = None, + **kwargs + ): + super(LinuxConfiguration, self).__init__(**kwargs) + self.disable_password_authentication = disable_password_authentication + self.ssh = ssh + self.provision_vm_agent = provision_vm_agent + + +class ListUsagesResult(msrest.serialization.Model): + """The List Usages operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of compute resource usages. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.Usage] + :param next_link: The URI to fetch the next page of compute resource usage information. Call + ListNext() with this to fetch the next page of compute resource usage information. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Usage]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["Usage"], + next_link: Optional[str] = None, + **kwargs + ): + super(ListUsagesResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class LogAnalyticsInputBase(msrest.serialization.Model): + """Api input base class for LogAnalytics Api. + + All required parameters must be populated in order to send to Azure. + + :param blob_container_sas_uri: Required. SAS Uri of the logging blob container to which + LogAnalytics Api writes output logs to. + :type blob_container_sas_uri: str + :param from_time: Required. From time of the query. + :type from_time: ~datetime.datetime + :param to_time: Required. To time of the query. + :type to_time: ~datetime.datetime + :param group_by_throttle_policy: Group query result by Throttle Policy applied. + :type group_by_throttle_policy: bool + :param group_by_operation_name: Group query result by Operation Name. + :type group_by_operation_name: bool + :param group_by_resource_name: Group query result by Resource Name. + :type group_by_resource_name: bool + """ + + _validation = { + 'blob_container_sas_uri': {'required': True}, + 'from_time': {'required': True}, + 'to_time': {'required': True}, + } + + _attribute_map = { + 'blob_container_sas_uri': {'key': 'blobContainerSasUri', 'type': 'str'}, + 'from_time': {'key': 'fromTime', 'type': 'iso-8601'}, + 'to_time': {'key': 'toTime', 'type': 'iso-8601'}, + 'group_by_throttle_policy': {'key': 'groupByThrottlePolicy', 'type': 'bool'}, + 'group_by_operation_name': {'key': 'groupByOperationName', 'type': 'bool'}, + 'group_by_resource_name': {'key': 'groupByResourceName', 'type': 'bool'}, + } + + def __init__( + self, + *, + blob_container_sas_uri: str, + from_time: datetime.datetime, + to_time: datetime.datetime, + group_by_throttle_policy: Optional[bool] = None, + group_by_operation_name: Optional[bool] = None, + group_by_resource_name: Optional[bool] = None, + **kwargs + ): + super(LogAnalyticsInputBase, self).__init__(**kwargs) + self.blob_container_sas_uri = blob_container_sas_uri + self.from_time = from_time + self.to_time = to_time + 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 + + +class LogAnalyticsOperationResult(msrest.serialization.Model): + """LogAnalytics operation status response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar properties: LogAnalyticsOutput. + :vartype properties: ~azure.mgmt.compute.v2020_06_01.models.LogAnalyticsOutput + """ + + _validation = { + 'properties': {'readonly': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'LogAnalyticsOutput'}, + } + + def __init__( + self, + **kwargs + ): + super(LogAnalyticsOperationResult, self).__init__(**kwargs) + self.properties = None + + +class LogAnalyticsOutput(msrest.serialization.Model): + """LogAnalytics output properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar output: Output file Uri path to blob container. + :vartype output: str + """ + + _validation = { + 'output': {'readonly': True}, + } + + _attribute_map = { + 'output': {'key': 'output', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LogAnalyticsOutput, self).__init__(**kwargs) + self.output = None + + +class MaintenanceRedeployStatus(msrest.serialization.Model): + """Maintenance Operation Status. + + :param is_customer_initiated_maintenance_allowed: True, if customer is allowed to perform + Maintenance. + :type is_customer_initiated_maintenance_allowed: bool + :param pre_maintenance_window_start_time: Start Time for the Pre Maintenance Window. + :type pre_maintenance_window_start_time: ~datetime.datetime + :param pre_maintenance_window_end_time: End Time for the Pre Maintenance Window. + :type pre_maintenance_window_end_time: ~datetime.datetime + :param maintenance_window_start_time: Start Time for the Maintenance Window. + :type maintenance_window_start_time: ~datetime.datetime + :param maintenance_window_end_time: End Time for the Maintenance Window. + :type maintenance_window_end_time: ~datetime.datetime + :param last_operation_result_code: The Last Maintenance Operation Result Code. Possible values + include: "None", "RetryLater", "MaintenanceAborted", "MaintenanceCompleted". + :type last_operation_result_code: str or + ~azure.mgmt.compute.v2020_06_01.models.MaintenanceOperationResultCodeTypes + :param last_operation_message: Message returned for the last Maintenance Operation. + :type last_operation_message: str + """ + + _attribute_map = { + 'is_customer_initiated_maintenance_allowed': {'key': 'isCustomerInitiatedMaintenanceAllowed', 'type': 'bool'}, + 'pre_maintenance_window_start_time': {'key': 'preMaintenanceWindowStartTime', 'type': 'iso-8601'}, + 'pre_maintenance_window_end_time': {'key': 'preMaintenanceWindowEndTime', 'type': 'iso-8601'}, + 'maintenance_window_start_time': {'key': 'maintenanceWindowStartTime', 'type': 'iso-8601'}, + 'maintenance_window_end_time': {'key': 'maintenanceWindowEndTime', 'type': 'iso-8601'}, + 'last_operation_result_code': {'key': 'lastOperationResultCode', 'type': 'str'}, + 'last_operation_message': {'key': 'lastOperationMessage', 'type': 'str'}, + } + + def __init__( + self, + *, + is_customer_initiated_maintenance_allowed: Optional[bool] = None, + pre_maintenance_window_start_time: Optional[datetime.datetime] = None, + pre_maintenance_window_end_time: Optional[datetime.datetime] = None, + maintenance_window_start_time: Optional[datetime.datetime] = None, + maintenance_window_end_time: Optional[datetime.datetime] = None, + last_operation_result_code: Optional[Union[str, "MaintenanceOperationResultCodeTypes"]] = None, + last_operation_message: Optional[str] = None, + **kwargs + ): + super(MaintenanceRedeployStatus, self).__init__(**kwargs) + self.is_customer_initiated_maintenance_allowed = is_customer_initiated_maintenance_allowed + self.pre_maintenance_window_start_time = pre_maintenance_window_start_time + self.pre_maintenance_window_end_time = pre_maintenance_window_end_time + self.maintenance_window_start_time = maintenance_window_start_time + self.maintenance_window_end_time = maintenance_window_end_time + self.last_operation_result_code = last_operation_result_code + self.last_operation_message = last_operation_message + + +class ManagedDiskParameters(SubResource): + """The parameters of a managed disk. + + :param id: Resource Id. + :type id: str + :param storage_account_type: Specifies the storage account type for the managed disk. NOTE: + UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values + include: "Standard_LRS", "Premium_LRS", "StandardSSD_LRS", "UltraSSD_LRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2020_06_01.models.StorageAccountTypes + :param disk_encryption_set: Specifies the customer managed disk encryption set resource id for + the managed disk. + :type disk_encryption_set: ~azure.mgmt.compute.v2020_06_01.models.SubResource + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'disk_encryption_set': {'key': 'diskEncryptionSet', 'type': 'SubResource'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + storage_account_type: Optional[Union[str, "StorageAccountTypes"]] = None, + disk_encryption_set: Optional["SubResource"] = None, + **kwargs + ): + super(ManagedDiskParameters, self).__init__(id=id, **kwargs) + self.storage_account_type = storage_account_type + self.disk_encryption_set = disk_encryption_set + + +class NetworkInterfaceReference(SubResource): + """Describes a network interface reference. + + :param id: Resource Id. + :type id: str + :param primary: Specifies the primary network interface in case the virtual machine has more + than 1 network interface. + :type primary: bool + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + primary: Optional[bool] = None, + **kwargs + ): + super(NetworkInterfaceReference, self).__init__(id=id, **kwargs) + self.primary = primary + + +class NetworkProfile(msrest.serialization.Model): + """Specifies the network interfaces of the virtual machine. + + :param network_interfaces: Specifies the list of resource Ids for the network interfaces + associated with the virtual machine. + :type network_interfaces: + list[~azure.mgmt.compute.v2020_06_01.models.NetworkInterfaceReference] + """ + + _attribute_map = { + 'network_interfaces': {'key': 'networkInterfaces', 'type': '[NetworkInterfaceReference]'}, + } + + def __init__( + self, + *, + network_interfaces: Optional[List["NetworkInterfaceReference"]] = None, + **kwargs + ): + super(NetworkProfile, self).__init__(**kwargs) + self.network_interfaces = network_interfaces + + +class OrchestrationServiceStateInput(msrest.serialization.Model): + """The input for OrchestrationServiceState. + + All required parameters must be populated in order to send to Azure. + + :param service_name: Required. The name of the service. Possible values include: + "AutomaticRepairs", "DummyOrchestrationServiceName". + :type service_name: str or ~azure.mgmt.compute.v2020_06_01.models.OrchestrationServiceNames + :param action: Required. The action to be performed. Possible values include: "Resume", + "Suspend". + :type action: str or ~azure.mgmt.compute.v2020_06_01.models.OrchestrationServiceStateAction + """ + + _validation = { + 'service_name': {'required': True}, + 'action': {'required': True}, + } + + _attribute_map = { + 'service_name': {'key': 'serviceName', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + } + + def __init__( + self, + *, + service_name: Union[str, "OrchestrationServiceNames"], + action: Union[str, "OrchestrationServiceStateAction"], + **kwargs + ): + super(OrchestrationServiceStateInput, self).__init__(**kwargs) + self.service_name = service_name + self.action = action + + +class OrchestrationServiceSummary(msrest.serialization.Model): + """Summary for an orchestration service of a virtual machine scale set. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar service_name: The name of the service. Possible values include: "AutomaticRepairs", + "DummyOrchestrationServiceName". + :vartype service_name: str or ~azure.mgmt.compute.v2020_06_01.models.OrchestrationServiceNames + :ivar service_state: The current state of the service. Possible values include: "NotRunning", + "Running", "Suspended". + :vartype service_state: str or ~azure.mgmt.compute.v2020_06_01.models.OrchestrationServiceState + """ + + _validation = { + 'service_name': {'readonly': True}, + 'service_state': {'readonly': True}, + } + + _attribute_map = { + 'service_name': {'key': 'serviceName', 'type': 'str'}, + 'service_state': {'key': 'serviceState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OrchestrationServiceSummary, self).__init__(**kwargs) + self.service_name = None + self.service_state = None + + +class OSDisk(msrest.serialization.Model): + """Specifies information about the operating system disk used by the virtual machine. :code:`
    `:code:`
    ` For more information about disks, see `About disks and VHDs for Azure virtual machines `_. + + All required parameters must be populated in order to send to Azure. + + :param os_type: This property allows you to specify the type of the OS that is included in the + disk if creating a VM from user-image or a specialized VHD. :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_06_01.models.OperatingSystemTypes + :param encryption_settings: Specifies the encryption settings for the OS Disk. + :code:`
    `:code:`
    ` Minimum api-version: 2015-06-15. + :type encryption_settings: ~azure.mgmt.compute.v2020_06_01.models.DiskEncryptionSettings + :param name: The disk name. + :type name: str + :param vhd: The virtual hard disk. + :type vhd: ~azure.mgmt.compute.v2020_06_01.models.VirtualHardDisk + :param image: The source user image virtual hard disk. The virtual hard disk will be copied + before being attached to the virtual machine. If SourceImage is provided, the destination + virtual hard drive must not exist. + :type image: ~azure.mgmt.compute.v2020_06_01.models.VirtualHardDisk + :param caching: Specifies the caching requirements. :code:`
    `:code:`
    ` Possible values + are: :code:`
    `:code:`
    ` **None** :code:`
    `:code:`
    ` **ReadOnly** + :code:`
    `:code:`
    ` **ReadWrite** :code:`
    `:code:`
    ` Default: **None** for Standard + storage. **ReadOnly** for Premium storage. Possible values include: "None", "ReadOnly", + "ReadWrite". + :type caching: str or ~azure.mgmt.compute.v2020_06_01.models.CachingTypes + :param write_accelerator_enabled: Specifies whether writeAccelerator should be enabled or + disabled on the disk. + :type write_accelerator_enabled: bool + :param diff_disk_settings: Specifies the ephemeral Disk Settings for the operating system disk + used by the virtual machine. + :type diff_disk_settings: ~azure.mgmt.compute.v2020_06_01.models.DiffDiskSettings + :param create_option: Required. Specifies how the virtual machine should be + created.:code:`
    `:code:`
    ` Possible values are::code:`
    `:code:`
    ` **Attach** \u2013 + This value is used when you are using a specialized disk to create the virtual + machine.:code:`
    `:code:`
    ` **FromImage** \u2013 This value is used when you are using an + image to create the virtual machine. If you are using a platform image, you also use the + imageReference element described above. If you are using a marketplace image, you also use the + plan element previously described. Possible values include: "FromImage", "Empty", "Attach". + :type create_option: str or ~azure.mgmt.compute.v2020_06_01.models.DiskCreateOptionTypes + :param disk_size_gb: Specifies the size of an empty data disk in gigabytes. This element can be + used to overwrite the size of the disk in a virtual machine image. :code:`
    `:code:`
    ` + This value cannot be larger than 1023 GB. + :type disk_size_gb: int + :param managed_disk: The managed disk parameters. + :type managed_disk: ~azure.mgmt.compute.v2020_06_01.models.ManagedDiskParameters + """ + + _validation = { + 'create_option': {'required': True}, + } + + _attribute_map = { + 'os_type': {'key': 'osType', 'type': 'str'}, + 'encryption_settings': {'key': 'encryptionSettings', 'type': 'DiskEncryptionSettings'}, + 'name': {'key': 'name', 'type': 'str'}, + 'vhd': {'key': 'vhd', 'type': 'VirtualHardDisk'}, + 'image': {'key': 'image', 'type': 'VirtualHardDisk'}, + 'caching': {'key': 'caching', 'type': 'str'}, + 'write_accelerator_enabled': {'key': 'writeAcceleratorEnabled', 'type': 'bool'}, + 'diff_disk_settings': {'key': 'diffDiskSettings', 'type': 'DiffDiskSettings'}, + 'create_option': {'key': 'createOption', 'type': 'str'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + 'managed_disk': {'key': 'managedDisk', 'type': 'ManagedDiskParameters'}, + } + + def __init__( + self, + *, + create_option: Union[str, "DiskCreateOptionTypes"], + os_type: Optional[Union[str, "OperatingSystemTypes"]] = None, + encryption_settings: Optional["DiskEncryptionSettings"] = None, + name: Optional[str] = None, + vhd: Optional["VirtualHardDisk"] = None, + image: Optional["VirtualHardDisk"] = None, + caching: Optional[Union[str, "CachingTypes"]] = None, + write_accelerator_enabled: Optional[bool] = None, + diff_disk_settings: Optional["DiffDiskSettings"] = None, + disk_size_gb: Optional[int] = None, + managed_disk: Optional["ManagedDiskParameters"] = None, + **kwargs + ): + super(OSDisk, self).__init__(**kwargs) + self.os_type = os_type + self.encryption_settings = encryption_settings + self.name = name + self.vhd = vhd + self.image = image + self.caching = caching + self.write_accelerator_enabled = write_accelerator_enabled + self.diff_disk_settings = diff_disk_settings + self.create_option = create_option + self.disk_size_gb = disk_size_gb + self.managed_disk = managed_disk + + +class OSDiskImage(msrest.serialization.Model): + """Contains the os disk image information. + + All required parameters must be populated in order to send to Azure. + + :param operating_system: Required. The operating system of the osDiskImage. Possible values + include: "Windows", "Linux". + :type operating_system: str or ~azure.mgmt.compute.v2020_06_01.models.OperatingSystemTypes + """ + + _validation = { + 'operating_system': {'required': True}, + } + + _attribute_map = { + 'operating_system': {'key': 'operatingSystem', 'type': 'str'}, + } + + def __init__( + self, + *, + operating_system: Union[str, "OperatingSystemTypes"], + **kwargs + ): + super(OSDiskImage, self).__init__(**kwargs) + self.operating_system = operating_system + + +class OSProfile(msrest.serialization.Model): + """Specifies the operating system settings for the virtual machine. Some of the settings cannot be changed once VM is provisioned. + + :param computer_name: Specifies the host OS name of the virtual machine. + :code:`
    `:code:`
    ` This name cannot be updated after the VM is created. + :code:`
    `:code:`
    ` **Max-length (Windows):** 15 characters :code:`
    `:code:`
    ` + **Max-length (Linux):** 64 characters. :code:`
    `:code:`
    ` For naming conventions and + restrictions see `Azure infrastructure services implementation guidelines + `_. + :type computer_name: str + :param admin_username: Specifies the name of the administrator account. + :code:`
    `:code:`
    ` This property cannot be updated after the VM is created. + :code:`
    `:code:`
    ` **Windows-only restriction:** Cannot end in "." + :code:`
    `:code:`
    ` **Disallowed values:** "administrator", "admin", "user", "user1", + "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", + "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", + "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". + :code:`
    `:code:`
    ` **Minimum-length (Linux):** 1 character :code:`
    `:code:`
    ` + **Max-length (Linux):** 64 characters :code:`
    `:code:`
    ` **Max-length (Windows):** 20 + characters :code:`
    `:code:`
    `:code:`
  • ` For root access to the Linux VM, see `Using + root privileges on Linux virtual machines in Azure `_\ :code:`
    `:code:`
  • ` For a list of built-in system users on + Linux that should not be used in this field, see `Selecting User Names for Linux on Azure + `_. + :type admin_username: str + :param admin_password: Specifies the password of the administrator account. + :code:`
    `:code:`
    ` **Minimum-length (Windows):** 8 characters :code:`
    `:code:`
    ` + **Minimum-length (Linux):** 6 characters :code:`
    `:code:`
    ` **Max-length (Windows):** 123 + characters :code:`
    `:code:`
    ` **Max-length (Linux):** 72 characters + :code:`
    `:code:`
    ` **Complexity requirements:** 3 out of 4 conditions below need to be + fulfilled :code:`
    ` Has lower characters :code:`
    `Has upper characters :code:`
    ` Has a + digit :code:`
    ` Has a special character (Regex match [\W_]) :code:`
    `:code:`
    ` + **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", + "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" :code:`
    `:code:`
    ` For + resetting the password, see `How to reset the Remote Desktop service or its login password in a + Windows VM `_ :code:`
    `:code:`
    ` For + resetting root password, see `Manage users, SSH, and check or repair disks on Azure Linux VMs + using the VMAccess Extension `_. + :type admin_password: str + :param custom_data: Specifies a base-64 encoded string of custom data. The base-64 encoded + string is decoded to a binary array that is saved as a file on the Virtual Machine. The maximum + length of the binary array is 65535 bytes. :code:`
    `:code:`
    ` **Note: Do not pass any + secrets or passwords in customData property** :code:`
    `:code:`
    ` This property cannot be + updated after the VM is created. :code:`
    `:code:`
    ` customData is passed to the VM to be + saved as a file, for more information see `Custom Data on Azure VMs + `_ + :code:`
    `:code:`
    ` For using cloud-init for your Linux VM, see `Using cloud-init to + customize a Linux VM during creation `_. + :type custom_data: str + :param windows_configuration: Specifies Windows operating system settings on the virtual + machine. + :type windows_configuration: ~azure.mgmt.compute.v2020_06_01.models.WindowsConfiguration + :param linux_configuration: Specifies the Linux operating system settings on the virtual + machine. :code:`
    `:code:`
    `For a list of supported Linux distributions, see `Linux on + Azure-Endorsed Distributions `_ + :code:`
    `:code:`
    ` For running non-endorsed distributions, see `Information for Non- + Endorsed Distributions `_. + :type linux_configuration: ~azure.mgmt.compute.v2020_06_01.models.LinuxConfiguration + :param secrets: Specifies set of certificates that should be installed onto the virtual + machine. + :type secrets: list[~azure.mgmt.compute.v2020_06_01.models.VaultSecretGroup] + :param allow_extension_operations: Specifies whether extension operations should be allowed on + the virtual machine. :code:`
    `:code:`
    `This may only be set to False when no extensions + are present on the virtual machine. + :type allow_extension_operations: bool + :param require_guest_provision_signal: Specifies whether the guest provision signal is required + to infer provision success of the virtual machine. **Note: This property is for private + testing only, and all customers must not set the property to false.**. + :type require_guest_provision_signal: bool + """ + + _attribute_map = { + 'computer_name': {'key': 'computerName', 'type': 'str'}, + 'admin_username': {'key': 'adminUsername', 'type': 'str'}, + 'admin_password': {'key': 'adminPassword', 'type': 'str'}, + 'custom_data': {'key': 'customData', 'type': 'str'}, + 'windows_configuration': {'key': 'windowsConfiguration', 'type': 'WindowsConfiguration'}, + 'linux_configuration': {'key': 'linuxConfiguration', 'type': 'LinuxConfiguration'}, + 'secrets': {'key': 'secrets', 'type': '[VaultSecretGroup]'}, + 'allow_extension_operations': {'key': 'allowExtensionOperations', 'type': 'bool'}, + 'require_guest_provision_signal': {'key': 'requireGuestProvisionSignal', 'type': 'bool'}, + } + + def __init__( + self, + *, + computer_name: Optional[str] = None, + admin_username: Optional[str] = None, + admin_password: Optional[str] = None, + custom_data: Optional[str] = None, + windows_configuration: Optional["WindowsConfiguration"] = None, + linux_configuration: Optional["LinuxConfiguration"] = None, + secrets: Optional[List["VaultSecretGroup"]] = None, + allow_extension_operations: Optional[bool] = None, + require_guest_provision_signal: Optional[bool] = None, + **kwargs + ): + super(OSProfile, self).__init__(**kwargs) + self.computer_name = computer_name + self.admin_username = admin_username + self.admin_password = admin_password + self.custom_data = custom_data + self.windows_configuration = windows_configuration + self.linux_configuration = linux_configuration + self.secrets = secrets + self.allow_extension_operations = allow_extension_operations + self.require_guest_provision_signal = require_guest_provision_signal + + +class PatchSettings(msrest.serialization.Model): + """PatchSettings. + + :param patch_mode: Specifies the mode of in-guest patching to IaaS virtual machine.:code:`
    `:code:`
    ` Possible values are::code:`
    `:code:`
    ` **Manual** - You control + the application of patches to a virtual machine. You do this by applying patches manually + inside the VM. In this mode, automatic updates are disabled; the property + WindowsConfiguration.enableAutomaticUpdates must be false:code:`
    `:code:`
    ` + **AutomaticByOS** - The virtual machine will automatically be updated by the OS. The property + WindowsConfiguration.enableAutomaticUpdates must be true. :code:`
    `:code:`
    ` ** + AutomaticByPlatform** - the virtual machine will automatically updated by the platform. The + properties provisionVMAgent and WindowsConfiguration.enableAutomaticUpdates must be true. + Possible values include: "Manual", "AutomaticByOS", "AutomaticByPlatform". + :type patch_mode: str or ~azure.mgmt.compute.v2020_06_01.models.InGuestPatchMode + """ + + _attribute_map = { + 'patch_mode': {'key': 'patchMode', 'type': 'str'}, + } + + def __init__( + self, + *, + patch_mode: Optional[Union[str, "InGuestPatchMode"]] = None, + **kwargs + ): + super(PatchSettings, self).__init__(**kwargs) + self.patch_mode = patch_mode + + +class Plan(msrest.serialization.Model): + """Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. + + :param name: The plan ID. + :type name: str + :param publisher: The publisher ID. + :type publisher: str + :param product: 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 promotion code. + :type promotion_code: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + publisher: Optional[str] = None, + product: Optional[str] = None, + promotion_code: Optional[str] = None, + **kwargs + ): + super(Plan, self).__init__(**kwargs) + self.name = name + self.publisher = publisher + self.product = product + self.promotion_code = promotion_code + + +class ProximityPlacementGroup(Resource): + """Specifies information about the proximity placement group. + + 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 proximity_placement_group_type: Specifies the type of the proximity placement group. + :code:`
    `:code:`
    ` Possible values are: :code:`
    `:code:`
    ` **Standard** : Co-locate + resources within an Azure region or Availability Zone. :code:`
    `:code:`
    ` **Ultra** : For + future use. Possible values include: "Standard", "Ultra". + :type proximity_placement_group_type: str or + ~azure.mgmt.compute.v2020_06_01.models.ProximityPlacementGroupType + :ivar virtual_machines: A list of references to all virtual machines in the proximity placement + group. + :vartype virtual_machines: + list[~azure.mgmt.compute.v2020_06_01.models.SubResourceWithColocationStatus] + :ivar virtual_machine_scale_sets: A list of references to all virtual machine scale sets in the + proximity placement group. + :vartype virtual_machine_scale_sets: + list[~azure.mgmt.compute.v2020_06_01.models.SubResourceWithColocationStatus] + :ivar availability_sets: A list of references to all availability sets in the proximity + placement group. + :vartype availability_sets: + list[~azure.mgmt.compute.v2020_06_01.models.SubResourceWithColocationStatus] + :param colocation_status: Describes colocation status of the Proximity Placement Group. + :type colocation_status: ~azure.mgmt.compute.v2020_06_01.models.InstanceViewStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'virtual_machines': {'readonly': True}, + 'virtual_machine_scale_sets': {'readonly': True}, + 'availability_sets': {'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}'}, + 'proximity_placement_group_type': {'key': 'properties.proximityPlacementGroupType', 'type': 'str'}, + 'virtual_machines': {'key': 'properties.virtualMachines', 'type': '[SubResourceWithColocationStatus]'}, + 'virtual_machine_scale_sets': {'key': 'properties.virtualMachineScaleSets', 'type': '[SubResourceWithColocationStatus]'}, + 'availability_sets': {'key': 'properties.availabilitySets', 'type': '[SubResourceWithColocationStatus]'}, + 'colocation_status': {'key': 'properties.colocationStatus', 'type': 'InstanceViewStatus'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + proximity_placement_group_type: Optional[Union[str, "ProximityPlacementGroupType"]] = None, + colocation_status: Optional["InstanceViewStatus"] = None, + **kwargs + ): + super(ProximityPlacementGroup, self).__init__(location=location, tags=tags, **kwargs) + self.proximity_placement_group_type = proximity_placement_group_type + self.virtual_machines = None + self.virtual_machine_scale_sets = None + self.availability_sets = None + self.colocation_status = colocation_status + + +class ProximityPlacementGroupListResult(msrest.serialization.Model): + """The List Proximity Placement Group operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of proximity placement groups. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.ProximityPlacementGroup] + :param next_link: The URI to fetch the next page of proximity placement groups. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProximityPlacementGroup]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["ProximityPlacementGroup"], + next_link: Optional[str] = None, + **kwargs + ): + super(ProximityPlacementGroupListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ProximityPlacementGroupUpdate(UpdateResource): + """Specifies information about the proximity placement group. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(ProximityPlacementGroupUpdate, self).__init__(tags=tags, **kwargs) + + +class PurchasePlan(msrest.serialization.Model): + """Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. + + All required parameters must be populated in order to send to Azure. + + :param publisher: Required. The publisher ID. + :type publisher: str + :param name: Required. The plan ID. + :type name: 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 + """ + + _validation = { + 'publisher': {'required': True}, + 'name': {'required': True}, + 'product': {'required': True}, + } + + _attribute_map = { + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + } + + def __init__( + self, + *, + publisher: str, + name: str, + product: str, + **kwargs + ): + super(PurchasePlan, self).__init__(**kwargs) + self.publisher = publisher + self.name = name + self.product = product + + +class RecoveryWalkResponse(msrest.serialization.Model): + """Response after calling a manual recovery walk. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar walk_performed: Whether the recovery walk was performed. + :vartype walk_performed: bool + :ivar next_platform_update_domain: The next update domain that needs to be walked. Null means + walk spanning all update domains has been completed. + :vartype next_platform_update_domain: int + """ + + _validation = { + 'walk_performed': {'readonly': True}, + 'next_platform_update_domain': {'readonly': True}, + } + + _attribute_map = { + 'walk_performed': {'key': 'walkPerformed', 'type': 'bool'}, + 'next_platform_update_domain': {'key': 'nextPlatformUpdateDomain', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(RecoveryWalkResponse, self).__init__(**kwargs) + self.walk_performed = None + self.next_platform_update_domain = None + + +class RequestRateByIntervalInput(LogAnalyticsInputBase): + """Api request input for LogAnalytics getRequestRateByInterval Api. + + All required parameters must be populated in order to send to Azure. + + :param blob_container_sas_uri: Required. SAS Uri of the logging blob container to which + LogAnalytics Api writes output logs to. + :type blob_container_sas_uri: str + :param from_time: Required. From time of the query. + :type from_time: ~datetime.datetime + :param to_time: Required. To time of the query. + :type to_time: ~datetime.datetime + :param group_by_throttle_policy: Group query result by Throttle Policy applied. + :type group_by_throttle_policy: bool + :param group_by_operation_name: Group query result by Operation Name. + :type group_by_operation_name: bool + :param group_by_resource_name: Group query result by Resource Name. + :type group_by_resource_name: 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 + """ + + _validation = { + 'blob_container_sas_uri': {'required': True}, + 'from_time': {'required': True}, + 'to_time': {'required': True}, + 'interval_length': {'required': True}, + } + + _attribute_map = { + 'blob_container_sas_uri': {'key': 'blobContainerSasUri', 'type': 'str'}, + 'from_time': {'key': 'fromTime', 'type': 'iso-8601'}, + 'to_time': {'key': 'toTime', 'type': 'iso-8601'}, + 'group_by_throttle_policy': {'key': 'groupByThrottlePolicy', 'type': 'bool'}, + 'group_by_operation_name': {'key': 'groupByOperationName', 'type': 'bool'}, + 'group_by_resource_name': {'key': 'groupByResourceName', 'type': 'bool'}, + 'interval_length': {'key': 'intervalLength', 'type': 'str'}, + } + + def __init__( + self, + *, + blob_container_sas_uri: str, + from_time: datetime.datetime, + to_time: datetime.datetime, + interval_length: Union[str, "IntervalInMins"], + group_by_throttle_policy: Optional[bool] = None, + group_by_operation_name: Optional[bool] = None, + group_by_resource_name: 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) + self.interval_length = interval_length + + +class RetrieveBootDiagnosticsDataResult(msrest.serialization.Model): + """The SAS URIs of the console screenshot and serial log blobs. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar console_screenshot_blob_uri: The console screenshot blob URI. + :vartype console_screenshot_blob_uri: str + :ivar serial_console_log_blob_uri: The serial console log blob URI. + :vartype serial_console_log_blob_uri: str + """ + + _validation = { + 'console_screenshot_blob_uri': {'readonly': True}, + 'serial_console_log_blob_uri': {'readonly': True}, + } + + _attribute_map = { + 'console_screenshot_blob_uri': {'key': 'consoleScreenshotBlobUri', 'type': 'str'}, + 'serial_console_log_blob_uri': {'key': 'serialConsoleLogBlobUri', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RetrieveBootDiagnosticsDataResult, self).__init__(**kwargs) + self.console_screenshot_blob_uri = None + self.serial_console_log_blob_uri = None + + +class RollbackStatusInfo(msrest.serialization.Model): + """Information about rollback on failed VM instances after a OS Upgrade operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar successfully_rolledback_instance_count: The number of instances which have been + successfully rolled back. + :vartype successfully_rolledback_instance_count: int + :ivar failed_rolledback_instance_count: The number of instances which failed to rollback. + :vartype failed_rolledback_instance_count: int + :ivar rollback_error: Error details if OS rollback failed. + :vartype rollback_error: ~azure.mgmt.compute.v2020_06_01.models.ApiError + """ + + _validation = { + 'successfully_rolledback_instance_count': {'readonly': True}, + 'failed_rolledback_instance_count': {'readonly': True}, + 'rollback_error': {'readonly': True}, + } + + _attribute_map = { + 'successfully_rolledback_instance_count': {'key': 'successfullyRolledbackInstanceCount', 'type': 'int'}, + 'failed_rolledback_instance_count': {'key': 'failedRolledbackInstanceCount', 'type': 'int'}, + 'rollback_error': {'key': 'rollbackError', 'type': 'ApiError'}, + } + + def __init__( + self, + **kwargs + ): + super(RollbackStatusInfo, self).__init__(**kwargs) + self.successfully_rolledback_instance_count = None + self.failed_rolledback_instance_count = None + self.rollback_error = None + + +class RollingUpgradePolicy(msrest.serialization.Model): + """The configuration parameters used while performing a rolling upgrade. + + :param max_batch_instance_percent: The maximum percent of total virtual machine instances that + will be upgraded simultaneously by the rolling upgrade in one batch. As this is a maximum, + unhealthy instances in previous or future batches can cause the percentage of instances in a + batch to decrease to ensure higher reliability. The default value for this parameter is 20%. + :type max_batch_instance_percent: int + :param max_unhealthy_instance_percent: The maximum percentage of the total virtual machine + instances in the scale set that can be simultaneously unhealthy, either as a result of being + upgraded, or by being found in an unhealthy state by the virtual machine health checks before + the rolling upgrade aborts. This constraint will be checked prior to starting any batch. The + default value for this parameter is 20%. + :type max_unhealthy_instance_percent: int + :param max_unhealthy_upgraded_instance_percent: The maximum percentage of upgraded virtual + machine instances that can be found to be in an unhealthy state. This check will happen after + each batch is upgraded. If this percentage is ever exceeded, the rolling update aborts. The + default value for this parameter is 20%. + :type max_unhealthy_upgraded_instance_percent: int + :param pause_time_between_batches: The wait time between completing the update for all virtual + machines in one batch and starting the next batch. The time duration should be specified in ISO + 8601 format. The default value is 0 seconds (PT0S). + :type pause_time_between_batches: str + """ + + _validation = { + 'max_batch_instance_percent': {'maximum': 100, 'minimum': 5}, + 'max_unhealthy_instance_percent': {'maximum': 100, 'minimum': 5}, + 'max_unhealthy_upgraded_instance_percent': {'maximum': 100, 'minimum': 0}, + } + + _attribute_map = { + 'max_batch_instance_percent': {'key': 'maxBatchInstancePercent', 'type': 'int'}, + 'max_unhealthy_instance_percent': {'key': 'maxUnhealthyInstancePercent', 'type': 'int'}, + 'max_unhealthy_upgraded_instance_percent': {'key': 'maxUnhealthyUpgradedInstancePercent', 'type': 'int'}, + 'pause_time_between_batches': {'key': 'pauseTimeBetweenBatches', 'type': 'str'}, + } + + def __init__( + self, + *, + max_batch_instance_percent: Optional[int] = None, + max_unhealthy_instance_percent: Optional[int] = None, + max_unhealthy_upgraded_instance_percent: Optional[int] = None, + pause_time_between_batches: Optional[str] = None, + **kwargs + ): + super(RollingUpgradePolicy, self).__init__(**kwargs) + self.max_batch_instance_percent = max_batch_instance_percent + self.max_unhealthy_instance_percent = max_unhealthy_instance_percent + self.max_unhealthy_upgraded_instance_percent = max_unhealthy_upgraded_instance_percent + self.pause_time_between_batches = pause_time_between_batches + + +class RollingUpgradeProgressInfo(msrest.serialization.Model): + """Information about the number of virtual machine instances in each upgrade state. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar successful_instance_count: The number of instances that have been successfully upgraded. + :vartype successful_instance_count: int + :ivar failed_instance_count: The number of instances that have failed to be upgraded + successfully. + :vartype failed_instance_count: int + :ivar in_progress_instance_count: The number of instances that are currently being upgraded. + :vartype in_progress_instance_count: int + :ivar pending_instance_count: The number of instances that have not yet begun to be upgraded. + :vartype pending_instance_count: int + """ + + _validation = { + 'successful_instance_count': {'readonly': True}, + 'failed_instance_count': {'readonly': True}, + 'in_progress_instance_count': {'readonly': True}, + 'pending_instance_count': {'readonly': True}, + } + + _attribute_map = { + 'successful_instance_count': {'key': 'successfulInstanceCount', 'type': 'int'}, + 'failed_instance_count': {'key': 'failedInstanceCount', 'type': 'int'}, + 'in_progress_instance_count': {'key': 'inProgressInstanceCount', 'type': 'int'}, + 'pending_instance_count': {'key': 'pendingInstanceCount', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(RollingUpgradeProgressInfo, self).__init__(**kwargs) + self.successful_instance_count = None + self.failed_instance_count = None + self.in_progress_instance_count = None + self.pending_instance_count = None + + +class RollingUpgradeRunningStatus(msrest.serialization.Model): + """Information about the current running state of the overall upgrade. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Code indicating the current status of the upgrade. Possible values include: + "RollingForward", "Cancelled", "Completed", "Faulted". + :vartype code: str or ~azure.mgmt.compute.v2020_06_01.models.RollingUpgradeStatusCode + :ivar start_time: Start time of the upgrade. + :vartype start_time: ~datetime.datetime + :ivar last_action: The last action performed on the rolling upgrade. Possible values include: + "Start", "Cancel". + :vartype last_action: str or ~azure.mgmt.compute.v2020_06_01.models.RollingUpgradeActionType + :ivar last_action_time: Last action time of the upgrade. + :vartype last_action_time: ~datetime.datetime + """ + + _validation = { + 'code': {'readonly': True}, + 'start_time': {'readonly': True}, + 'last_action': {'readonly': True}, + 'last_action_time': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'last_action': {'key': 'lastAction', 'type': 'str'}, + 'last_action_time': {'key': 'lastActionTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(RollingUpgradeRunningStatus, self).__init__(**kwargs) + self.code = None + self.start_time = None + self.last_action = None + self.last_action_time = None + + +class RollingUpgradeStatusInfo(Resource): + """The status of the latest virtual machine scale set rolling upgrade. + + 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 policy: The rolling upgrade policies applied for this upgrade. + :vartype policy: ~azure.mgmt.compute.v2020_06_01.models.RollingUpgradePolicy + :ivar running_status: Information about the current running state of the overall upgrade. + :vartype running_status: ~azure.mgmt.compute.v2020_06_01.models.RollingUpgradeRunningStatus + :ivar progress: Information about the number of virtual machine instances in each upgrade + state. + :vartype progress: ~azure.mgmt.compute.v2020_06_01.models.RollingUpgradeProgressInfo + :ivar error: Error details for this upgrade, if there are any. + :vartype error: ~azure.mgmt.compute.v2020_06_01.models.ApiError + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'policy': {'readonly': True}, + 'running_status': {'readonly': True}, + 'progress': {'readonly': True}, + 'error': {'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}'}, + 'policy': {'key': 'properties.policy', 'type': 'RollingUpgradePolicy'}, + 'running_status': {'key': 'properties.runningStatus', 'type': 'RollingUpgradeRunningStatus'}, + 'progress': {'key': 'properties.progress', 'type': 'RollingUpgradeProgressInfo'}, + 'error': {'key': 'properties.error', 'type': 'ApiError'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(RollingUpgradeStatusInfo, self).__init__(location=location, tags=tags, **kwargs) + self.policy = None + self.running_status = None + self.progress = None + self.error = None + + +class RunCommandDocumentBase(msrest.serialization.Model): + """Describes the properties of a Run Command metadata. + + All required parameters must be populated in order to send to Azure. + + :param schema: Required. The VM run command schema. + :type schema: str + :param id: Required. The VM run command id. + :type id: str + :param os_type: Required. The Operating System type. Possible values include: "Windows", + "Linux". + :type os_type: str or ~azure.mgmt.compute.v2020_06_01.models.OperatingSystemTypes + :param label: Required. The VM run command label. + :type label: str + :param description: Required. The VM run command description. + :type description: str + """ + + _validation = { + 'schema': {'required': True}, + 'id': {'required': True}, + 'os_type': {'required': True}, + 'label': {'required': True}, + 'description': {'required': True}, + } + + _attribute_map = { + 'schema': {'key': '$schema', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'label': {'key': 'label', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + schema: str, + id: str, + os_type: Union[str, "OperatingSystemTypes"], + label: str, + description: str, + **kwargs + ): + super(RunCommandDocumentBase, self).__init__(**kwargs) + self.schema = schema + self.id = id + self.os_type = os_type + self.label = label + self.description = description + + +class RunCommandDocument(RunCommandDocumentBase): + """Describes the properties of a Run Command. + + All required parameters must be populated in order to send to Azure. + + :param schema: Required. The VM run command schema. + :type schema: str + :param id: Required. The VM run command id. + :type id: str + :param os_type: Required. The Operating System type. Possible values include: "Windows", + "Linux". + :type os_type: str or ~azure.mgmt.compute.v2020_06_01.models.OperatingSystemTypes + :param label: Required. The VM run command label. + :type label: str + :param description: Required. The VM run command description. + :type description: str + :param script: Required. The script to be executed. + :type script: list[str] + :param parameters: The parameters used by the script. + :type parameters: list[~azure.mgmt.compute.v2020_06_01.models.RunCommandParameterDefinition] + """ + + _validation = { + 'schema': {'required': True}, + 'id': {'required': True}, + 'os_type': {'required': True}, + 'label': {'required': True}, + 'description': {'required': True}, + 'script': {'required': True}, + } + + _attribute_map = { + 'schema': {'key': '$schema', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'label': {'key': 'label', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'script': {'key': 'script', 'type': '[str]'}, + 'parameters': {'key': 'parameters', 'type': '[RunCommandParameterDefinition]'}, + } + + def __init__( + self, + *, + schema: str, + id: str, + os_type: Union[str, "OperatingSystemTypes"], + label: str, + description: str, + script: List[str], + parameters: Optional[List["RunCommandParameterDefinition"]] = None, + **kwargs + ): + super(RunCommandDocument, self).__init__(schema=schema, id=id, os_type=os_type, label=label, description=description, **kwargs) + self.script = script + self.parameters = parameters + + +class RunCommandInput(msrest.serialization.Model): + """Capture Virtual Machine parameters. + + All required parameters must be populated in order to send to Azure. + + :param command_id: Required. The run command id. + :type command_id: str + :param script: Optional. The script to be executed. When this value is given, the given script + will override the default script of the command. + :type script: list[str] + :param parameters: The run command parameters. + :type parameters: list[~azure.mgmt.compute.v2020_06_01.models.RunCommandInputParameter] + """ + + _validation = { + 'command_id': {'required': True}, + } + + _attribute_map = { + 'command_id': {'key': 'commandId', 'type': 'str'}, + 'script': {'key': 'script', 'type': '[str]'}, + 'parameters': {'key': 'parameters', 'type': '[RunCommandInputParameter]'}, + } + + def __init__( + self, + *, + command_id: str, + script: Optional[List[str]] = None, + parameters: Optional[List["RunCommandInputParameter"]] = None, + **kwargs + ): + super(RunCommandInput, self).__init__(**kwargs) + self.command_id = command_id + self.script = script + self.parameters = parameters + + +class RunCommandInputParameter(msrest.serialization.Model): + """Describes the properties of a run command parameter. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The run command parameter name. + :type name: str + :param value: Required. The run command parameter value. + :type value: str + """ + + _validation = { + 'name': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + value: str, + **kwargs + ): + super(RunCommandInputParameter, self).__init__(**kwargs) + self.name = name + self.value = value + + +class RunCommandListResult(msrest.serialization.Model): + """The List Virtual Machine operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of virtual machine run commands. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.RunCommandDocumentBase] + :param next_link: The uri to fetch the next page of run commands. Call ListNext() with this to + fetch the next page of run commands. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[RunCommandDocumentBase]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["RunCommandDocumentBase"], + next_link: Optional[str] = None, + **kwargs + ): + super(RunCommandListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class RunCommandParameterDefinition(msrest.serialization.Model): + """Describes the properties of a run command parameter. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The run command parameter name. + :type name: str + :param type: Required. The run command parameter type. + :type type: str + :param default_value: The run command parameter default value. + :type default_value: str + :param required: The run command parameter required. + :type required: bool + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'default_value': {'key': 'defaultValue', 'type': 'str'}, + 'required': {'key': 'required', 'type': 'bool'}, + } + + def __init__( + self, + *, + name: str, + type: str, + default_value: Optional[str] = None, + required: Optional[bool] = False, + **kwargs + ): + super(RunCommandParameterDefinition, self).__init__(**kwargs) + self.name = name + self.type = type + self.default_value = default_value + self.required = required + + +class RunCommandResult(msrest.serialization.Model): + """RunCommandResult. + + :param value: Run command operation response. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.InstanceViewStatus] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[InstanceViewStatus]'}, + } + + def __init__( + self, + *, + value: Optional[List["InstanceViewStatus"]] = None, + **kwargs + ): + super(RunCommandResult, self).__init__(**kwargs) + self.value = value + + +class ScaleInPolicy(msrest.serialization.Model): + """Describes a scale-in policy for a virtual machine scale set. + + :param rules: The rules to be followed when scaling-in a virtual machine scale set. + :code:`
    `:code:`
    ` Possible values are: :code:`
    `:code:`
    ` **Default** When a + virtual machine scale set is scaled in, the scale set will first be balanced across zones if it + is a zonal scale set. Then, it will be balanced across Fault Domains as far as possible. Within + each Fault Domain, the virtual machines chosen for removal will be the newest ones that are not + protected from scale-in. :code:`
    `:code:`
    ` **OldestVM** When a virtual machine scale set + is being scaled-in, the oldest virtual machines that are not protected from scale-in will be + chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced + across zones. Within each zone, the oldest virtual machines that are not protected will be + chosen for removal. :code:`
    `:code:`
    ` **NewestVM** When a virtual machine scale set is + being scaled-in, the newest virtual machines that are not protected from scale-in will be + chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced + across zones. Within each zone, the newest virtual machines that are not protected will be + chosen for removal. :code:`
    `:code:`
    `. + :type rules: list[str or + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetScaleInRules] + """ + + _attribute_map = { + 'rules': {'key': 'rules', 'type': '[str]'}, + } + + def __init__( + self, + *, + rules: Optional[List[Union[str, "VirtualMachineScaleSetScaleInRules"]]] = None, + **kwargs + ): + super(ScaleInPolicy, self).__init__(**kwargs) + self.rules = rules + + +class ScheduledEventsProfile(msrest.serialization.Model): + """ScheduledEventsProfile. + + :param terminate_notification_profile: Specifies Terminate Scheduled Event related + configurations. + :type terminate_notification_profile: + ~azure.mgmt.compute.v2020_06_01.models.TerminateNotificationProfile + """ + + _attribute_map = { + 'terminate_notification_profile': {'key': 'terminateNotificationProfile', 'type': 'TerminateNotificationProfile'}, + } + + def __init__( + self, + *, + terminate_notification_profile: Optional["TerminateNotificationProfile"] = None, + **kwargs + ): + super(ScheduledEventsProfile, self).__init__(**kwargs) + self.terminate_notification_profile = terminate_notification_profile + + +class SecurityProfile(msrest.serialization.Model): + """Specifies the Security profile settings for the virtual machine or virtual machine scale set. + + :param encryption_at_host: This property can be used by user in the request to enable or + disable the Host Encryption for the virtual machine or virtual machine scale set. This will + enable the encryption for all the disks including Resource/Temp disk at host itself. + :code:`
    `:code:`
    ` Default: The Encryption at host will be disabled unless this property + is set to true for the resource. + :type encryption_at_host: bool + """ + + _attribute_map = { + 'encryption_at_host': {'key': 'encryptionAtHost', 'type': 'bool'}, + } + + def __init__( + self, + *, + encryption_at_host: Optional[bool] = None, + **kwargs + ): + super(SecurityProfile, self).__init__(**kwargs) + self.encryption_at_host = encryption_at_host + + +class Sku(msrest.serialization.Model): + """Describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware the scale set is currently on, you need to deallocate the VMs in the scale set before you modify the SKU name. + + :param name: The sku name. + :type name: str + :param tier: Specifies the tier of virtual machines in a scale set.:code:`
    `:code:`
    ` + Possible Values::code:`
    `:code:`
    ` **Standard**\ :code:`
    `:code:`
    ` + **Basic**. + :type tier: str + :param capacity: Specifies the number of virtual machines in the scale set. + :type capacity: long + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'long'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + tier: Optional[str] = None, + capacity: Optional[int] = None, + **kwargs + ): + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.capacity = capacity + + +class SshConfiguration(msrest.serialization.Model): + """SSH configuration for Linux based VMs running on Azure. + + :param public_keys: The list of SSH public keys used to authenticate with linux based VMs. + :type public_keys: list[~azure.mgmt.compute.v2020_06_01.models.SshPublicKey] + """ + + _attribute_map = { + 'public_keys': {'key': 'publicKeys', 'type': '[SshPublicKey]'}, + } + + def __init__( + self, + *, + public_keys: Optional[List["SshPublicKey"]] = None, + **kwargs + ): + super(SshConfiguration, self).__init__(**kwargs) + self.public_keys = public_keys + + +class SshPublicKey(msrest.serialization.Model): + """Contains information about SSH certificate public key and the path on the Linux VM where the public key is placed. + + :param path: Specifies the full path on the created VM where ssh public key is stored. If the + file already exists, the specified key is appended to the file. Example: + /home/user/.ssh/authorized_keys. + :type path: str + :param key_data: SSH public key certificate used to authenticate with the VM through ssh. The + key needs to be at least 2048-bit and in ssh-rsa format. :code:`
    `:code:`
    ` For creating + ssh keys, see `Create SSH keys on Linux and Mac for Linux VMs in Azure + `_. + :type key_data: str + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'key_data': {'key': 'keyData', 'type': 'str'}, + } + + def __init__( + self, + *, + path: Optional[str] = None, + key_data: Optional[str] = None, + **kwargs + ): + super(SshPublicKey, self).__init__(**kwargs) + self.path = path + self.key_data = key_data + + +class SshPublicKeyGenerateKeyPairResult(msrest.serialization.Model): + """Response from generation of an SSH key pair. + + All required parameters must be populated in order to send to Azure. + + :param private_key: Required. Private key portion of the key pair used to authenticate to a + virtual machine through ssh. The private key is returned in RFC3447 format and should be + treated as a secret. + :type private_key: str + :param public_key: Required. Public key portion of the key pair used to authenticate to a + virtual machine through ssh. The public key is in ssh-rsa format. + :type public_key: str + :param id: Required. The ARM resource id in the form of + /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{SshPublicKeyName}. + :type id: str + """ + + _validation = { + 'private_key': {'required': True}, + 'public_key': {'required': True}, + 'id': {'required': True}, + } + + _attribute_map = { + 'private_key': {'key': 'privateKey', 'type': 'str'}, + 'public_key': {'key': 'publicKey', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + private_key: str, + public_key: str, + id: str, + **kwargs + ): + super(SshPublicKeyGenerateKeyPairResult, self).__init__(**kwargs) + self.private_key = private_key + self.public_key = public_key + self.id = id + + +class SshPublicKeyResource(Resource): + """Specifies information about the SSH public 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. + + :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 public_key: SSH public key used to authenticate to a virtual machine through ssh. If + this property is not initially provided when the resource is created, the publicKey property + will be populated when generateKeyPair is called. If the public key is provided upon resource + creation, the provided public key needs to be at least 2048-bit and in ssh-rsa format. + :type public_key: str + """ + + _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}'}, + 'public_key': {'key': 'properties.publicKey', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + public_key: Optional[str] = None, + **kwargs + ): + super(SshPublicKeyResource, self).__init__(location=location, tags=tags, **kwargs) + self.public_key = public_key + + +class SshPublicKeysGroupListResult(msrest.serialization.Model): + """The list SSH public keys operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of SSH public keys. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.SshPublicKeyResource] + :param next_link: The URI to fetch the next page of SSH public keys. Call ListNext() with this + URI to fetch the next page of SSH public keys. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SshPublicKeyResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["SshPublicKeyResource"], + next_link: Optional[str] = None, + **kwargs + ): + super(SshPublicKeysGroupListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class SshPublicKeyUpdateResource(UpdateResource): + """Specifies information about the SSH public key. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param public_key: SSH public key used to authenticate to a virtual machine through ssh. If + this property is not initially provided when the resource is created, the publicKey property + will be populated when generateKeyPair is called. If the public key is provided upon resource + creation, the provided public key needs to be at least 2048-bit and in ssh-rsa format. + :type public_key: str + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'public_key': {'key': 'properties.publicKey', 'type': 'str'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + public_key: Optional[str] = None, + **kwargs + ): + super(SshPublicKeyUpdateResource, self).__init__(tags=tags, **kwargs) + self.public_key = public_key + + +class StorageProfile(msrest.serialization.Model): + """Specifies the storage settings for the virtual machine disks. + + :param image_reference: Specifies information about the image to use. You can specify + information about platform images, marketplace images, or virtual machine images. This element + is required when you want to use a platform image, marketplace image, or virtual machine image, + but is not used in other creation operations. + :type image_reference: ~azure.mgmt.compute.v2020_06_01.models.ImageReference + :param os_disk: Specifies information about the operating system disk used by the virtual + machine. :code:`
    `:code:`
    ` For more information about disks, see `About disks and VHDs + for Azure virtual machines `_. + :type os_disk: ~azure.mgmt.compute.v2020_06_01.models.OSDisk + :param data_disks: Specifies the parameters that are used to add a data disk to a virtual + machine. :code:`
    `:code:`
    ` For more information about disks, see `About disks and VHDs + for Azure virtual machines `_. + :type data_disks: list[~azure.mgmt.compute.v2020_06_01.models.DataDisk] + """ + + _attribute_map = { + 'image_reference': {'key': 'imageReference', 'type': 'ImageReference'}, + 'os_disk': {'key': 'osDisk', 'type': 'OSDisk'}, + 'data_disks': {'key': 'dataDisks', 'type': '[DataDisk]'}, + } + + def __init__( + self, + *, + image_reference: Optional["ImageReference"] = None, + os_disk: Optional["OSDisk"] = None, + data_disks: Optional[List["DataDisk"]] = None, + **kwargs + ): + super(StorageProfile, self).__init__(**kwargs) + self.image_reference = image_reference + self.os_disk = os_disk + self.data_disks = data_disks + + +class SubResourceReadOnly(msrest.serialization.Model): + """SubResourceReadOnly. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SubResourceReadOnly, self).__init__(**kwargs) + self.id = None + + +class SubResourceWithColocationStatus(SubResource): + """SubResourceWithColocationStatus. + + :param id: Resource Id. + :type id: str + :param colocation_status: Describes colocation status of a resource in the Proximity Placement + Group. + :type colocation_status: ~azure.mgmt.compute.v2020_06_01.models.InstanceViewStatus + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'colocation_status': {'key': 'colocationStatus', 'type': 'InstanceViewStatus'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + colocation_status: Optional["InstanceViewStatus"] = None, + **kwargs + ): + super(SubResourceWithColocationStatus, self).__init__(id=id, **kwargs) + self.colocation_status = colocation_status + + +class TerminateNotificationProfile(msrest.serialization.Model): + """TerminateNotificationProfile. + + :param not_before_timeout: Configurable length of time a Virtual Machine being deleted will + have to potentially approve the Terminate Scheduled Event before the event is auto approved + (timed out). The configuration must be specified in ISO 8601 format, the default value is 5 + minutes (PT5M). + :type not_before_timeout: str + :param enable: Specifies whether the Terminate Scheduled event is enabled or disabled. + :type enable: bool + """ + + _attribute_map = { + 'not_before_timeout': {'key': 'notBeforeTimeout', 'type': 'str'}, + 'enable': {'key': 'enable', 'type': 'bool'}, + } + + def __init__( + self, + *, + not_before_timeout: Optional[str] = None, + enable: Optional[bool] = None, + **kwargs + ): + super(TerminateNotificationProfile, self).__init__(**kwargs) + self.not_before_timeout = not_before_timeout + self.enable = enable + + +class ThrottledRequestsInput(LogAnalyticsInputBase): + """Api request input for LogAnalytics getThrottledRequests Api. + + All required parameters must be populated in order to send to Azure. + + :param blob_container_sas_uri: Required. SAS Uri of the logging blob container to which + LogAnalytics Api writes output logs to. + :type blob_container_sas_uri: str + :param from_time: Required. From time of the query. + :type from_time: ~datetime.datetime + :param to_time: Required. To time of the query. + :type to_time: ~datetime.datetime + :param group_by_throttle_policy: Group query result by Throttle Policy applied. + :type group_by_throttle_policy: bool + :param group_by_operation_name: Group query result by Operation Name. + :type group_by_operation_name: bool + :param group_by_resource_name: Group query result by Resource Name. + :type group_by_resource_name: bool + """ + + _validation = { + 'blob_container_sas_uri': {'required': True}, + 'from_time': {'required': True}, + 'to_time': {'required': True}, + } + + _attribute_map = { + 'blob_container_sas_uri': {'key': 'blobContainerSasUri', 'type': 'str'}, + 'from_time': {'key': 'fromTime', 'type': 'iso-8601'}, + 'to_time': {'key': 'toTime', 'type': 'iso-8601'}, + 'group_by_throttle_policy': {'key': 'groupByThrottlePolicy', 'type': 'bool'}, + 'group_by_operation_name': {'key': 'groupByOperationName', 'type': 'bool'}, + 'group_by_resource_name': {'key': 'groupByResourceName', 'type': 'bool'}, + } + + def __init__( + self, + *, + blob_container_sas_uri: str, + from_time: datetime.datetime, + to_time: datetime.datetime, + group_by_throttle_policy: Optional[bool] = None, + group_by_operation_name: Optional[bool] = None, + group_by_resource_name: 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) + + +class UpgradeOperationHistoricalStatusInfo(msrest.serialization.Model): + """Virtual Machine Scale Set OS Upgrade History operation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar properties: Information about the properties of the upgrade operation. + :vartype properties: + ~azure.mgmt.compute.v2020_06_01.models.UpgradeOperationHistoricalStatusInfoProperties + :ivar type: Resource type. + :vartype type: str + :ivar location: Resource location. + :vartype location: str + """ + + _validation = { + 'properties': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'UpgradeOperationHistoricalStatusInfoProperties'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UpgradeOperationHistoricalStatusInfo, self).__init__(**kwargs) + self.properties = None + self.type = None + self.location = None + + +class UpgradeOperationHistoricalStatusInfoProperties(msrest.serialization.Model): + """Describes each OS upgrade on the Virtual Machine Scale Set. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar running_status: Information about the overall status of the upgrade operation. + :vartype running_status: ~azure.mgmt.compute.v2020_06_01.models.UpgradeOperationHistoryStatus + :ivar progress: Counts of the VMs in each state. + :vartype progress: ~azure.mgmt.compute.v2020_06_01.models.RollingUpgradeProgressInfo + :ivar error: Error Details for this upgrade if there are any. + :vartype error: ~azure.mgmt.compute.v2020_06_01.models.ApiError + :ivar started_by: Invoker of the Upgrade Operation. Possible values include: "Unknown", "User", + "Platform". + :vartype started_by: str or ~azure.mgmt.compute.v2020_06_01.models.UpgradeOperationInvoker + :ivar target_image_reference: Image Reference details. + :vartype target_image_reference: ~azure.mgmt.compute.v2020_06_01.models.ImageReference + :ivar rollback_info: Information about OS rollback if performed. + :vartype rollback_info: ~azure.mgmt.compute.v2020_06_01.models.RollbackStatusInfo + """ + + _validation = { + 'running_status': {'readonly': True}, + 'progress': {'readonly': True}, + 'error': {'readonly': True}, + 'started_by': {'readonly': True}, + 'target_image_reference': {'readonly': True}, + 'rollback_info': {'readonly': True}, + } + + _attribute_map = { + 'running_status': {'key': 'runningStatus', 'type': 'UpgradeOperationHistoryStatus'}, + 'progress': {'key': 'progress', 'type': 'RollingUpgradeProgressInfo'}, + 'error': {'key': 'error', 'type': 'ApiError'}, + 'started_by': {'key': 'startedBy', 'type': 'str'}, + 'target_image_reference': {'key': 'targetImageReference', 'type': 'ImageReference'}, + 'rollback_info': {'key': 'rollbackInfo', 'type': 'RollbackStatusInfo'}, + } + + def __init__( + self, + **kwargs + ): + super(UpgradeOperationHistoricalStatusInfoProperties, self).__init__(**kwargs) + self.running_status = None + self.progress = None + self.error = None + self.started_by = None + self.target_image_reference = None + self.rollback_info = None + + +class UpgradeOperationHistoryStatus(msrest.serialization.Model): + """Information about the current running state of the overall upgrade. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Code indicating the current status of the upgrade. Possible values include: + "RollingForward", "Cancelled", "Completed", "Faulted". + :vartype code: str or ~azure.mgmt.compute.v2020_06_01.models.UpgradeState + :ivar start_time: Start time of the upgrade. + :vartype start_time: ~datetime.datetime + :ivar end_time: End time of the upgrade. + :vartype end_time: ~datetime.datetime + """ + + _validation = { + 'code': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(UpgradeOperationHistoryStatus, self).__init__(**kwargs) + self.code = None + self.start_time = None + self.end_time = None + + +class UpgradePolicy(msrest.serialization.Model): + """Describes an upgrade policy - automatic, manual, or rolling. + + :param mode: Specifies the mode of an upgrade to virtual machines in the scale set.:code:`
    `:code:`
    ` Possible values are::code:`
    `:code:`
    ` **Manual** - You control + the application of updates to virtual machines in the scale set. You do this by using the + manualUpgrade action.:code:`
    `:code:`
    ` **Automatic** - All virtual machines in the + scale set are automatically updated at the same time. Possible values include: "Automatic", + "Manual", "Rolling". + :type mode: str or ~azure.mgmt.compute.v2020_06_01.models.UpgradeMode + :param rolling_upgrade_policy: The configuration parameters used while performing a rolling + upgrade. + :type rolling_upgrade_policy: ~azure.mgmt.compute.v2020_06_01.models.RollingUpgradePolicy + :param automatic_os_upgrade_policy: Configuration parameters used for performing automatic OS + Upgrade. + :type automatic_os_upgrade_policy: + ~azure.mgmt.compute.v2020_06_01.models.AutomaticOSUpgradePolicy + """ + + _attribute_map = { + 'mode': {'key': 'mode', 'type': 'str'}, + 'rolling_upgrade_policy': {'key': 'rollingUpgradePolicy', 'type': 'RollingUpgradePolicy'}, + 'automatic_os_upgrade_policy': {'key': 'automaticOSUpgradePolicy', 'type': 'AutomaticOSUpgradePolicy'}, + } + + def __init__( + self, + *, + mode: Optional[Union[str, "UpgradeMode"]] = None, + rolling_upgrade_policy: Optional["RollingUpgradePolicy"] = None, + automatic_os_upgrade_policy: Optional["AutomaticOSUpgradePolicy"] = None, + **kwargs + ): + super(UpgradePolicy, self).__init__(**kwargs) + self.mode = mode + self.rolling_upgrade_policy = rolling_upgrade_policy + self.automatic_os_upgrade_policy = automatic_os_upgrade_policy + + +class Usage(msrest.serialization.Model): + """Describes Compute Resource Usage. + + 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 unit: Required. An enum describing the unit of usage measurement. Default value: "Count". + :vartype unit: str + :param current_value: Required. The current usage of the resource. + :type current_value: int + :param limit: Required. The maximum permitted usage of the resource. + :type limit: long + :param name: Required. The name of the type of usage. + :type name: ~azure.mgmt.compute.v2020_06_01.models.UsageName + """ + + _validation = { + 'unit': {'required': True, 'constant': True}, + 'current_value': {'required': True}, + 'limit': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + unit = "Count" + + def __init__( + self, + *, + current_value: int, + limit: int, + name: "UsageName", + **kwargs + ): + super(Usage, self).__init__(**kwargs) + self.current_value = current_value + self.limit = limit + self.name = name + + +class UsageName(msrest.serialization.Model): + """The Usage Names. + + :param value: The name of the resource. + :type value: str + :param localized_value: The localized name of the resource. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[str] = None, + localized_value: Optional[str] = None, + **kwargs + ): + super(UsageName, self).__init__(**kwargs) + self.value = value + self.localized_value = localized_value + + +class VaultCertificate(msrest.serialization.Model): + """Describes a single certificate reference in a Key Vault, and where the certificate should reside on the VM. + + :param certificate_url: This is the URL of a certificate that has been uploaded to Key Vault as + a secret. For adding a secret to the Key Vault, see `Add a key or secret to the key vault + `_. In this case, your + certificate needs to be It is the Base64 encoding of the following JSON Object which is encoded + in UTF-8: :code:`
    `:code:`
    ` {:code:`
    ` "data":":code:``",:code:`
    ` "dataType":"pfx",:code:`
    ` "password":":code:``":code:`
    `}. + :type certificate_url: str + :param certificate_store: For Windows VMs, specifies the certificate store on the Virtual + Machine to which the certificate should be added. The specified certificate store is implicitly + in the LocalMachine account. :code:`
    `:code:`
    `For Linux VMs, the certificate file is + placed under the /var/lib/waagent directory, with the file name <UppercaseThumbprint>.crt + for the X509 certificate file and <UppercaseThumbprint>.prv for private key. Both of + these files are .pem formatted. + :type certificate_store: str + """ + + _attribute_map = { + 'certificate_url': {'key': 'certificateUrl', 'type': 'str'}, + 'certificate_store': {'key': 'certificateStore', 'type': 'str'}, + } + + def __init__( + self, + *, + certificate_url: Optional[str] = None, + certificate_store: Optional[str] = None, + **kwargs + ): + super(VaultCertificate, self).__init__(**kwargs) + self.certificate_url = certificate_url + self.certificate_store = certificate_store + + +class VaultSecretGroup(msrest.serialization.Model): + """Describes a set of certificates which are all in the same Key Vault. + + :param source_vault: The relative URL of the Key Vault containing all of the certificates in + VaultCertificates. + :type source_vault: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param vault_certificates: The list of key vault references in SourceVault which contain + certificates. + :type vault_certificates: list[~azure.mgmt.compute.v2020_06_01.models.VaultCertificate] + """ + + _attribute_map = { + 'source_vault': {'key': 'sourceVault', 'type': 'SubResource'}, + 'vault_certificates': {'key': 'vaultCertificates', 'type': '[VaultCertificate]'}, + } + + def __init__( + self, + *, + source_vault: Optional["SubResource"] = None, + vault_certificates: Optional[List["VaultCertificate"]] = None, + **kwargs + ): + super(VaultSecretGroup, self).__init__(**kwargs) + self.source_vault = source_vault + self.vault_certificates = vault_certificates + + +class VirtualHardDisk(msrest.serialization.Model): + """Describes the uri of a disk. + + :param uri: Specifies the virtual hard disk's uri. + :type uri: str + """ + + _attribute_map = { + 'uri': {'key': 'uri', 'type': 'str'}, + } + + def __init__( + self, + *, + uri: Optional[str] = None, + **kwargs + ): + super(VirtualHardDisk, self).__init__(**kwargs) + self.uri = uri + + +class VirtualMachine(Resource): + """Describes a Virtual Machine. + + 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 plan: Specifies information about the marketplace image used to create the virtual + machine. This element is only used for marketplace images. Before you can use a marketplace + image from an API, you must enable the image for programmatic use. In the Azure portal, find + the marketplace image that you want to use and then click **Want to deploy programmatically, + Get Started ->**. Enter any required information and then click **Save**. + :type plan: ~azure.mgmt.compute.v2020_06_01.models.Plan + :ivar resources: The virtual machine child extension resources. + :vartype resources: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtension] + :param identity: The identity of the virtual machine, if configured. + :type identity: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineIdentity + :param zones: The virtual machine zones. + :type zones: list[str] + :param hardware_profile: Specifies the hardware settings for the virtual machine. + :type hardware_profile: ~azure.mgmt.compute.v2020_06_01.models.HardwareProfile + :param storage_profile: Specifies the storage settings for the virtual machine disks. + :type storage_profile: ~azure.mgmt.compute.v2020_06_01.models.StorageProfile + :param additional_capabilities: Specifies additional capabilities enabled or disabled on the + virtual machine. + :type additional_capabilities: ~azure.mgmt.compute.v2020_06_01.models.AdditionalCapabilities + :param os_profile: Specifies the operating system settings used while creating the virtual + machine. Some of the settings cannot be changed once VM is provisioned. + :type os_profile: ~azure.mgmt.compute.v2020_06_01.models.OSProfile + :param network_profile: Specifies the network interfaces of the virtual machine. + :type network_profile: ~azure.mgmt.compute.v2020_06_01.models.NetworkProfile + :param security_profile: Specifies the Security related profile settings for the virtual + machine. + :type security_profile: ~azure.mgmt.compute.v2020_06_01.models.SecurityProfile + :param diagnostics_profile: Specifies the boot diagnostic settings state. + :code:`
    `:code:`
    `Minimum api-version: 2015-06-15. + :type diagnostics_profile: ~azure.mgmt.compute.v2020_06_01.models.DiagnosticsProfile + :param availability_set: Specifies information about the availability set that the virtual + machine should be assigned to. Virtual machines specified in the same availability set are + allocated to different nodes to maximize availability. For more information about availability + sets, see `Manage the availability of virtual machines + `_. :code:`
    `:code:`
    ` + For more information on Azure planned maintenance, see `Planned maintenance for virtual + machines in Azure `_ + :code:`
    `:code:`
    ` Currently, a VM can only be added to availability set at creation + time. The availability set to which the VM is being added should be under the same resource + group as the availability set resource. An existing VM cannot be added to an availability set. + :code:`
    `:code:`
    `This property cannot exist along with a non-null + properties.virtualMachineScaleSet reference. + :type availability_set: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param virtual_machine_scale_set: Specifies information about the virtual machine scale set + that the virtual machine should be assigned to. Virtual machines specified in the same virtual + machine scale set are allocated to different nodes to maximize availability. Currently, a VM + can only be added to virtual machine scale set at creation time. An existing VM cannot be added + to a virtual machine scale set. :code:`
    `:code:`
    `This property cannot exist along with a + non-null properties.availabilitySet reference. :code:`
    `:code:`
    `Minimum api‐version: + 2019‐03‐01. + :type virtual_machine_scale_set: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param proximity_placement_group: Specifies information about the proximity placement group + that the virtual machine should be assigned to. :code:`
    `:code:`
    `Minimum api-version: + 2018-04-01. + :type proximity_placement_group: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param priority: Specifies the priority for the virtual machine. + :code:`
    `:code:`
    `Minimum api-version: 2019-03-01. Possible values include: "Regular", + "Low", "Spot". + :type priority: str or ~azure.mgmt.compute.v2020_06_01.models.VirtualMachinePriorityTypes + :param eviction_policy: Specifies the eviction policy for the Azure Spot virtual machine and + Azure Spot scale set. :code:`
    `:code:`
    `For Azure Spot virtual machines, both + 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01. + :code:`
    `:code:`
    `For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported + and the minimum api-version is 2017-10-30-preview. Possible values include: "Deallocate", + "Delete". + :type eviction_policy: str or + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineEvictionPolicyTypes + :param billing_profile: Specifies the billing related details of a Azure Spot virtual machine. + :code:`
    `:code:`
    `Minimum api-version: 2019-03-01. + :type billing_profile: ~azure.mgmt.compute.v2020_06_01.models.BillingProfile + :param host: Specifies information about the dedicated host that the virtual machine resides + in. :code:`
    `:code:`
    `Minimum api-version: 2018-10-01. + :type host: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param host_group: Specifies information about the dedicated host group that the virtual + machine resides in. :code:`
    `:code:`
    `Minimum api-version: 2020-06-01. + :code:`
    `:code:`
    `NOTE: User cannot specify both host and hostGroup properties. + :type host_group: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :ivar instance_view: The virtual machine instance view. + :vartype instance_view: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineInstanceView + :param license_type: Specifies that the image or disk that is being used was licensed on- + premises. This element is only used for images that contain the Windows Server operating + system. :code:`
    `:code:`
    ` Possible values are: :code:`
    `:code:`
    ` Windows_Client + :code:`
    `:code:`
    ` Windows_Server :code:`
    `:code:`
    ` If this element is included in + a request for an update, the value must match the initial value. This value cannot be updated. + :code:`
    `:code:`
    ` For more information, see `Azure Hybrid Use Benefit for Windows Server + `_ :code:`
    `:code:`
    ` + Minimum api-version: 2015-06-15. + :type license_type: str + :ivar vm_id: Specifies the VM unique ID which is a 128-bits identifier that is encoded and + stored in all Azure IaaS VMs SMBIOS and can be read using platform BIOS commands. + :vartype vm_id: str + :param extensions_time_budget: Specifies the time alloted for all extensions to start. The time + duration should be between 15 minutes and 120 minutes (inclusive) and should be specified in + ISO 8601 format. The default value is 90 minutes (PT1H30M). :code:`
    `:code:`
    ` Minimum + api-version: 2020-06-01. + :type extensions_time_budget: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'resources': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'instance_view': {'readonly': True}, + 'vm_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}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'resources': {'key': 'resources', 'type': '[VirtualMachineExtension]'}, + 'identity': {'key': 'identity', 'type': 'VirtualMachineIdentity'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'hardware_profile': {'key': 'properties.hardwareProfile', 'type': 'HardwareProfile'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, + 'additional_capabilities': {'key': 'properties.additionalCapabilities', 'type': 'AdditionalCapabilities'}, + 'os_profile': {'key': 'properties.osProfile', 'type': 'OSProfile'}, + 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'}, + 'security_profile': {'key': 'properties.securityProfile', 'type': 'SecurityProfile'}, + 'diagnostics_profile': {'key': 'properties.diagnosticsProfile', 'type': 'DiagnosticsProfile'}, + 'availability_set': {'key': 'properties.availabilitySet', 'type': 'SubResource'}, + 'virtual_machine_scale_set': {'key': 'properties.virtualMachineScaleSet', 'type': 'SubResource'}, + 'proximity_placement_group': {'key': 'properties.proximityPlacementGroup', 'type': 'SubResource'}, + 'priority': {'key': 'properties.priority', 'type': 'str'}, + 'eviction_policy': {'key': 'properties.evictionPolicy', 'type': 'str'}, + 'billing_profile': {'key': 'properties.billingProfile', 'type': 'BillingProfile'}, + 'host': {'key': 'properties.host', 'type': 'SubResource'}, + 'host_group': {'key': 'properties.hostGroup', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineInstanceView'}, + 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, + 'vm_id': {'key': 'properties.vmId', 'type': 'str'}, + 'extensions_time_budget': {'key': 'properties.extensionsTimeBudget', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + plan: Optional["Plan"] = None, + identity: Optional["VirtualMachineIdentity"] = None, + zones: Optional[List[str]] = None, + hardware_profile: Optional["HardwareProfile"] = None, + storage_profile: Optional["StorageProfile"] = None, + additional_capabilities: Optional["AdditionalCapabilities"] = None, + os_profile: Optional["OSProfile"] = None, + network_profile: Optional["NetworkProfile"] = None, + security_profile: Optional["SecurityProfile"] = None, + diagnostics_profile: Optional["DiagnosticsProfile"] = None, + availability_set: Optional["SubResource"] = None, + virtual_machine_scale_set: Optional["SubResource"] = None, + proximity_placement_group: Optional["SubResource"] = None, + priority: Optional[Union[str, "VirtualMachinePriorityTypes"]] = None, + eviction_policy: Optional[Union[str, "VirtualMachineEvictionPolicyTypes"]] = None, + billing_profile: Optional["BillingProfile"] = None, + host: Optional["SubResource"] = None, + host_group: Optional["SubResource"] = None, + license_type: Optional[str] = None, + extensions_time_budget: Optional[str] = None, + **kwargs + ): + super(VirtualMachine, self).__init__(location=location, tags=tags, **kwargs) + self.plan = plan + self.resources = None + self.identity = identity + self.zones = zones + self.hardware_profile = hardware_profile + self.storage_profile = storage_profile + self.additional_capabilities = additional_capabilities + self.os_profile = os_profile + self.network_profile = network_profile + self.security_profile = security_profile + self.diagnostics_profile = diagnostics_profile + self.availability_set = availability_set + self.virtual_machine_scale_set = virtual_machine_scale_set + self.proximity_placement_group = proximity_placement_group + self.priority = priority + self.eviction_policy = eviction_policy + self.billing_profile = billing_profile + self.host = host + self.host_group = host_group + self.provisioning_state = None + self.instance_view = None + self.license_type = license_type + self.vm_id = None + self.extensions_time_budget = extensions_time_budget + + +class VirtualMachineAgentInstanceView(msrest.serialization.Model): + """The instance view of the VM Agent running on the virtual machine. + + :param vm_agent_version: The VM Agent full version. + :type vm_agent_version: str + :param extension_handlers: The virtual machine extension handler instance view. + :type extension_handlers: + list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtensionHandlerInstanceView] + :param statuses: The resource status information. + :type statuses: list[~azure.mgmt.compute.v2020_06_01.models.InstanceViewStatus] + """ + + _attribute_map = { + 'vm_agent_version': {'key': 'vmAgentVersion', 'type': 'str'}, + 'extension_handlers': {'key': 'extensionHandlers', 'type': '[VirtualMachineExtensionHandlerInstanceView]'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__( + self, + *, + vm_agent_version: Optional[str] = None, + extension_handlers: Optional[List["VirtualMachineExtensionHandlerInstanceView"]] = None, + statuses: Optional[List["InstanceViewStatus"]] = None, + **kwargs + ): + super(VirtualMachineAgentInstanceView, self).__init__(**kwargs) + self.vm_agent_version = vm_agent_version + self.extension_handlers = extension_handlers + self.statuses = statuses + + +class VirtualMachineAssessPatchesResult(msrest.serialization.Model): + """Describes the properties of an AssessPatches result. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status: The overall success or failure status of the operation. It remains "InProgress" + until the operation completes. At that point it will become "Failed", "Succeeded", or + "CompletedWithWarnings.". Possible values include: "InProgress", "Failed", "Succeeded", + "CompletedWithWarnings". + :vartype status: str or ~azure.mgmt.compute.v2020_06_01.models.PatchOperationStatus + :ivar assessment_activity_id: The activity ID of the operation that produced this result. It is + used to correlate across CRP and extension logs. + :vartype assessment_activity_id: str + :ivar reboot_pending: The overall reboot status of the VM. It will be true when partially + installed patches require a reboot to complete installation but the reboot has not yet + occurred. + :vartype reboot_pending: bool + :ivar critical_and_security_patch_count: The number of critical or security patches that have + been detected as available and not yet installed. + :vartype critical_and_security_patch_count: int + :ivar other_patch_count: The number of all available patches excluding critical and security. + :vartype other_patch_count: int + :ivar start_date_time: The UTC timestamp when the operation began. + :vartype start_date_time: ~datetime.datetime + :ivar patches: The list of patches that have been detected as available for installation. + :vartype patches: + list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineSoftwarePatchProperties] + :ivar error: The errors that were encountered during execution of the operation. The details + array contains the list of them. + :vartype error: ~azure.mgmt.compute.v2020_06_01.models.ApiError + """ + + _validation = { + 'status': {'readonly': True}, + 'assessment_activity_id': {'readonly': True}, + 'reboot_pending': {'readonly': True}, + 'critical_and_security_patch_count': {'readonly': True}, + 'other_patch_count': {'readonly': True}, + 'start_date_time': {'readonly': True}, + 'patches': {'readonly': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'assessment_activity_id': {'key': 'assessmentActivityId', 'type': 'str'}, + 'reboot_pending': {'key': 'rebootPending', 'type': 'bool'}, + 'critical_and_security_patch_count': {'key': 'criticalAndSecurityPatchCount', 'type': 'int'}, + 'other_patch_count': {'key': 'otherPatchCount', 'type': 'int'}, + 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, + 'patches': {'key': 'patches', 'type': '[VirtualMachineSoftwarePatchProperties]'}, + 'error': {'key': 'error', 'type': 'ApiError'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineAssessPatchesResult, self).__init__(**kwargs) + self.status = None + self.assessment_activity_id = None + self.reboot_pending = None + self.critical_and_security_patch_count = None + self.other_patch_count = None + self.start_date_time = None + self.patches = None + self.error = None + + +class VirtualMachineCaptureParameters(msrest.serialization.Model): + """Capture Virtual Machine parameters. + + All required parameters must be populated in order to send to Azure. + + :param vhd_prefix: Required. The captured virtual hard disk's name prefix. + :type vhd_prefix: str + :param destination_container_name: Required. The destination container name. + :type destination_container_name: str + :param overwrite_vhds: Required. Specifies whether to overwrite the destination virtual hard + disk, in case of conflict. + :type overwrite_vhds: bool + """ + + _validation = { + 'vhd_prefix': {'required': True}, + 'destination_container_name': {'required': True}, + 'overwrite_vhds': {'required': True}, + } + + _attribute_map = { + 'vhd_prefix': {'key': 'vhdPrefix', 'type': 'str'}, + 'destination_container_name': {'key': 'destinationContainerName', 'type': 'str'}, + 'overwrite_vhds': {'key': 'overwriteVhds', 'type': 'bool'}, + } + + def __init__( + self, + *, + vhd_prefix: str, + destination_container_name: str, + overwrite_vhds: bool, + **kwargs + ): + super(VirtualMachineCaptureParameters, self).__init__(**kwargs) + self.vhd_prefix = vhd_prefix + self.destination_container_name = destination_container_name + self.overwrite_vhds = overwrite_vhds + + +class VirtualMachineCaptureResult(SubResource): + """Output of virtual machine capture operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource Id. + :type id: str + :ivar schema: the schema of the captured virtual machine. + :vartype schema: str + :ivar content_version: the version of the content. + :vartype content_version: str + :ivar parameters: parameters of the captured virtual machine. + :vartype parameters: object + :ivar resources: a list of resource items of the captured virtual machine. + :vartype resources: list[object] + """ + + _validation = { + 'schema': {'readonly': True}, + 'content_version': {'readonly': True}, + 'parameters': {'readonly': True}, + 'resources': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'schema': {'key': '$schema', 'type': 'str'}, + 'content_version': {'key': 'contentVersion', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'object'}, + 'resources': {'key': 'resources', 'type': '[object]'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(VirtualMachineCaptureResult, self).__init__(id=id, **kwargs) + self.schema = None + self.content_version = None + self.parameters = None + self.resources = None + + +class VirtualMachineExtension(Resource): + """Describes a Virtual Machine Extension. + + 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 force_update_tag: How the extension handler should be forced to update even if the + extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type_properties_type: Specifies the type of the extension; an example is + "CustomScriptExtension". + :type type_properties_type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param auto_upgrade_minor_version: Indicates whether the extension should use a newer minor + version if one is available at deployment time. Once deployed, however, the extension will not + upgrade minor versions unless redeployed, even with this property set to true. + :type auto_upgrade_minor_version: bool + :param enable_automatic_upgrade: Indicates whether the extension should be automatically + upgraded by the platform if there is a newer version of the extension available. + :type enable_automatic_upgrade: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: object + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :param instance_view: The virtual machine extension instance view. + :type instance_view: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtensionInstanceView + """ + + _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}'}, + 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'properties.publisher', 'type': 'str'}, + 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, + 'type_handler_version': {'key': 'properties.typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'enable_automatic_upgrade': {'key': 'properties.enableAutomaticUpgrade', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': 'object'}, + 'protected_settings': {'key': 'properties.protectedSettings', 'type': 'object'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineExtensionInstanceView'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + force_update_tag: Optional[str] = None, + publisher: Optional[str] = None, + type_properties_type: Optional[str] = None, + type_handler_version: Optional[str] = None, + auto_upgrade_minor_version: Optional[bool] = None, + enable_automatic_upgrade: Optional[bool] = None, + settings: Optional[object] = None, + protected_settings: Optional[object] = None, + instance_view: Optional["VirtualMachineExtensionInstanceView"] = None, + **kwargs + ): + super(VirtualMachineExtension, self).__init__(location=location, tags=tags, **kwargs) + self.force_update_tag = force_update_tag + self.publisher = publisher + self.type_properties_type = type_properties_type + self.type_handler_version = type_handler_version + self.auto_upgrade_minor_version = auto_upgrade_minor_version + self.enable_automatic_upgrade = enable_automatic_upgrade + self.settings = settings + self.protected_settings = protected_settings + self.provisioning_state = None + self.instance_view = instance_view + + +class VirtualMachineExtensionHandlerInstanceView(msrest.serialization.Model): + """The instance view of a virtual machine extension handler. + + :param type: Specifies the type of the extension; an example is "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param status: The extension handler status. + :type status: ~azure.mgmt.compute.v2020_06_01.models.InstanceViewStatus + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'InstanceViewStatus'}, + } + + def __init__( + self, + *, + type: Optional[str] = None, + type_handler_version: Optional[str] = None, + status: Optional["InstanceViewStatus"] = None, + **kwargs + ): + super(VirtualMachineExtensionHandlerInstanceView, self).__init__(**kwargs) + self.type = type + self.type_handler_version = type_handler_version + self.status = status + + +class VirtualMachineExtensionImage(Resource): + """Describes a Virtual Machine Extension 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 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 operating_system: The operating system this extension supports. + :type operating_system: str + :param compute_role: The type of role (IaaS or PaaS) this extension supports. + :type compute_role: str + :param handler_schema: The schema defined by publisher, where extension consumers should + provide settings in a matching schema. + :type handler_schema: str + :param vm_scale_set_enabled: Whether the extension can be used on xRP VMScaleSets. By default + existing extensions are usable on scalesets, but there might be cases where a publisher wants + to explicitly indicate the extension is only enabled for CRP VMs but not VMSS. + :type vm_scale_set_enabled: bool + :param supports_multiple_extensions: Whether the handler can support multiple extensions. + :type supports_multiple_extensions: bool + """ + + _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}'}, + 'operating_system': {'key': 'properties.operatingSystem', 'type': 'str'}, + 'compute_role': {'key': 'properties.computeRole', 'type': 'str'}, + 'handler_schema': {'key': 'properties.handlerSchema', 'type': 'str'}, + 'vm_scale_set_enabled': {'key': 'properties.vmScaleSetEnabled', 'type': 'bool'}, + 'supports_multiple_extensions': {'key': 'properties.supportsMultipleExtensions', 'type': 'bool'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + operating_system: Optional[str] = None, + compute_role: Optional[str] = None, + handler_schema: Optional[str] = None, + vm_scale_set_enabled: Optional[bool] = None, + supports_multiple_extensions: Optional[bool] = None, + **kwargs + ): + super(VirtualMachineExtensionImage, self).__init__(location=location, tags=tags, **kwargs) + self.operating_system = operating_system + self.compute_role = compute_role + self.handler_schema = handler_schema + self.vm_scale_set_enabled = vm_scale_set_enabled + self.supports_multiple_extensions = supports_multiple_extensions + + +class VirtualMachineExtensionInstanceView(msrest.serialization.Model): + """The instance view of a virtual machine extension. + + :param name: The virtual machine extension name. + :type name: str + :param type: Specifies the type of the extension; an example is "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param substatuses: The resource status information. + :type substatuses: list[~azure.mgmt.compute.v2020_06_01.models.InstanceViewStatus] + :param statuses: The resource status information. + :type statuses: list[~azure.mgmt.compute.v2020_06_01.models.InstanceViewStatus] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'substatuses': {'key': 'substatuses', 'type': '[InstanceViewStatus]'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + type: Optional[str] = None, + type_handler_version: Optional[str] = None, + substatuses: Optional[List["InstanceViewStatus"]] = None, + statuses: Optional[List["InstanceViewStatus"]] = None, + **kwargs + ): + super(VirtualMachineExtensionInstanceView, self).__init__(**kwargs) + self.name = name + self.type = type + self.type_handler_version = type_handler_version + self.substatuses = substatuses + self.statuses = statuses + + +class VirtualMachineExtensionsListResult(msrest.serialization.Model): + """The List Extension operation response. + + :param value: The list of extensions. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtension] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualMachineExtension]'}, + } + + def __init__( + self, + *, + value: Optional[List["VirtualMachineExtension"]] = None, + **kwargs + ): + super(VirtualMachineExtensionsListResult, self).__init__(**kwargs) + self.value = value + + +class VirtualMachineExtensionUpdate(UpdateResource): + """Describes a Virtual Machine Extension. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param force_update_tag: How the extension handler should be forced to update even if the + extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type: Specifies the type of the extension; an example is "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param auto_upgrade_minor_version: Indicates whether the extension should use a newer minor + version if one is available at deployment time. Once deployed, however, the extension will not + upgrade minor versions unless redeployed, even with this property set to true. + :type auto_upgrade_minor_version: bool + :param enable_automatic_upgrade: Indicates whether the extension should be automatically + upgraded by the platform if there is a newer version of the extension available. + :type enable_automatic_upgrade: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: object + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'properties.publisher', 'type': 'str'}, + 'type': {'key': 'properties.type', 'type': 'str'}, + 'type_handler_version': {'key': 'properties.typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'enable_automatic_upgrade': {'key': 'properties.enableAutomaticUpgrade', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': 'object'}, + 'protected_settings': {'key': 'properties.protectedSettings', 'type': 'object'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + force_update_tag: Optional[str] = None, + publisher: Optional[str] = None, + type: Optional[str] = None, + type_handler_version: Optional[str] = None, + auto_upgrade_minor_version: Optional[bool] = None, + enable_automatic_upgrade: Optional[bool] = None, + settings: Optional[object] = None, + protected_settings: Optional[object] = None, + **kwargs + ): + super(VirtualMachineExtensionUpdate, self).__init__(tags=tags, **kwargs) + self.force_update_tag = force_update_tag + self.publisher = publisher + self.type = type + self.type_handler_version = type_handler_version + self.auto_upgrade_minor_version = auto_upgrade_minor_version + self.enable_automatic_upgrade = enable_automatic_upgrade + self.settings = settings + self.protected_settings = protected_settings + + +class VirtualMachineHealthStatus(msrest.serialization.Model): + """The health status of the VM. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status: The health status information for the VM. + :vartype status: ~azure.mgmt.compute.v2020_06_01.models.InstanceViewStatus + """ + + _validation = { + 'status': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'InstanceViewStatus'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineHealthStatus, self).__init__(**kwargs) + self.status = None + + +class VirtualMachineIdentity(msrest.serialization.Model): + """Identity for the virtual machine. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of virtual machine identity. This property will only be + provided for a system assigned identity. + :vartype principal_id: str + :ivar tenant_id: The tenant id associated with the virtual machine. This property will only be + provided for a system assigned identity. + :vartype tenant_id: str + :param type: The type of identity used for the virtual machine. The type 'SystemAssigned, + UserAssigned' includes both an implicitly created identity and a set of user assigned + identities. The type 'None' will remove any identities from the virtual machine. Possible + values include: "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned", "None". + :type type: str or ~azure.mgmt.compute.v2020_06_01.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated with the Virtual + Machine. The user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.compute.v2020_06_01.models.Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "ResourceIdentityType"]] = None, + user_assigned_identities: Optional[Dict[str, "Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, + **kwargs + ): + super(VirtualMachineIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + self.user_assigned_identities = user_assigned_identities + + +class VirtualMachineImageResource(SubResource): + """Virtual machine image resource information. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource Id. + :type id: str + :param name: Required. The name of the resource. + :type name: str + :param location: Required. The supported Azure location of the resource. + :type location: str + :param tags: A set of tags. Specifies the tags that are assigned to the virtual machine. For + more information about using tags, see `Using tags to organize your Azure resources + `_. + :type tags: dict[str, str] + """ + + _validation = { + 'name': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + name: str, + location: str, + id: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(VirtualMachineImageResource, self).__init__(id=id, **kwargs) + self.name = name + self.location = location + self.tags = tags + + +class VirtualMachineImage(VirtualMachineImageResource): + """Describes a Virtual Machine Image. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource Id. + :type id: str + :param name: Required. The name of the resource. + :type name: str + :param location: Required. The supported Azure location of the resource. + :type location: str + :param tags: A set of tags. Specifies the tags that are assigned to the virtual machine. For + more information about using tags, see `Using tags to organize your Azure resources + `_. + :type tags: dict[str, str] + :param plan: Used for establishing the purchase context of any 3rd Party artifact through + MarketPlace. + :type plan: ~azure.mgmt.compute.v2020_06_01.models.PurchasePlan + :param os_disk_image: Contains the os disk image information. + :type os_disk_image: ~azure.mgmt.compute.v2020_06_01.models.OSDiskImage + :param data_disk_images: + :type data_disk_images: list[~azure.mgmt.compute.v2020_06_01.models.DataDiskImage] + :param automatic_os_upgrade_properties: Describes automatic OS upgrade properties on the image. + :type automatic_os_upgrade_properties: + ~azure.mgmt.compute.v2020_06_01.models.AutomaticOSUpgradeProperties + :param hyper_v_generation: Specifies the HyperVGeneration Type. Possible values include: "V1", + "V2". + :type hyper_v_generation: str or ~azure.mgmt.compute.v2020_06_01.models.HyperVGenerationTypes + :param disallowed: Specifies disallowed configuration for the VirtualMachine created from the + image. + :type disallowed: ~azure.mgmt.compute.v2020_06_01.models.DisallowedConfiguration + """ + + _validation = { + 'name': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'properties.plan', 'type': 'PurchasePlan'}, + 'os_disk_image': {'key': 'properties.osDiskImage', 'type': 'OSDiskImage'}, + 'data_disk_images': {'key': 'properties.dataDiskImages', 'type': '[DataDiskImage]'}, + 'automatic_os_upgrade_properties': {'key': 'properties.automaticOSUpgradeProperties', 'type': 'AutomaticOSUpgradeProperties'}, + 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, + 'disallowed': {'key': 'properties.disallowed', 'type': 'DisallowedConfiguration'}, + } + + def __init__( + self, + *, + name: str, + location: str, + id: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + plan: Optional["PurchasePlan"] = None, + os_disk_image: Optional["OSDiskImage"] = None, + data_disk_images: Optional[List["DataDiskImage"]] = None, + automatic_os_upgrade_properties: Optional["AutomaticOSUpgradeProperties"] = None, + hyper_v_generation: Optional[Union[str, "HyperVGenerationTypes"]] = None, + disallowed: Optional["DisallowedConfiguration"] = None, + **kwargs + ): + super(VirtualMachineImage, self).__init__(id=id, name=name, location=location, tags=tags, **kwargs) + self.plan = plan + self.os_disk_image = os_disk_image + self.data_disk_images = data_disk_images + self.automatic_os_upgrade_properties = automatic_os_upgrade_properties + self.hyper_v_generation = hyper_v_generation + self.disallowed = disallowed + + +class VirtualMachineInstanceView(msrest.serialization.Model): + """The instance view of a virtual machine. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param platform_update_domain: Specifies the update domain of the virtual machine. + :type platform_update_domain: int + :param platform_fault_domain: Specifies the fault domain of the virtual machine. + :type platform_fault_domain: int + :param computer_name: The computer name assigned to the virtual machine. + :type computer_name: str + :param os_name: The Operating System running on the virtual machine. + :type os_name: str + :param os_version: The version of Operating System running on the virtual machine. + :type os_version: str + :param hyper_v_generation: Specifies the HyperVGeneration Type associated with a resource. + Possible values include: "V1", "V2". + :type hyper_v_generation: str or ~azure.mgmt.compute.v2020_06_01.models.HyperVGenerationType + :param rdp_thumb_print: The Remote desktop certificate thumbprint. + :type rdp_thumb_print: str + :param vm_agent: The VM Agent running on the virtual machine. + :type vm_agent: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineAgentInstanceView + :param maintenance_redeploy_status: The Maintenance Operation status on the virtual machine. + :type maintenance_redeploy_status: + ~azure.mgmt.compute.v2020_06_01.models.MaintenanceRedeployStatus + :param disks: The virtual machine disk information. + :type disks: list[~azure.mgmt.compute.v2020_06_01.models.DiskInstanceView] + :param extensions: The extensions information. + :type extensions: + list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtensionInstanceView] + :ivar vm_health: The health status for the VM. + :vartype vm_health: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineHealthStatus + :param boot_diagnostics: Boot Diagnostics is a debugging feature which allows you to view + Console Output and Screenshot to diagnose VM status. :code:`
    `:code:`
    ` You can easily + view the output of your console log. :code:`
    `:code:`
    ` Azure also enables you to see a + screenshot of the VM from the hypervisor. + :type boot_diagnostics: ~azure.mgmt.compute.v2020_06_01.models.BootDiagnosticsInstanceView + :ivar assigned_host: Resource id of the dedicated host, on which the virtual machine is + allocated through automatic placement, when the virtual machine is associated with a dedicated + host group that has automatic placement enabled. :code:`
    `:code:`
    `Minimum api-version: + 2020-06-01. + :vartype assigned_host: str + :param statuses: The resource status information. + :type statuses: list[~azure.mgmt.compute.v2020_06_01.models.InstanceViewStatus] + :param patch_status: The status of virtual machine patch operations. + :type patch_status: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachinePatchStatus + """ + + _validation = { + 'vm_health': {'readonly': True}, + 'assigned_host': {'readonly': True}, + } + + _attribute_map = { + 'platform_update_domain': {'key': 'platformUpdateDomain', 'type': 'int'}, + 'platform_fault_domain': {'key': 'platformFaultDomain', 'type': 'int'}, + 'computer_name': {'key': 'computerName', 'type': 'str'}, + 'os_name': {'key': 'osName', 'type': 'str'}, + 'os_version': {'key': 'osVersion', 'type': 'str'}, + 'hyper_v_generation': {'key': 'hyperVGeneration', 'type': 'str'}, + 'rdp_thumb_print': {'key': 'rdpThumbPrint', 'type': 'str'}, + 'vm_agent': {'key': 'vmAgent', 'type': 'VirtualMachineAgentInstanceView'}, + 'maintenance_redeploy_status': {'key': 'maintenanceRedeployStatus', 'type': 'MaintenanceRedeployStatus'}, + 'disks': {'key': 'disks', 'type': '[DiskInstanceView]'}, + 'extensions': {'key': 'extensions', 'type': '[VirtualMachineExtensionInstanceView]'}, + 'vm_health': {'key': 'vmHealth', 'type': 'VirtualMachineHealthStatus'}, + 'boot_diagnostics': {'key': 'bootDiagnostics', 'type': 'BootDiagnosticsInstanceView'}, + 'assigned_host': {'key': 'assignedHost', 'type': 'str'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + 'patch_status': {'key': 'patchStatus', 'type': 'VirtualMachinePatchStatus'}, + } + + def __init__( + self, + *, + platform_update_domain: Optional[int] = None, + platform_fault_domain: Optional[int] = None, + computer_name: Optional[str] = None, + os_name: Optional[str] = None, + os_version: Optional[str] = None, + hyper_v_generation: Optional[Union[str, "HyperVGenerationType"]] = None, + rdp_thumb_print: Optional[str] = None, + vm_agent: Optional["VirtualMachineAgentInstanceView"] = None, + maintenance_redeploy_status: Optional["MaintenanceRedeployStatus"] = None, + disks: Optional[List["DiskInstanceView"]] = None, + extensions: Optional[List["VirtualMachineExtensionInstanceView"]] = None, + boot_diagnostics: Optional["BootDiagnosticsInstanceView"] = None, + statuses: Optional[List["InstanceViewStatus"]] = None, + patch_status: Optional["VirtualMachinePatchStatus"] = None, + **kwargs + ): + super(VirtualMachineInstanceView, self).__init__(**kwargs) + self.platform_update_domain = platform_update_domain + self.platform_fault_domain = platform_fault_domain + self.computer_name = computer_name + self.os_name = os_name + self.os_version = os_version + self.hyper_v_generation = hyper_v_generation + self.rdp_thumb_print = rdp_thumb_print + self.vm_agent = vm_agent + self.maintenance_redeploy_status = maintenance_redeploy_status + self.disks = disks + self.extensions = extensions + self.vm_health = None + self.boot_diagnostics = boot_diagnostics + self.assigned_host = None + self.statuses = statuses + self.patch_status = patch_status + + +class VirtualMachineListResult(msrest.serialization.Model): + """The List Virtual Machine operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of virtual machines. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachine] + :param next_link: The URI to fetch the next page of VMs. Call ListNext() with this URI to fetch + the next page of Virtual Machines. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualMachine]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["VirtualMachine"], + next_link: Optional[str] = None, + **kwargs + ): + super(VirtualMachineListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class VirtualMachinePatchStatus(msrest.serialization.Model): + """The status of virtual machine patch operations. + + :param available_patch_summary: The available patch summary of the latest assessment operation + for the virtual machine. + :type available_patch_summary: ~azure.mgmt.compute.v2020_06_01.models.AvailablePatchSummary + :param last_patch_installation_summary: The installation summary of the latest installation + operation for the virtual machine. + :type last_patch_installation_summary: + ~azure.mgmt.compute.v2020_06_01.models.LastPatchInstallationSummary + """ + + _attribute_map = { + 'available_patch_summary': {'key': 'availablePatchSummary', 'type': 'AvailablePatchSummary'}, + 'last_patch_installation_summary': {'key': 'lastPatchInstallationSummary', 'type': 'LastPatchInstallationSummary'}, + } + + def __init__( + self, + *, + available_patch_summary: Optional["AvailablePatchSummary"] = None, + last_patch_installation_summary: Optional["LastPatchInstallationSummary"] = None, + **kwargs + ): + super(VirtualMachinePatchStatus, self).__init__(**kwargs) + self.available_patch_summary = available_patch_summary + self.last_patch_installation_summary = last_patch_installation_summary + + +class VirtualMachineReimageParameters(msrest.serialization.Model): + """Parameters for Reimaging Virtual Machine. NOTE: Virtual Machine OS disk will always be reimaged. + + :param temp_disk: Specifies whether to reimage temp disk. Default value: false. Note: This temp + disk reimage parameter is only supported for VM/VMSS with Ephemeral OS disk. + :type temp_disk: bool + """ + + _attribute_map = { + 'temp_disk': {'key': 'tempDisk', 'type': 'bool'}, + } + + def __init__( + self, + *, + temp_disk: Optional[bool] = None, + **kwargs + ): + super(VirtualMachineReimageParameters, self).__init__(**kwargs) + self.temp_disk = temp_disk + + +class VirtualMachineScaleSet(Resource): + """Describes a Virtual Machine Scale Set. + + 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 sku: The virtual machine scale set sku. + :type sku: ~azure.mgmt.compute.v2020_06_01.models.Sku + :param plan: Specifies information about the marketplace image used to create the virtual + machine. This element is only used for marketplace images. Before you can use a marketplace + image from an API, you must enable the image for programmatic use. In the Azure portal, find + the marketplace image that you want to use and then click **Want to deploy programmatically, + Get Started ->**. Enter any required information and then click **Save**. + :type plan: ~azure.mgmt.compute.v2020_06_01.models.Plan + :param identity: The identity of the virtual machine scale set, if configured. + :type identity: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetIdentity + :param zones: The virtual machine scale set zones. NOTE: Availability zones can only be set + when you create the scale set. + :type zones: list[str] + :param upgrade_policy: The upgrade policy. + :type upgrade_policy: ~azure.mgmt.compute.v2020_06_01.models.UpgradePolicy + :param automatic_repairs_policy: Policy for automatic repairs. + :type automatic_repairs_policy: ~azure.mgmt.compute.v2020_06_01.models.AutomaticRepairsPolicy + :param virtual_machine_profile: The virtual machine profile. + :type virtual_machine_profile: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMProfile + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :param overprovision: Specifies whether the Virtual Machine Scale Set should be + overprovisioned. + :type overprovision: bool + :param do_not_run_extensions_on_overprovisioned_v_ms: When Overprovision is enabled, extensions + are launched only on the requested number of VMs which are finally kept. This property will + hence ensure that the extensions do not run on the extra overprovisioned VMs. + :type do_not_run_extensions_on_overprovisioned_v_ms: bool + :ivar unique_id: Specifies the ID which uniquely identifies a Virtual Machine Scale Set. + :vartype unique_id: str + :param single_placement_group: When true this limits the scale set to a single placement group, + of max size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to + false. However, if singlePlacementGroup is false, it may not be modified to true. + :type single_placement_group: bool + :param zone_balance: Whether to force strictly even Virtual Machine distribution cross x-zones + in case there is zone outage. + :type zone_balance: bool + :param platform_fault_domain_count: Fault Domain count for each placement group. + :type platform_fault_domain_count: int + :param proximity_placement_group: Specifies information about the proximity placement group + that the virtual machine scale set should be assigned to. :code:`
    `:code:`
    `Minimum api- + version: 2018-04-01. + :type proximity_placement_group: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param host_group: Specifies information about the dedicated host group that the virtual + machine scale set resides in. :code:`
    `:code:`
    `Minimum api-version: 2020-06-01. + :type host_group: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param additional_capabilities: Specifies additional capabilities enabled or disabled on the + Virtual Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines + have the capability to support attaching managed data disks with UltraSSD_LRS storage account + type. + :type additional_capabilities: ~azure.mgmt.compute.v2020_06_01.models.AdditionalCapabilities + :param scale_in_policy: Specifies the scale-in policy that decides which virtual machines are + chosen for removal when a Virtual Machine Scale Set is scaled-in. + :type scale_in_policy: ~azure.mgmt.compute.v2020_06_01.models.ScaleInPolicy + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'unique_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}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'identity': {'key': 'identity', 'type': 'VirtualMachineScaleSetIdentity'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'upgrade_policy': {'key': 'properties.upgradePolicy', 'type': 'UpgradePolicy'}, + 'automatic_repairs_policy': {'key': 'properties.automaticRepairsPolicy', 'type': 'AutomaticRepairsPolicy'}, + 'virtual_machine_profile': {'key': 'properties.virtualMachineProfile', 'type': 'VirtualMachineScaleSetVMProfile'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'overprovision': {'key': 'properties.overprovision', 'type': 'bool'}, + 'do_not_run_extensions_on_overprovisioned_v_ms': {'key': 'properties.doNotRunExtensionsOnOverprovisionedVMs', 'type': 'bool'}, + 'unique_id': {'key': 'properties.uniqueId', 'type': 'str'}, + 'single_placement_group': {'key': 'properties.singlePlacementGroup', 'type': 'bool'}, + 'zone_balance': {'key': 'properties.zoneBalance', 'type': 'bool'}, + 'platform_fault_domain_count': {'key': 'properties.platformFaultDomainCount', 'type': 'int'}, + 'proximity_placement_group': {'key': 'properties.proximityPlacementGroup', 'type': 'SubResource'}, + 'host_group': {'key': 'properties.hostGroup', 'type': 'SubResource'}, + 'additional_capabilities': {'key': 'properties.additionalCapabilities', 'type': 'AdditionalCapabilities'}, + 'scale_in_policy': {'key': 'properties.scaleInPolicy', 'type': 'ScaleInPolicy'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + sku: Optional["Sku"] = None, + plan: Optional["Plan"] = None, + identity: Optional["VirtualMachineScaleSetIdentity"] = None, + zones: Optional[List[str]] = None, + upgrade_policy: Optional["UpgradePolicy"] = None, + automatic_repairs_policy: Optional["AutomaticRepairsPolicy"] = None, + virtual_machine_profile: Optional["VirtualMachineScaleSetVMProfile"] = None, + overprovision: Optional[bool] = None, + do_not_run_extensions_on_overprovisioned_v_ms: Optional[bool] = None, + single_placement_group: Optional[bool] = None, + zone_balance: Optional[bool] = None, + platform_fault_domain_count: Optional[int] = None, + proximity_placement_group: Optional["SubResource"] = None, + host_group: Optional["SubResource"] = None, + additional_capabilities: Optional["AdditionalCapabilities"] = None, + scale_in_policy: Optional["ScaleInPolicy"] = None, + **kwargs + ): + super(VirtualMachineScaleSet, self).__init__(location=location, tags=tags, **kwargs) + self.sku = sku + self.plan = plan + self.identity = identity + self.zones = zones + self.upgrade_policy = upgrade_policy + self.automatic_repairs_policy = automatic_repairs_policy + self.virtual_machine_profile = virtual_machine_profile + self.provisioning_state = None + self.overprovision = overprovision + self.do_not_run_extensions_on_overprovisioned_v_ms = do_not_run_extensions_on_overprovisioned_v_ms + self.unique_id = None + self.single_placement_group = single_placement_group + self.zone_balance = zone_balance + self.platform_fault_domain_count = platform_fault_domain_count + self.proximity_placement_group = proximity_placement_group + self.host_group = host_group + self.additional_capabilities = additional_capabilities + self.scale_in_policy = scale_in_policy + + +class VirtualMachineScaleSetDataDisk(msrest.serialization.Model): + """Describes a virtual machine scale set data disk. + + All required parameters must be populated in order to send to Azure. + + :param name: The disk name. + :type name: str + :param lun: Required. Specifies the logical unit number of the data disk. This value is used to + identify data disks within the VM and therefore must be unique for each data disk attached to a + VM. + :type lun: int + :param caching: Specifies the caching requirements. :code:`
    `:code:`
    ` Possible values + are: :code:`
    `:code:`
    ` **None** :code:`
    `:code:`
    ` **ReadOnly** + :code:`
    `:code:`
    ` **ReadWrite** :code:`
    `:code:`
    ` Default: **None for Standard + storage. ReadOnly for Premium storage**. Possible values include: "None", "ReadOnly", + "ReadWrite". + :type caching: str or ~azure.mgmt.compute.v2020_06_01.models.CachingTypes + :param write_accelerator_enabled: Specifies whether writeAccelerator should be enabled or + disabled on the disk. + :type write_accelerator_enabled: bool + :param create_option: Required. The create option. Possible values include: "FromImage", + "Empty", "Attach". + :type create_option: str or ~azure.mgmt.compute.v2020_06_01.models.DiskCreateOptionTypes + :param disk_size_gb: Specifies the size of an empty data disk in gigabytes. This element can be + used to overwrite the size of the disk in a virtual machine image. :code:`
    `:code:`
    ` + This value cannot be larger than 1023 GB. + :type disk_size_gb: int + :param managed_disk: The managed disk parameters. + :type managed_disk: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetManagedDiskParameters + :param disk_iops_read_write: Specifies the Read-Write IOPS for the managed disk. Should be used + only when StorageAccountType is UltraSSD_LRS. If not specified, a default value would be + assigned based on diskSizeGB. + :type disk_iops_read_write: long + :param disk_m_bps_read_write: Specifies the bandwidth in MB per second for the managed disk. + Should be used only when StorageAccountType is UltraSSD_LRS. If not specified, a default value + would be assigned based on diskSizeGB. + :type disk_m_bps_read_write: long + """ + + _validation = { + 'lun': {'required': True}, + 'create_option': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'lun': {'key': 'lun', 'type': 'int'}, + 'caching': {'key': 'caching', 'type': 'str'}, + 'write_accelerator_enabled': {'key': 'writeAcceleratorEnabled', 'type': 'bool'}, + 'create_option': {'key': 'createOption', 'type': 'str'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + 'managed_disk': {'key': 'managedDisk', 'type': 'VirtualMachineScaleSetManagedDiskParameters'}, + 'disk_iops_read_write': {'key': 'diskIOPSReadWrite', 'type': 'long'}, + 'disk_m_bps_read_write': {'key': 'diskMBpsReadWrite', 'type': 'long'}, + } + + def __init__( + self, + *, + lun: int, + create_option: Union[str, "DiskCreateOptionTypes"], + name: Optional[str] = None, + caching: Optional[Union[str, "CachingTypes"]] = None, + write_accelerator_enabled: Optional[bool] = None, + disk_size_gb: Optional[int] = None, + managed_disk: Optional["VirtualMachineScaleSetManagedDiskParameters"] = None, + disk_iops_read_write: Optional[int] = None, + disk_m_bps_read_write: Optional[int] = None, + **kwargs + ): + super(VirtualMachineScaleSetDataDisk, self).__init__(**kwargs) + self.name = name + self.lun = lun + self.caching = caching + self.write_accelerator_enabled = write_accelerator_enabled + self.create_option = create_option + self.disk_size_gb = disk_size_gb + self.managed_disk = managed_disk + self.disk_iops_read_write = disk_iops_read_write + self.disk_m_bps_read_write = disk_m_bps_read_write + + +class VirtualMachineScaleSetExtension(SubResourceReadOnly): + """Describes a Virtual Machine Scale Set Extension. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :param name: The name of the extension. + :type name: str + :ivar type: Resource type. + :vartype type: str + :param force_update_tag: If a value is provided and is different from the previous value, the + extension handler will be forced to update even if the extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type_properties_type: Specifies the type of the extension; an example is + "CustomScriptExtension". + :type type_properties_type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param auto_upgrade_minor_version: Indicates whether the extension should use a newer minor + version if one is available at deployment time. Once deployed, however, the extension will not + upgrade minor versions unless redeployed, even with this property set to true. + :type auto_upgrade_minor_version: bool + :param enable_automatic_upgrade: Indicates whether the extension should be automatically + upgraded by the platform if there is a newer version of the extension available. + :type enable_automatic_upgrade: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: object + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :param provision_after_extensions: Collection of extension names after which this extension + needs to be provisioned. + :type provision_after_extensions: list[str] + """ + + _validation = { + 'id': {'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'}, + 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'properties.publisher', 'type': 'str'}, + 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, + 'type_handler_version': {'key': 'properties.typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'enable_automatic_upgrade': {'key': 'properties.enableAutomaticUpgrade', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': 'object'}, + 'protected_settings': {'key': 'properties.protectedSettings', 'type': 'object'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'provision_after_extensions': {'key': 'properties.provisionAfterExtensions', 'type': '[str]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + force_update_tag: Optional[str] = None, + publisher: Optional[str] = None, + type_properties_type: Optional[str] = None, + type_handler_version: Optional[str] = None, + auto_upgrade_minor_version: Optional[bool] = None, + enable_automatic_upgrade: Optional[bool] = None, + settings: Optional[object] = None, + protected_settings: Optional[object] = None, + provision_after_extensions: Optional[List[str]] = None, + **kwargs + ): + super(VirtualMachineScaleSetExtension, self).__init__(**kwargs) + self.name = name + self.type = None + self.force_update_tag = force_update_tag + self.publisher = publisher + self.type_properties_type = type_properties_type + self.type_handler_version = type_handler_version + self.auto_upgrade_minor_version = auto_upgrade_minor_version + self.enable_automatic_upgrade = enable_automatic_upgrade + self.settings = settings + self.protected_settings = protected_settings + self.provisioning_state = None + self.provision_after_extensions = provision_after_extensions + + +class VirtualMachineScaleSetExtensionListResult(msrest.serialization.Model): + """The List VM scale set extension operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of VM scale set extensions. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetExtension] + :param next_link: The uri to fetch the next page of VM scale set extensions. Call ListNext() + with this to fetch the next page of VM scale set extensions. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualMachineScaleSetExtension]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["VirtualMachineScaleSetExtension"], + next_link: Optional[str] = None, + **kwargs + ): + super(VirtualMachineScaleSetExtensionListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class VirtualMachineScaleSetExtensionProfile(msrest.serialization.Model): + """Describes a virtual machine scale set extension profile. + + :param extensions: The virtual machine scale set child extension resources. + :type extensions: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetExtension] + :param extensions_time_budget: Specifies the time alloted for all extensions to start. The time + duration should be between 15 minutes and 120 minutes (inclusive) and should be specified in + ISO 8601 format. The default value is 90 minutes (PT1H30M). :code:`
    `:code:`
    ` Minimum + api-version: 2020-06-01. + :type extensions_time_budget: str + """ + + _attribute_map = { + 'extensions': {'key': 'extensions', 'type': '[VirtualMachineScaleSetExtension]'}, + 'extensions_time_budget': {'key': 'extensionsTimeBudget', 'type': 'str'}, + } + + def __init__( + self, + *, + extensions: Optional[List["VirtualMachineScaleSetExtension"]] = None, + extensions_time_budget: Optional[str] = None, + **kwargs + ): + super(VirtualMachineScaleSetExtensionProfile, self).__init__(**kwargs) + self.extensions = extensions + self.extensions_time_budget = extensions_time_budget + + +class VirtualMachineScaleSetExtensionUpdate(SubResourceReadOnly): + """Describes a Virtual Machine Scale Set Extension. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: The name of the extension. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param force_update_tag: If a value is provided and is different from the previous value, the + extension handler will be forced to update even if the extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type_properties_type: Specifies the type of the extension; an example is + "CustomScriptExtension". + :type type_properties_type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param auto_upgrade_minor_version: Indicates whether the extension should use a newer minor + version if one is available at deployment time. Once deployed, however, the extension will not + upgrade minor versions unless redeployed, even with this property set to true. + :type auto_upgrade_minor_version: bool + :param enable_automatic_upgrade: Indicates whether the extension should be automatically + upgraded by the platform if there is a newer version of the extension available. + :type enable_automatic_upgrade: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: object + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :param provision_after_extensions: Collection of extension names after which this extension + needs to be provisioned. + :type provision_after_extensions: list[str] + """ + + _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'}, + 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'properties.publisher', 'type': 'str'}, + 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, + 'type_handler_version': {'key': 'properties.typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'enable_automatic_upgrade': {'key': 'properties.enableAutomaticUpgrade', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': 'object'}, + 'protected_settings': {'key': 'properties.protectedSettings', 'type': 'object'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'provision_after_extensions': {'key': 'properties.provisionAfterExtensions', 'type': '[str]'}, + } + + def __init__( + self, + *, + force_update_tag: Optional[str] = None, + publisher: Optional[str] = None, + type_properties_type: Optional[str] = None, + type_handler_version: Optional[str] = None, + auto_upgrade_minor_version: Optional[bool] = None, + enable_automatic_upgrade: Optional[bool] = None, + settings: Optional[object] = None, + protected_settings: Optional[object] = None, + provision_after_extensions: Optional[List[str]] = None, + **kwargs + ): + super(VirtualMachineScaleSetExtensionUpdate, self).__init__(**kwargs) + self.name = None + self.type = None + self.force_update_tag = force_update_tag + self.publisher = publisher + self.type_properties_type = type_properties_type + self.type_handler_version = type_handler_version + self.auto_upgrade_minor_version = auto_upgrade_minor_version + self.enable_automatic_upgrade = enable_automatic_upgrade + self.settings = settings + self.protected_settings = protected_settings + self.provisioning_state = None + self.provision_after_extensions = provision_after_extensions + + +class VirtualMachineScaleSetIdentity(msrest.serialization.Model): + """Identity for the virtual machine scale set. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of virtual machine scale set identity. This property will + only be provided for a system assigned identity. + :vartype principal_id: str + :ivar tenant_id: The tenant id associated with the virtual machine scale set. This property + will only be provided for a system assigned identity. + :vartype tenant_id: str + :param type: The type of identity used for the virtual machine scale set. The type + 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user + assigned identities. The type 'None' will remove any identities from the virtual machine scale + set. Possible values include: "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned", + "None". + :type type: str or ~azure.mgmt.compute.v2020_06_01.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated with the virtual + machine scale set. The user identity dictionary key references will be ARM resource ids in the + form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.compute.v2020_06_01.models.ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "ResourceIdentityType"]] = None, + user_assigned_identities: Optional[Dict[str, "ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, + **kwargs + ): + super(VirtualMachineScaleSetIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + self.user_assigned_identities = user_assigned_identities + + +class VirtualMachineScaleSetInstanceView(msrest.serialization.Model): + """The instance view of a virtual machine scale set. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar virtual_machine: The instance view status summary for the virtual machine scale set. + :vartype virtual_machine: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetInstanceViewStatusesSummary + :ivar extensions: The extensions information. + :vartype extensions: + list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMExtensionsSummary] + :param statuses: The resource status information. + :type statuses: list[~azure.mgmt.compute.v2020_06_01.models.InstanceViewStatus] + :ivar orchestration_services: The orchestration services information. + :vartype orchestration_services: + list[~azure.mgmt.compute.v2020_06_01.models.OrchestrationServiceSummary] + """ + + _validation = { + 'virtual_machine': {'readonly': True}, + 'extensions': {'readonly': True}, + 'orchestration_services': {'readonly': True}, + } + + _attribute_map = { + 'virtual_machine': {'key': 'virtualMachine', 'type': 'VirtualMachineScaleSetInstanceViewStatusesSummary'}, + 'extensions': {'key': 'extensions', 'type': '[VirtualMachineScaleSetVMExtensionsSummary]'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + 'orchestration_services': {'key': 'orchestrationServices', 'type': '[OrchestrationServiceSummary]'}, + } + + def __init__( + self, + *, + statuses: Optional[List["InstanceViewStatus"]] = None, + **kwargs + ): + super(VirtualMachineScaleSetInstanceView, self).__init__(**kwargs) + self.virtual_machine = None + self.extensions = None + self.statuses = statuses + self.orchestration_services = None + + +class VirtualMachineScaleSetInstanceViewStatusesSummary(msrest.serialization.Model): + """Instance view statuses summary for virtual machines of a virtual machine scale set. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar statuses_summary: The extensions information. + :vartype statuses_summary: + list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineStatusCodeCount] + """ + + _validation = { + 'statuses_summary': {'readonly': True}, + } + + _attribute_map = { + 'statuses_summary': {'key': 'statusesSummary', 'type': '[VirtualMachineStatusCodeCount]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetInstanceViewStatusesSummary, self).__init__(**kwargs) + self.statuses_summary = None + + +class VirtualMachineScaleSetIPConfiguration(SubResource): + """Describes a virtual machine scale set network profile's IP configuration. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource Id. + :type id: str + :param name: Required. The IP configuration name. + :type name: str + :param subnet: Specifies the identifier of the subnet. + :type subnet: ~azure.mgmt.compute.v2020_06_01.models.ApiEntityReference + :param primary: Specifies the primary network interface in case the virtual machine has more + than 1 network interface. + :type primary: bool + :param public_ip_address_configuration: The publicIPAddressConfiguration. + :type public_ip_address_configuration: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetPublicIPAddressConfiguration + :param private_ip_address_version: Available from Api-Version 2017-03-30 onwards, it represents + whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible + values are: 'IPv4' and 'IPv6'. Possible values include: "IPv4", "IPv6". + :type private_ip_address_version: str or ~azure.mgmt.compute.v2020_06_01.models.IPVersion + :param application_gateway_backend_address_pools: Specifies an array of references to backend + address pools of application gateways. A scale set can reference backend address pools of + multiple application gateways. Multiple scale sets cannot use the same application gateway. + :type application_gateway_backend_address_pools: + list[~azure.mgmt.compute.v2020_06_01.models.SubResource] + :param application_security_groups: Specifies an array of references to application security + group. + :type application_security_groups: list[~azure.mgmt.compute.v2020_06_01.models.SubResource] + :param load_balancer_backend_address_pools: Specifies an array of references to backend address + pools of load balancers. A scale set can reference backend address pools of one public and one + internal load balancer. Multiple scale sets cannot use the same basic sku load balancer. + :type load_balancer_backend_address_pools: + list[~azure.mgmt.compute.v2020_06_01.models.SubResource] + :param load_balancer_inbound_nat_pools: Specifies an array of references to inbound Nat pools + of the load balancers. A scale set can reference inbound nat pools of one public and one + internal load balancer. Multiple scale sets cannot use the same basic sku load balancer. + :type load_balancer_inbound_nat_pools: list[~azure.mgmt.compute.v2020_06_01.models.SubResource] + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'ApiEntityReference'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'public_ip_address_configuration': {'key': 'properties.publicIPAddressConfiguration', 'type': 'VirtualMachineScaleSetPublicIPAddressConfiguration'}, + 'private_ip_address_version': {'key': 'properties.privateIPAddressVersion', 'type': 'str'}, + 'application_gateway_backend_address_pools': {'key': 'properties.applicationGatewayBackendAddressPools', 'type': '[SubResource]'}, + 'application_security_groups': {'key': 'properties.applicationSecurityGroups', 'type': '[SubResource]'}, + 'load_balancer_backend_address_pools': {'key': 'properties.loadBalancerBackendAddressPools', 'type': '[SubResource]'}, + 'load_balancer_inbound_nat_pools': {'key': 'properties.loadBalancerInboundNatPools', 'type': '[SubResource]'}, + } + + def __init__( + self, + *, + name: str, + id: Optional[str] = None, + subnet: Optional["ApiEntityReference"] = None, + primary: Optional[bool] = None, + public_ip_address_configuration: Optional["VirtualMachineScaleSetPublicIPAddressConfiguration"] = None, + private_ip_address_version: Optional[Union[str, "IPVersion"]] = None, + application_gateway_backend_address_pools: Optional[List["SubResource"]] = None, + application_security_groups: Optional[List["SubResource"]] = None, + load_balancer_backend_address_pools: Optional[List["SubResource"]] = None, + load_balancer_inbound_nat_pools: Optional[List["SubResource"]] = None, + **kwargs + ): + super(VirtualMachineScaleSetIPConfiguration, self).__init__(id=id, **kwargs) + self.name = name + self.subnet = subnet + self.primary = primary + self.public_ip_address_configuration = public_ip_address_configuration + self.private_ip_address_version = private_ip_address_version + self.application_gateway_backend_address_pools = application_gateway_backend_address_pools + self.application_security_groups = application_security_groups + self.load_balancer_backend_address_pools = load_balancer_backend_address_pools + self.load_balancer_inbound_nat_pools = load_balancer_inbound_nat_pools + + +class VirtualMachineScaleSetIpTag(msrest.serialization.Model): + """Contains the IP tag associated with the public IP address. + + :param ip_tag_type: IP tag type. Example: FirstPartyUsage. + :type ip_tag_type: str + :param tag: IP tag associated with the public IP. Example: SQL, Storage etc. + :type tag: str + """ + + _attribute_map = { + 'ip_tag_type': {'key': 'ipTagType', 'type': 'str'}, + 'tag': {'key': 'tag', 'type': 'str'}, + } + + def __init__( + self, + *, + ip_tag_type: Optional[str] = None, + tag: Optional[str] = None, + **kwargs + ): + super(VirtualMachineScaleSetIpTag, self).__init__(**kwargs) + self.ip_tag_type = ip_tag_type + self.tag = tag + + +class VirtualMachineScaleSetListOSUpgradeHistory(msrest.serialization.Model): + """List of Virtual Machine Scale Set OS Upgrade History operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of OS upgrades performed on the virtual machine scale set. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.UpgradeOperationHistoricalStatusInfo] + :param next_link: The uri to fetch the next page of OS Upgrade History. Call ListNext() with + this to fetch the next page of history of upgrades. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[UpgradeOperationHistoricalStatusInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["UpgradeOperationHistoricalStatusInfo"], + next_link: Optional[str] = None, + **kwargs + ): + super(VirtualMachineScaleSetListOSUpgradeHistory, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class VirtualMachineScaleSetListResult(msrest.serialization.Model): + """The List Virtual Machine operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of virtual machine scale sets. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSet] + :param next_link: The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() + with this to fetch the next page of VMSS. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualMachineScaleSet]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["VirtualMachineScaleSet"], + next_link: Optional[str] = None, + **kwargs + ): + super(VirtualMachineScaleSetListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class VirtualMachineScaleSetListSkusResult(msrest.serialization.Model): + """The Virtual Machine Scale Set List Skus operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of skus available for the virtual machine scale set. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetSku] + :param next_link: The uri to fetch the next page of Virtual Machine Scale Set Skus. Call + ListNext() with this to fetch the next page of VMSS Skus. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualMachineScaleSetSku]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["VirtualMachineScaleSetSku"], + next_link: Optional[str] = None, + **kwargs + ): + super(VirtualMachineScaleSetListSkusResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class VirtualMachineScaleSetListWithLinkResult(msrest.serialization.Model): + """The List Virtual Machine operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of virtual machine scale sets. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSet] + :param next_link: The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() + with this to fetch the next page of Virtual Machine Scale Sets. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualMachineScaleSet]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["VirtualMachineScaleSet"], + next_link: Optional[str] = None, + **kwargs + ): + super(VirtualMachineScaleSetListWithLinkResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class VirtualMachineScaleSetManagedDiskParameters(msrest.serialization.Model): + """Describes the parameters of a ScaleSet managed disk. + + :param storage_account_type: Specifies the storage account type for the managed disk. NOTE: + UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values + include: "Standard_LRS", "Premium_LRS", "StandardSSD_LRS", "UltraSSD_LRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2020_06_01.models.StorageAccountTypes + :param disk_encryption_set: Specifies the customer managed disk encryption set resource id for + the managed disk. + :type disk_encryption_set: ~azure.mgmt.compute.v2020_06_01.models.SubResource + """ + + _attribute_map = { + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'disk_encryption_set': {'key': 'diskEncryptionSet', 'type': 'SubResource'}, + } + + def __init__( + self, + *, + storage_account_type: Optional[Union[str, "StorageAccountTypes"]] = None, + disk_encryption_set: Optional["SubResource"] = None, + **kwargs + ): + super(VirtualMachineScaleSetManagedDiskParameters, self).__init__(**kwargs) + self.storage_account_type = storage_account_type + self.disk_encryption_set = disk_encryption_set + + +class VirtualMachineScaleSetNetworkConfiguration(SubResource): + """Describes a virtual machine scale set network profile's network configurations. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource Id. + :type id: str + :param name: Required. The network configuration name. + :type name: str + :param primary: Specifies the primary network interface in case the virtual machine has more + than 1 network interface. + :type primary: bool + :param enable_accelerated_networking: Specifies whether the network interface is accelerated + networking-enabled. + :type enable_accelerated_networking: 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. + :type dns_settings: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetNetworkConfigurationDnsSettings + :param ip_configurations: Specifies the IP configurations of the network interface. + :type ip_configurations: + list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetIPConfiguration] + :param enable_ip_forwarding: Whether IP forwarding enabled on this NIC. + :type enable_ip_forwarding: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'enable_accelerated_networking': {'key': 'properties.enableAcceleratedNetworking', 'type': 'bool'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'SubResource'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'VirtualMachineScaleSetNetworkConfigurationDnsSettings'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualMachineScaleSetIPConfiguration]'}, + 'enable_ip_forwarding': {'key': 'properties.enableIPForwarding', 'type': 'bool'}, + } + + def __init__( + self, + *, + name: str, + id: Optional[str] = None, + primary: Optional[bool] = None, + enable_accelerated_networking: Optional[bool] = None, + network_security_group: Optional["SubResource"] = None, + dns_settings: Optional["VirtualMachineScaleSetNetworkConfigurationDnsSettings"] = None, + ip_configurations: Optional[List["VirtualMachineScaleSetIPConfiguration"]] = None, + enable_ip_forwarding: Optional[bool] = None, + **kwargs + ): + super(VirtualMachineScaleSetNetworkConfiguration, self).__init__(id=id, **kwargs) + self.name = name + self.primary = primary + self.enable_accelerated_networking = enable_accelerated_networking + self.network_security_group = network_security_group + self.dns_settings = dns_settings + self.ip_configurations = ip_configurations + self.enable_ip_forwarding = enable_ip_forwarding + + +class VirtualMachineScaleSetNetworkConfigurationDnsSettings(msrest.serialization.Model): + """Describes a virtual machines scale sets network configuration's DNS settings. + + :param dns_servers: List of DNS servers IP addresses. + :type dns_servers: list[str] + """ + + _attribute_map = { + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + } + + def __init__( + self, + *, + dns_servers: Optional[List[str]] = None, + **kwargs + ): + super(VirtualMachineScaleSetNetworkConfigurationDnsSettings, self).__init__(**kwargs) + self.dns_servers = dns_servers + + +class VirtualMachineScaleSetNetworkProfile(msrest.serialization.Model): + """Describes a virtual machine scale set network profile. + + :param health_probe: A reference to a load balancer probe used to determine the health of an + instance in the virtual machine scale set. The reference will be in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + :type health_probe: ~azure.mgmt.compute.v2020_06_01.models.ApiEntityReference + :param network_interface_configurations: The list of network configurations. + :type network_interface_configurations: + list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetNetworkConfiguration] + """ + + _attribute_map = { + 'health_probe': {'key': 'healthProbe', 'type': 'ApiEntityReference'}, + 'network_interface_configurations': {'key': 'networkInterfaceConfigurations', 'type': '[VirtualMachineScaleSetNetworkConfiguration]'}, + } + + def __init__( + self, + *, + health_probe: Optional["ApiEntityReference"] = None, + network_interface_configurations: Optional[List["VirtualMachineScaleSetNetworkConfiguration"]] = None, + **kwargs + ): + super(VirtualMachineScaleSetNetworkProfile, self).__init__(**kwargs) + self.health_probe = health_probe + self.network_interface_configurations = network_interface_configurations + + +class VirtualMachineScaleSetOSDisk(msrest.serialization.Model): + """Describes a virtual machine scale set operating system disk. + + All required parameters must be populated in order to send to Azure. + + :param name: The disk name. + :type name: str + :param caching: Specifies the caching requirements. :code:`
    `:code:`
    ` Possible values + are: :code:`
    `:code:`
    ` **None** :code:`
    `:code:`
    ` **ReadOnly** + :code:`
    `:code:`
    ` **ReadWrite** :code:`
    `:code:`
    ` Default: **None for Standard + storage. ReadOnly for Premium storage**. Possible values include: "None", "ReadOnly", + "ReadWrite". + :type caching: str or ~azure.mgmt.compute.v2020_06_01.models.CachingTypes + :param write_accelerator_enabled: Specifies whether writeAccelerator should be enabled or + disabled on the disk. + :type write_accelerator_enabled: bool + :param create_option: Required. Specifies how the virtual machines in the scale set should be + created.:code:`
    `:code:`
    ` The only allowed value is: **FromImage** \u2013 This value is + used when you are using an image to create the virtual machine. If you are using a platform + image, you also use the imageReference element described above. If you are using a marketplace + image, you also use the plan element previously described. Possible values include: + "FromImage", "Empty", "Attach". + :type create_option: str or ~azure.mgmt.compute.v2020_06_01.models.DiskCreateOptionTypes + :param diff_disk_settings: Specifies the ephemeral disk Settings for the operating system disk + used by the virtual machine scale set. + :type diff_disk_settings: ~azure.mgmt.compute.v2020_06_01.models.DiffDiskSettings + :param disk_size_gb: Specifies the size of the operating system disk in gigabytes. This element + can be used to overwrite the size of the disk in a virtual machine image. + :code:`
    `:code:`
    ` This value cannot be larger than 1023 GB. + :type disk_size_gb: int + :param os_type: This property allows you to specify the type of the OS that is included in the + disk if creating a VM from user-image or a specialized VHD. :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_06_01.models.OperatingSystemTypes + :param image: Specifies information about the unmanaged user image to base the scale set on. + :type image: ~azure.mgmt.compute.v2020_06_01.models.VirtualHardDisk + :param vhd_containers: Specifies the container urls that are used to store operating system + disks for the scale set. + :type vhd_containers: list[str] + :param managed_disk: The managed disk parameters. + :type managed_disk: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetManagedDiskParameters + """ + + _validation = { + 'create_option': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'caching': {'key': 'caching', 'type': 'str'}, + 'write_accelerator_enabled': {'key': 'writeAcceleratorEnabled', 'type': 'bool'}, + 'create_option': {'key': 'createOption', 'type': 'str'}, + 'diff_disk_settings': {'key': 'diffDiskSettings', 'type': 'DiffDiskSettings'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'VirtualHardDisk'}, + 'vhd_containers': {'key': 'vhdContainers', 'type': '[str]'}, + 'managed_disk': {'key': 'managedDisk', 'type': 'VirtualMachineScaleSetManagedDiskParameters'}, + } + + def __init__( + self, + *, + create_option: Union[str, "DiskCreateOptionTypes"], + name: Optional[str] = None, + caching: Optional[Union[str, "CachingTypes"]] = None, + write_accelerator_enabled: Optional[bool] = None, + diff_disk_settings: Optional["DiffDiskSettings"] = None, + disk_size_gb: Optional[int] = None, + os_type: Optional[Union[str, "OperatingSystemTypes"]] = None, + image: Optional["VirtualHardDisk"] = None, + vhd_containers: Optional[List[str]] = None, + managed_disk: Optional["VirtualMachineScaleSetManagedDiskParameters"] = None, + **kwargs + ): + super(VirtualMachineScaleSetOSDisk, self).__init__(**kwargs) + self.name = name + self.caching = caching + self.write_accelerator_enabled = write_accelerator_enabled + self.create_option = create_option + self.diff_disk_settings = diff_disk_settings + self.disk_size_gb = disk_size_gb + self.os_type = os_type + self.image = image + self.vhd_containers = vhd_containers + self.managed_disk = managed_disk + + +class VirtualMachineScaleSetOSProfile(msrest.serialization.Model): + """Describes a virtual machine scale set OS profile. + + :param computer_name_prefix: Specifies the computer name prefix for all of the virtual machines + in the scale set. Computer name prefixes must be 1 to 15 characters long. + :type computer_name_prefix: str + :param admin_username: Specifies the name of the administrator account. + :code:`
    `:code:`
    ` **Windows-only restriction:** Cannot end in "." + :code:`
    `:code:`
    ` **Disallowed values:** "administrator", "admin", "user", "user1", + "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", + "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", + "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". + :code:`
    `:code:`
    ` **Minimum-length (Linux):** 1 character :code:`
    `:code:`
    ` + **Max-length (Linux):** 64 characters :code:`
    `:code:`
    ` **Max-length (Windows):** 20 + characters :code:`
    `:code:`
    `:code:`
  • ` For root access to the Linux VM, see `Using + root privileges on Linux virtual machines in Azure `_\ :code:`
    `:code:`
  • ` For a list of built-in system users on + Linux that should not be used in this field, see `Selecting User Names for Linux on Azure + `_. + :type admin_username: str + :param admin_password: Specifies the password of the administrator account. + :code:`
    `:code:`
    ` **Minimum-length (Windows):** 8 characters :code:`
    `:code:`
    ` + **Minimum-length (Linux):** 6 characters :code:`
    `:code:`
    ` **Max-length (Windows):** 123 + characters :code:`
    `:code:`
    ` **Max-length (Linux):** 72 characters + :code:`
    `:code:`
    ` **Complexity requirements:** 3 out of 4 conditions below need to be + fulfilled :code:`
    ` Has lower characters :code:`
    `Has upper characters :code:`
    ` Has a + digit :code:`
    ` Has a special character (Regex match [\W_]) :code:`
    `:code:`
    ` + **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", + "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" :code:`
    `:code:`
    ` For + resetting the password, see `How to reset the Remote Desktop service or its login password in a + Windows VM `_ :code:`
    `:code:`
    ` For + resetting root password, see `Manage users, SSH, and check or repair disks on Azure Linux VMs + using the VMAccess Extension `_. + :type admin_password: str + :param custom_data: Specifies a base-64 encoded string of custom data. The base-64 encoded + string is decoded to a binary array that is saved as a file on the Virtual Machine. The maximum + length of the binary array is 65535 bytes. :code:`
    `:code:`
    ` For using cloud-init for + your VM, see `Using cloud-init to customize a Linux VM during creation + `_. + :type custom_data: str + :param windows_configuration: Specifies Windows operating system settings on the virtual + machine. + :type windows_configuration: ~azure.mgmt.compute.v2020_06_01.models.WindowsConfiguration + :param linux_configuration: Specifies the Linux operating system settings on the virtual + machine. :code:`
    `:code:`
    `For a list of supported Linux distributions, see `Linux on + Azure-Endorsed Distributions `_ + :code:`
    `:code:`
    ` For running non-endorsed distributions, see `Information for Non- + Endorsed Distributions `_. + :type linux_configuration: ~azure.mgmt.compute.v2020_06_01.models.LinuxConfiguration + :param secrets: Specifies set of certificates that should be installed onto the virtual + machines in the scale set. + :type secrets: list[~azure.mgmt.compute.v2020_06_01.models.VaultSecretGroup] + """ + + _attribute_map = { + 'computer_name_prefix': {'key': 'computerNamePrefix', 'type': 'str'}, + 'admin_username': {'key': 'adminUsername', 'type': 'str'}, + 'admin_password': {'key': 'adminPassword', 'type': 'str'}, + 'custom_data': {'key': 'customData', 'type': 'str'}, + 'windows_configuration': {'key': 'windowsConfiguration', 'type': 'WindowsConfiguration'}, + 'linux_configuration': {'key': 'linuxConfiguration', 'type': 'LinuxConfiguration'}, + 'secrets': {'key': 'secrets', 'type': '[VaultSecretGroup]'}, + } + + def __init__( + self, + *, + computer_name_prefix: Optional[str] = None, + admin_username: Optional[str] = None, + admin_password: Optional[str] = None, + custom_data: Optional[str] = None, + windows_configuration: Optional["WindowsConfiguration"] = None, + linux_configuration: Optional["LinuxConfiguration"] = None, + secrets: Optional[List["VaultSecretGroup"]] = None, + **kwargs + ): + super(VirtualMachineScaleSetOSProfile, self).__init__(**kwargs) + self.computer_name_prefix = computer_name_prefix + self.admin_username = admin_username + self.admin_password = admin_password + self.custom_data = custom_data + self.windows_configuration = windows_configuration + self.linux_configuration = linux_configuration + self.secrets = secrets + + +class VirtualMachineScaleSetPublicIPAddressConfiguration(msrest.serialization.Model): + """Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The publicIP address configuration name. + :type name: str + :param idle_timeout_in_minutes: The idle timeout of the public IP address. + :type idle_timeout_in_minutes: int + :param dns_settings: The dns settings to be applied on the publicIP addresses . + :type dns_settings: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings + :param ip_tags: The list of IP tags associated with the public IP address. + :type ip_tags: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetIpTag] + :param public_ip_prefix: The PublicIPPrefix from which to allocate publicIP addresses. + :type public_ip_prefix: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param public_ip_address_version: Available from Api-Version 2019-07-01 onwards, it represents + whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values + are: 'IPv4' and 'IPv6'. Possible values include: "IPv4", "IPv6". + :type public_ip_address_version: str or ~azure.mgmt.compute.v2020_06_01.models.IPVersion + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings'}, + 'ip_tags': {'key': 'properties.ipTags', 'type': '[VirtualMachineScaleSetIpTag]'}, + 'public_ip_prefix': {'key': 'properties.publicIPPrefix', 'type': 'SubResource'}, + 'public_ip_address_version': {'key': 'properties.publicIPAddressVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + idle_timeout_in_minutes: Optional[int] = None, + dns_settings: Optional["VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings"] = None, + ip_tags: Optional[List["VirtualMachineScaleSetIpTag"]] = None, + public_ip_prefix: Optional["SubResource"] = None, + public_ip_address_version: Optional[Union[str, "IPVersion"]] = None, + **kwargs + ): + super(VirtualMachineScaleSetPublicIPAddressConfiguration, self).__init__(**kwargs) + self.name = name + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.dns_settings = dns_settings + self.ip_tags = ip_tags + self.public_ip_prefix = public_ip_prefix + self.public_ip_address_version = public_ip_address_version + + +class VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings(msrest.serialization.Model): + """Describes a virtual machines scale sets network configuration's DNS settings. + + All required parameters must be populated in order to send to Azure. + + :param domain_name_label: Required. The Domain name label.The concatenation of the domain name + label and vm index will be the domain name labels of the PublicIPAddress resources that will be + created. + :type domain_name_label: str + """ + + _validation = { + 'domain_name_label': {'required': True}, + } + + _attribute_map = { + 'domain_name_label': {'key': 'domainNameLabel', 'type': 'str'}, + } + + def __init__( + self, + *, + domain_name_label: str, + **kwargs + ): + super(VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings, self).__init__(**kwargs) + self.domain_name_label = domain_name_label + + +class VirtualMachineScaleSetReimageParameters(VirtualMachineReimageParameters): + """Describes a Virtual Machine Scale Set VM Reimage Parameters. + + :param temp_disk: Specifies whether to reimage temp disk. Default value: false. Note: This temp + disk reimage parameter is only supported for VM/VMSS with Ephemeral OS disk. + :type temp_disk: bool + :param instance_ids: The virtual machine scale set instance ids. Omitting the virtual machine + scale set instance ids will result in the operation being performed on all virtual machines in + the virtual machine scale set. + :type instance_ids: list[str] + """ + + _attribute_map = { + 'temp_disk': {'key': 'tempDisk', 'type': 'bool'}, + 'instance_ids': {'key': 'instanceIds', 'type': '[str]'}, + } + + def __init__( + self, + *, + temp_disk: Optional[bool] = None, + instance_ids: Optional[List[str]] = None, + **kwargs + ): + super(VirtualMachineScaleSetReimageParameters, self).__init__(temp_disk=temp_disk, **kwargs) + self.instance_ids = instance_ids + + +class VirtualMachineScaleSetSku(msrest.serialization.Model): + """Describes an available virtual machine scale set sku. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar resource_type: The type of resource the sku applies to. + :vartype resource_type: str + :ivar sku: The Sku. + :vartype sku: ~azure.mgmt.compute.v2020_06_01.models.Sku + :ivar capacity: Specifies the number of virtual machines in the scale set. + :vartype capacity: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetSkuCapacity + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'sku': {'readonly': True}, + 'capacity': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'capacity': {'key': 'capacity', 'type': 'VirtualMachineScaleSetSkuCapacity'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetSku, self).__init__(**kwargs) + self.resource_type = None + self.sku = None + self.capacity = None + + +class VirtualMachineScaleSetSkuCapacity(msrest.serialization.Model): + """Describes scaling information of a sku. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar minimum: The minimum capacity. + :vartype minimum: long + :ivar maximum: The maximum capacity that can be set. + :vartype maximum: long + :ivar default_capacity: The default capacity. + :vartype default_capacity: long + :ivar scale_type: The scale type applicable to the sku. Possible values include: "Automatic", + "None". + :vartype scale_type: str or + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetSkuScaleType + """ + + _validation = { + 'minimum': {'readonly': True}, + 'maximum': {'readonly': True}, + 'default_capacity': {'readonly': True}, + 'scale_type': {'readonly': True}, + } + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'long'}, + 'maximum': {'key': 'maximum', 'type': 'long'}, + 'default_capacity': {'key': 'defaultCapacity', 'type': 'long'}, + 'scale_type': {'key': 'scaleType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetSkuCapacity, self).__init__(**kwargs) + self.minimum = None + self.maximum = None + self.default_capacity = None + self.scale_type = None + + +class VirtualMachineScaleSetStorageProfile(msrest.serialization.Model): + """Describes a virtual machine scale set storage profile. + + :param image_reference: Specifies information about the image to use. You can specify + information about platform images, marketplace images, or virtual machine images. This element + is required when you want to use a platform image, marketplace image, or virtual machine image, + but is not used in other creation operations. + :type image_reference: ~azure.mgmt.compute.v2020_06_01.models.ImageReference + :param os_disk: Specifies information about the operating system disk used by the virtual + machines in the scale set. :code:`
    `:code:`
    ` For more information about disks, see + `About disks and VHDs for Azure virtual machines `_. + :type os_disk: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetOSDisk + :param data_disks: Specifies the parameters that are used to add data disks to the virtual + machines in the scale set. :code:`
    `:code:`
    ` For more information about disks, see + `About disks and VHDs for Azure virtual machines `_. + :type data_disks: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetDataDisk] + """ + + _attribute_map = { + 'image_reference': {'key': 'imageReference', 'type': 'ImageReference'}, + 'os_disk': {'key': 'osDisk', 'type': 'VirtualMachineScaleSetOSDisk'}, + 'data_disks': {'key': 'dataDisks', 'type': '[VirtualMachineScaleSetDataDisk]'}, + } + + def __init__( + self, + *, + image_reference: Optional["ImageReference"] = None, + os_disk: Optional["VirtualMachineScaleSetOSDisk"] = None, + data_disks: Optional[List["VirtualMachineScaleSetDataDisk"]] = None, + **kwargs + ): + super(VirtualMachineScaleSetStorageProfile, self).__init__(**kwargs) + self.image_reference = image_reference + self.os_disk = os_disk + self.data_disks = data_disks + + +class VirtualMachineScaleSetUpdate(UpdateResource): + """Describes a Virtual Machine Scale Set. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param sku: The virtual machine scale set sku. + :type sku: ~azure.mgmt.compute.v2020_06_01.models.Sku + :param plan: The purchase plan when deploying a virtual machine scale set from VM Marketplace + images. + :type plan: ~azure.mgmt.compute.v2020_06_01.models.Plan + :param identity: The identity of the virtual machine scale set, if configured. + :type identity: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetIdentity + :param upgrade_policy: The upgrade policy. + :type upgrade_policy: ~azure.mgmt.compute.v2020_06_01.models.UpgradePolicy + :param automatic_repairs_policy: Policy for automatic repairs. + :type automatic_repairs_policy: ~azure.mgmt.compute.v2020_06_01.models.AutomaticRepairsPolicy + :param virtual_machine_profile: The virtual machine profile. + :type virtual_machine_profile: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetUpdateVMProfile + :param overprovision: Specifies whether the Virtual Machine Scale Set should be + overprovisioned. + :type overprovision: bool + :param do_not_run_extensions_on_overprovisioned_v_ms: When Overprovision is enabled, extensions + are launched only on the requested number of VMs which are finally kept. This property will + hence ensure that the extensions do not run on the extra overprovisioned VMs. + :type do_not_run_extensions_on_overprovisioned_v_ms: bool + :param single_placement_group: When true this limits the scale set to a single placement group, + of max size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to + false. However, if singlePlacementGroup is false, it may not be modified to true. + :type single_placement_group: bool + :param additional_capabilities: Specifies additional capabilities enabled or disabled on the + Virtual Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines + have the capability to support attaching managed data disks with UltraSSD_LRS storage account + type. + :type additional_capabilities: ~azure.mgmt.compute.v2020_06_01.models.AdditionalCapabilities + :param scale_in_policy: Specifies the scale-in policy that decides which virtual machines are + chosen for removal when a Virtual Machine Scale Set is scaled-in. + :type scale_in_policy: ~azure.mgmt.compute.v2020_06_01.models.ScaleInPolicy + :param proximity_placement_group: Specifies information about the proximity placement group + that the virtual machine scale set should be assigned to. :code:`
    `:code:`
    `Minimum api- + version: 2018-04-01. + :type proximity_placement_group: ~azure.mgmt.compute.v2020_06_01.models.SubResource + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'identity': {'key': 'identity', 'type': 'VirtualMachineScaleSetIdentity'}, + 'upgrade_policy': {'key': 'properties.upgradePolicy', 'type': 'UpgradePolicy'}, + 'automatic_repairs_policy': {'key': 'properties.automaticRepairsPolicy', 'type': 'AutomaticRepairsPolicy'}, + 'virtual_machine_profile': {'key': 'properties.virtualMachineProfile', 'type': 'VirtualMachineScaleSetUpdateVMProfile'}, + 'overprovision': {'key': 'properties.overprovision', 'type': 'bool'}, + 'do_not_run_extensions_on_overprovisioned_v_ms': {'key': 'properties.doNotRunExtensionsOnOverprovisionedVMs', 'type': 'bool'}, + 'single_placement_group': {'key': 'properties.singlePlacementGroup', 'type': 'bool'}, + 'additional_capabilities': {'key': 'properties.additionalCapabilities', 'type': 'AdditionalCapabilities'}, + 'scale_in_policy': {'key': 'properties.scaleInPolicy', 'type': 'ScaleInPolicy'}, + 'proximity_placement_group': {'key': 'properties.proximityPlacementGroup', 'type': 'SubResource'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + sku: Optional["Sku"] = None, + plan: Optional["Plan"] = None, + identity: Optional["VirtualMachineScaleSetIdentity"] = None, + upgrade_policy: Optional["UpgradePolicy"] = None, + automatic_repairs_policy: Optional["AutomaticRepairsPolicy"] = None, + virtual_machine_profile: Optional["VirtualMachineScaleSetUpdateVMProfile"] = None, + overprovision: Optional[bool] = None, + do_not_run_extensions_on_overprovisioned_v_ms: Optional[bool] = None, + single_placement_group: Optional[bool] = None, + additional_capabilities: Optional["AdditionalCapabilities"] = None, + scale_in_policy: Optional["ScaleInPolicy"] = None, + proximity_placement_group: Optional["SubResource"] = None, + **kwargs + ): + super(VirtualMachineScaleSetUpdate, self).__init__(tags=tags, **kwargs) + self.sku = sku + self.plan = plan + self.identity = identity + self.upgrade_policy = upgrade_policy + self.automatic_repairs_policy = automatic_repairs_policy + self.virtual_machine_profile = virtual_machine_profile + self.overprovision = overprovision + self.do_not_run_extensions_on_overprovisioned_v_ms = do_not_run_extensions_on_overprovisioned_v_ms + self.single_placement_group = single_placement_group + self.additional_capabilities = additional_capabilities + self.scale_in_policy = scale_in_policy + self.proximity_placement_group = proximity_placement_group + + +class VirtualMachineScaleSetUpdateIPConfiguration(SubResource): + """Describes a virtual machine scale set network profile's IP configuration. NOTE: The subnet of a scale set may be modified as long as the original subnet and the new subnet are in the same virtual network. + + :param id: Resource Id. + :type id: str + :param name: The IP configuration name. + :type name: str + :param subnet: The subnet. + :type subnet: ~azure.mgmt.compute.v2020_06_01.models.ApiEntityReference + :param primary: Specifies the primary IP Configuration in case the network interface has more + than one IP Configuration. + :type primary: bool + :param public_ip_address_configuration: The publicIPAddressConfiguration. + :type public_ip_address_configuration: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetUpdatePublicIPAddressConfiguration + :param private_ip_address_version: Available from Api-Version 2017-03-30 onwards, it represents + whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible + values are: 'IPv4' and 'IPv6'. Possible values include: "IPv4", "IPv6". + :type private_ip_address_version: str or ~azure.mgmt.compute.v2020_06_01.models.IPVersion + :param application_gateway_backend_address_pools: The application gateway backend address + pools. + :type application_gateway_backend_address_pools: + list[~azure.mgmt.compute.v2020_06_01.models.SubResource] + :param application_security_groups: Specifies an array of references to application security + group. + :type application_security_groups: list[~azure.mgmt.compute.v2020_06_01.models.SubResource] + :param load_balancer_backend_address_pools: The load balancer backend address pools. + :type load_balancer_backend_address_pools: + list[~azure.mgmt.compute.v2020_06_01.models.SubResource] + :param load_balancer_inbound_nat_pools: The load balancer inbound nat pools. + :type load_balancer_inbound_nat_pools: list[~azure.mgmt.compute.v2020_06_01.models.SubResource] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'ApiEntityReference'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'public_ip_address_configuration': {'key': 'properties.publicIPAddressConfiguration', 'type': 'VirtualMachineScaleSetUpdatePublicIPAddressConfiguration'}, + 'private_ip_address_version': {'key': 'properties.privateIPAddressVersion', 'type': 'str'}, + 'application_gateway_backend_address_pools': {'key': 'properties.applicationGatewayBackendAddressPools', 'type': '[SubResource]'}, + 'application_security_groups': {'key': 'properties.applicationSecurityGroups', 'type': '[SubResource]'}, + 'load_balancer_backend_address_pools': {'key': 'properties.loadBalancerBackendAddressPools', 'type': '[SubResource]'}, + 'load_balancer_inbound_nat_pools': {'key': 'properties.loadBalancerInboundNatPools', 'type': '[SubResource]'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + subnet: Optional["ApiEntityReference"] = None, + primary: Optional[bool] = None, + public_ip_address_configuration: Optional["VirtualMachineScaleSetUpdatePublicIPAddressConfiguration"] = None, + private_ip_address_version: Optional[Union[str, "IPVersion"]] = None, + application_gateway_backend_address_pools: Optional[List["SubResource"]] = None, + application_security_groups: Optional[List["SubResource"]] = None, + load_balancer_backend_address_pools: Optional[List["SubResource"]] = None, + load_balancer_inbound_nat_pools: Optional[List["SubResource"]] = None, + **kwargs + ): + super(VirtualMachineScaleSetUpdateIPConfiguration, self).__init__(id=id, **kwargs) + self.name = name + self.subnet = subnet + self.primary = primary + self.public_ip_address_configuration = public_ip_address_configuration + self.private_ip_address_version = private_ip_address_version + self.application_gateway_backend_address_pools = application_gateway_backend_address_pools + self.application_security_groups = application_security_groups + self.load_balancer_backend_address_pools = load_balancer_backend_address_pools + self.load_balancer_inbound_nat_pools = load_balancer_inbound_nat_pools + + +class VirtualMachineScaleSetUpdateNetworkConfiguration(SubResource): + """Describes a virtual machine scale set network profile's network configurations. + + :param id: Resource Id. + :type id: str + :param name: The network configuration name. + :type name: str + :param primary: Whether this is a primary NIC on a virtual machine. + :type primary: bool + :param enable_accelerated_networking: Specifies whether the network interface is accelerated + networking-enabled. + :type enable_accelerated_networking: 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. + :type dns_settings: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetNetworkConfigurationDnsSettings + :param ip_configurations: The virtual machine scale set IP Configuration. + :type ip_configurations: + list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetUpdateIPConfiguration] + :param enable_ip_forwarding: Whether IP forwarding enabled on this NIC. + :type enable_ip_forwarding: bool + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'enable_accelerated_networking': {'key': 'properties.enableAcceleratedNetworking', 'type': 'bool'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'SubResource'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'VirtualMachineScaleSetNetworkConfigurationDnsSettings'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualMachineScaleSetUpdateIPConfiguration]'}, + 'enable_ip_forwarding': {'key': 'properties.enableIPForwarding', 'type': 'bool'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + primary: Optional[bool] = None, + enable_accelerated_networking: Optional[bool] = None, + network_security_group: Optional["SubResource"] = None, + dns_settings: Optional["VirtualMachineScaleSetNetworkConfigurationDnsSettings"] = None, + ip_configurations: Optional[List["VirtualMachineScaleSetUpdateIPConfiguration"]] = None, + enable_ip_forwarding: Optional[bool] = None, + **kwargs + ): + super(VirtualMachineScaleSetUpdateNetworkConfiguration, self).__init__(id=id, **kwargs) + self.name = name + self.primary = primary + self.enable_accelerated_networking = enable_accelerated_networking + self.network_security_group = network_security_group + self.dns_settings = dns_settings + self.ip_configurations = ip_configurations + self.enable_ip_forwarding = enable_ip_forwarding + + +class VirtualMachineScaleSetUpdateNetworkProfile(msrest.serialization.Model): + """Describes a virtual machine scale set network profile. + + :param health_probe: A reference to a load balancer probe used to determine the health of an + instance in the virtual machine scale set. The reference will be in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + :type health_probe: ~azure.mgmt.compute.v2020_06_01.models.ApiEntityReference + :param network_interface_configurations: The list of network configurations. + :type network_interface_configurations: + list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetUpdateNetworkConfiguration] + """ + + _attribute_map = { + 'health_probe': {'key': 'healthProbe', 'type': 'ApiEntityReference'}, + 'network_interface_configurations': {'key': 'networkInterfaceConfigurations', 'type': '[VirtualMachineScaleSetUpdateNetworkConfiguration]'}, + } + + def __init__( + self, + *, + health_probe: Optional["ApiEntityReference"] = None, + network_interface_configurations: Optional[List["VirtualMachineScaleSetUpdateNetworkConfiguration"]] = None, + **kwargs + ): + super(VirtualMachineScaleSetUpdateNetworkProfile, self).__init__(**kwargs) + self.health_probe = health_probe + self.network_interface_configurations = network_interface_configurations + + +class VirtualMachineScaleSetUpdateOSDisk(msrest.serialization.Model): + """Describes virtual machine scale set operating system disk Update Object. This should be used for Updating VMSS OS Disk. + + :param caching: The caching type. Possible values include: "None", "ReadOnly", "ReadWrite". + :type caching: str or ~azure.mgmt.compute.v2020_06_01.models.CachingTypes + :param write_accelerator_enabled: Specifies whether writeAccelerator should be enabled or + disabled on the disk. + :type write_accelerator_enabled: bool + :param disk_size_gb: Specifies the size of the operating system disk in gigabytes. This element + can be used to overwrite the size of the disk in a virtual machine image. + :code:`
    `:code:`
    ` This value cannot be larger than 1023 GB. + :type disk_size_gb: int + :param image: The Source User Image VirtualHardDisk. This VirtualHardDisk will be copied before + using it to attach to the Virtual Machine. If SourceImage is provided, the destination + VirtualHardDisk should not exist. + :type image: ~azure.mgmt.compute.v2020_06_01.models.VirtualHardDisk + :param vhd_containers: The list of virtual hard disk container uris. + :type vhd_containers: list[str] + :param managed_disk: The managed disk parameters. + :type managed_disk: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetManagedDiskParameters + """ + + _attribute_map = { + 'caching': {'key': 'caching', 'type': 'str'}, + 'write_accelerator_enabled': {'key': 'writeAcceleratorEnabled', 'type': 'bool'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + 'image': {'key': 'image', 'type': 'VirtualHardDisk'}, + 'vhd_containers': {'key': 'vhdContainers', 'type': '[str]'}, + 'managed_disk': {'key': 'managedDisk', 'type': 'VirtualMachineScaleSetManagedDiskParameters'}, + } + + def __init__( + self, + *, + caching: Optional[Union[str, "CachingTypes"]] = None, + write_accelerator_enabled: Optional[bool] = None, + disk_size_gb: Optional[int] = None, + image: Optional["VirtualHardDisk"] = None, + vhd_containers: Optional[List[str]] = None, + managed_disk: Optional["VirtualMachineScaleSetManagedDiskParameters"] = None, + **kwargs + ): + super(VirtualMachineScaleSetUpdateOSDisk, self).__init__(**kwargs) + self.caching = caching + self.write_accelerator_enabled = write_accelerator_enabled + self.disk_size_gb = disk_size_gb + self.image = image + self.vhd_containers = vhd_containers + self.managed_disk = managed_disk + + +class VirtualMachineScaleSetUpdateOSProfile(msrest.serialization.Model): + """Describes a virtual machine scale set OS profile. + + :param custom_data: A base-64 encoded string of custom data. + :type custom_data: str + :param windows_configuration: The Windows Configuration of the OS profile. + :type windows_configuration: ~azure.mgmt.compute.v2020_06_01.models.WindowsConfiguration + :param linux_configuration: The Linux Configuration of the OS profile. + :type linux_configuration: ~azure.mgmt.compute.v2020_06_01.models.LinuxConfiguration + :param secrets: The List of certificates for addition to the VM. + :type secrets: list[~azure.mgmt.compute.v2020_06_01.models.VaultSecretGroup] + """ + + _attribute_map = { + 'custom_data': {'key': 'customData', 'type': 'str'}, + 'windows_configuration': {'key': 'windowsConfiguration', 'type': 'WindowsConfiguration'}, + 'linux_configuration': {'key': 'linuxConfiguration', 'type': 'LinuxConfiguration'}, + 'secrets': {'key': 'secrets', 'type': '[VaultSecretGroup]'}, + } + + def __init__( + self, + *, + custom_data: Optional[str] = None, + windows_configuration: Optional["WindowsConfiguration"] = None, + linux_configuration: Optional["LinuxConfiguration"] = None, + secrets: Optional[List["VaultSecretGroup"]] = None, + **kwargs + ): + super(VirtualMachineScaleSetUpdateOSProfile, self).__init__(**kwargs) + self.custom_data = custom_data + self.windows_configuration = windows_configuration + self.linux_configuration = linux_configuration + self.secrets = secrets + + +class VirtualMachineScaleSetUpdatePublicIPAddressConfiguration(msrest.serialization.Model): + """Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration. + + :param name: The publicIP address configuration name. + :type name: str + :param idle_timeout_in_minutes: The idle timeout of the public IP address. + :type idle_timeout_in_minutes: int + :param dns_settings: The dns settings to be applied on the publicIP addresses . + :type dns_settings: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + idle_timeout_in_minutes: Optional[int] = None, + dns_settings: Optional["VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings"] = None, + **kwargs + ): + super(VirtualMachineScaleSetUpdatePublicIPAddressConfiguration, self).__init__(**kwargs) + self.name = name + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.dns_settings = dns_settings + + +class VirtualMachineScaleSetUpdateStorageProfile(msrest.serialization.Model): + """Describes a virtual machine scale set storage profile. + + :param image_reference: The image reference. + :type image_reference: ~azure.mgmt.compute.v2020_06_01.models.ImageReference + :param os_disk: The OS disk. + :type os_disk: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetUpdateOSDisk + :param data_disks: The data disks. + :type data_disks: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetDataDisk] + """ + + _attribute_map = { + 'image_reference': {'key': 'imageReference', 'type': 'ImageReference'}, + 'os_disk': {'key': 'osDisk', 'type': 'VirtualMachineScaleSetUpdateOSDisk'}, + 'data_disks': {'key': 'dataDisks', 'type': '[VirtualMachineScaleSetDataDisk]'}, + } + + def __init__( + self, + *, + image_reference: Optional["ImageReference"] = None, + os_disk: Optional["VirtualMachineScaleSetUpdateOSDisk"] = None, + data_disks: Optional[List["VirtualMachineScaleSetDataDisk"]] = None, + **kwargs + ): + super(VirtualMachineScaleSetUpdateStorageProfile, self).__init__(**kwargs) + self.image_reference = image_reference + self.os_disk = os_disk + self.data_disks = data_disks + + +class VirtualMachineScaleSetUpdateVMProfile(msrest.serialization.Model): + """Describes a virtual machine scale set virtual machine profile. + + :param os_profile: The virtual machine scale set OS profile. + :type os_profile: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetUpdateOSProfile + :param storage_profile: The virtual machine scale set storage profile. + :type storage_profile: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetUpdateStorageProfile + :param network_profile: The virtual machine scale set network profile. + :type network_profile: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetUpdateNetworkProfile + :param security_profile: The virtual machine scale set Security profile. + :type security_profile: ~azure.mgmt.compute.v2020_06_01.models.SecurityProfile + :param diagnostics_profile: The virtual machine scale set diagnostics profile. + :type diagnostics_profile: ~azure.mgmt.compute.v2020_06_01.models.DiagnosticsProfile + :param extension_profile: The virtual machine scale set extension profile. + :type extension_profile: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetExtensionProfile + :param license_type: The license type, which is for bring your own license scenario. + :type license_type: str + :param billing_profile: Specifies the billing related details of a Azure Spot VMSS. + :code:`
    `:code:`
    `Minimum api-version: 2019-03-01. + :type billing_profile: ~azure.mgmt.compute.v2020_06_01.models.BillingProfile + :param scheduled_events_profile: Specifies Scheduled Event related configurations. + :type scheduled_events_profile: ~azure.mgmt.compute.v2020_06_01.models.ScheduledEventsProfile + """ + + _attribute_map = { + 'os_profile': {'key': 'osProfile', 'type': 'VirtualMachineScaleSetUpdateOSProfile'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'VirtualMachineScaleSetUpdateStorageProfile'}, + 'network_profile': {'key': 'networkProfile', 'type': 'VirtualMachineScaleSetUpdateNetworkProfile'}, + 'security_profile': {'key': 'securityProfile', 'type': 'SecurityProfile'}, + 'diagnostics_profile': {'key': 'diagnosticsProfile', 'type': 'DiagnosticsProfile'}, + 'extension_profile': {'key': 'extensionProfile', 'type': 'VirtualMachineScaleSetExtensionProfile'}, + 'license_type': {'key': 'licenseType', 'type': 'str'}, + 'billing_profile': {'key': 'billingProfile', 'type': 'BillingProfile'}, + 'scheduled_events_profile': {'key': 'scheduledEventsProfile', 'type': 'ScheduledEventsProfile'}, + } + + def __init__( + self, + *, + os_profile: Optional["VirtualMachineScaleSetUpdateOSProfile"] = None, + storage_profile: Optional["VirtualMachineScaleSetUpdateStorageProfile"] = None, + network_profile: Optional["VirtualMachineScaleSetUpdateNetworkProfile"] = None, + security_profile: Optional["SecurityProfile"] = None, + diagnostics_profile: Optional["DiagnosticsProfile"] = None, + extension_profile: Optional["VirtualMachineScaleSetExtensionProfile"] = None, + license_type: Optional[str] = None, + billing_profile: Optional["BillingProfile"] = None, + scheduled_events_profile: Optional["ScheduledEventsProfile"] = None, + **kwargs + ): + super(VirtualMachineScaleSetUpdateVMProfile, self).__init__(**kwargs) + self.os_profile = os_profile + self.storage_profile = storage_profile + self.network_profile = network_profile + self.security_profile = security_profile + self.diagnostics_profile = diagnostics_profile + self.extension_profile = extension_profile + self.license_type = license_type + self.billing_profile = billing_profile + self.scheduled_events_profile = scheduled_events_profile + + +class VirtualMachineScaleSetVM(Resource): + """Describes a virtual machine scale set virtual machine. + + 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 instance_id: The virtual machine instance ID. + :vartype instance_id: str + :ivar sku: The virtual machine SKU. + :vartype sku: ~azure.mgmt.compute.v2020_06_01.models.Sku + :param plan: Specifies information about the marketplace image used to create the virtual + machine. This element is only used for marketplace images. Before you can use a marketplace + image from an API, you must enable the image for programmatic use. In the Azure portal, find + the marketplace image that you want to use and then click **Want to deploy programmatically, + Get Started ->**. Enter any required information and then click **Save**. + :type plan: ~azure.mgmt.compute.v2020_06_01.models.Plan + :ivar resources: The virtual machine child extension resources. + :vartype resources: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtension] + :ivar zones: The virtual machine zones. + :vartype zones: list[str] + :ivar latest_model_applied: Specifies whether the latest model has been applied to the virtual + machine. + :vartype latest_model_applied: bool + :ivar vm_id: Azure VM unique ID. + :vartype vm_id: str + :ivar instance_view: The virtual machine instance view. + :vartype instance_view: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMInstanceView + :param hardware_profile: Specifies the hardware settings for the virtual machine. + :type hardware_profile: ~azure.mgmt.compute.v2020_06_01.models.HardwareProfile + :param storage_profile: Specifies the storage settings for the virtual machine disks. + :type storage_profile: ~azure.mgmt.compute.v2020_06_01.models.StorageProfile + :param additional_capabilities: Specifies additional capabilities enabled or disabled on the + virtual machine in the scale set. For instance: whether the virtual machine has the capability + to support attaching managed data disks with UltraSSD_LRS storage account type. + :type additional_capabilities: ~azure.mgmt.compute.v2020_06_01.models.AdditionalCapabilities + :param os_profile: Specifies the operating system settings for the virtual machine. + :type os_profile: ~azure.mgmt.compute.v2020_06_01.models.OSProfile + :param security_profile: Specifies the Security related profile settings for the virtual + machine. + :type security_profile: ~azure.mgmt.compute.v2020_06_01.models.SecurityProfile + :param network_profile: Specifies the network interfaces of the virtual machine. + :type network_profile: ~azure.mgmt.compute.v2020_06_01.models.NetworkProfile + :param network_profile_configuration: Specifies the network profile configuration of the + virtual machine. + :type network_profile_configuration: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMNetworkProfileConfiguration + :param diagnostics_profile: Specifies the boot diagnostic settings state. + :code:`
    `:code:`
    `Minimum api-version: 2015-06-15. + :type diagnostics_profile: ~azure.mgmt.compute.v2020_06_01.models.DiagnosticsProfile + :param availability_set: Specifies information about the availability set that the virtual + machine should be assigned to. Virtual machines specified in the same availability set are + allocated to different nodes to maximize availability. For more information about availability + sets, see `Manage the availability of virtual machines + `_. :code:`
    `:code:`
    ` + For more information on Azure planned maintenance, see `Planned maintenance for virtual + machines in Azure `_ + :code:`
    `:code:`
    ` Currently, a VM can only be added to availability set at creation + time. An existing VM cannot be added to an availability set. + :type availability_set: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :param license_type: Specifies that the image or disk that is being used was licensed on- + premises. This element is only used for images that contain the Windows Server operating + system. :code:`
    `:code:`
    ` Possible values are: :code:`
    `:code:`
    ` Windows_Client + :code:`
    `:code:`
    ` Windows_Server :code:`
    `:code:`
    ` If this element is included in + a request for an update, the value must match the initial value. This value cannot be updated. + :code:`
    `:code:`
    ` For more information, see `Azure Hybrid Use Benefit for Windows Server + `_ :code:`
    `:code:`
    ` + Minimum api-version: 2015-06-15. + :type license_type: str + :ivar model_definition_applied: Specifies whether the model applied to the virtual machine is + the model of the virtual machine scale set or the customized model for the virtual machine. + :vartype model_definition_applied: str + :param protection_policy: Specifies the protection policy of the virtual machine. + :type protection_policy: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMProtectionPolicy + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'instance_id': {'readonly': True}, + 'sku': {'readonly': True}, + 'resources': {'readonly': True}, + 'zones': {'readonly': True}, + 'latest_model_applied': {'readonly': True}, + 'vm_id': {'readonly': True}, + 'instance_view': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'model_definition_applied': {'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}'}, + 'instance_id': {'key': 'instanceId', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'resources': {'key': 'resources', 'type': '[VirtualMachineExtension]'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'latest_model_applied': {'key': 'properties.latestModelApplied', 'type': 'bool'}, + 'vm_id': {'key': 'properties.vmId', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineScaleSetVMInstanceView'}, + 'hardware_profile': {'key': 'properties.hardwareProfile', 'type': 'HardwareProfile'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, + 'additional_capabilities': {'key': 'properties.additionalCapabilities', 'type': 'AdditionalCapabilities'}, + 'os_profile': {'key': 'properties.osProfile', 'type': 'OSProfile'}, + 'security_profile': {'key': 'properties.securityProfile', 'type': 'SecurityProfile'}, + 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'}, + 'network_profile_configuration': {'key': 'properties.networkProfileConfiguration', 'type': 'VirtualMachineScaleSetVMNetworkProfileConfiguration'}, + 'diagnostics_profile': {'key': 'properties.diagnosticsProfile', 'type': 'DiagnosticsProfile'}, + 'availability_set': {'key': 'properties.availabilitySet', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, + 'model_definition_applied': {'key': 'properties.modelDefinitionApplied', 'type': 'str'}, + 'protection_policy': {'key': 'properties.protectionPolicy', 'type': 'VirtualMachineScaleSetVMProtectionPolicy'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + plan: Optional["Plan"] = None, + hardware_profile: Optional["HardwareProfile"] = None, + storage_profile: Optional["StorageProfile"] = None, + additional_capabilities: Optional["AdditionalCapabilities"] = None, + os_profile: Optional["OSProfile"] = None, + security_profile: Optional["SecurityProfile"] = None, + network_profile: Optional["NetworkProfile"] = None, + network_profile_configuration: Optional["VirtualMachineScaleSetVMNetworkProfileConfiguration"] = None, + diagnostics_profile: Optional["DiagnosticsProfile"] = None, + availability_set: Optional["SubResource"] = None, + license_type: Optional[str] = None, + protection_policy: Optional["VirtualMachineScaleSetVMProtectionPolicy"] = None, + **kwargs + ): + super(VirtualMachineScaleSetVM, self).__init__(location=location, tags=tags, **kwargs) + self.instance_id = None + self.sku = None + self.plan = plan + self.resources = None + self.zones = None + self.latest_model_applied = None + self.vm_id = None + self.instance_view = None + self.hardware_profile = hardware_profile + self.storage_profile = storage_profile + self.additional_capabilities = additional_capabilities + self.os_profile = os_profile + self.security_profile = security_profile + self.network_profile = network_profile + self.network_profile_configuration = network_profile_configuration + self.diagnostics_profile = diagnostics_profile + self.availability_set = availability_set + self.provisioning_state = None + self.license_type = license_type + self.model_definition_applied = None + self.protection_policy = protection_policy + + +class VirtualMachineScaleSetVMExtensionsSummary(msrest.serialization.Model): + """Extensions summary for virtual machines of a virtual machine scale set. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The extension name. + :vartype name: str + :ivar statuses_summary: The extensions information. + :vartype statuses_summary: + list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineStatusCodeCount] + """ + + _validation = { + 'name': {'readonly': True}, + 'statuses_summary': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'statuses_summary': {'key': 'statusesSummary', 'type': '[VirtualMachineStatusCodeCount]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetVMExtensionsSummary, self).__init__(**kwargs) + self.name = None + self.statuses_summary = None + + +class VirtualMachineScaleSetVMInstanceIDs(msrest.serialization.Model): + """Specifies a list of virtual machine instance IDs from the VM scale set. + + :param instance_ids: The virtual machine scale set instance ids. Omitting the virtual machine + scale set instance ids will result in the operation being performed on all virtual machines in + the virtual machine scale set. + :type instance_ids: list[str] + """ + + _attribute_map = { + 'instance_ids': {'key': 'instanceIds', 'type': '[str]'}, + } + + def __init__( + self, + *, + instance_ids: Optional[List[str]] = None, + **kwargs + ): + super(VirtualMachineScaleSetVMInstanceIDs, self).__init__(**kwargs) + self.instance_ids = instance_ids + + +class VirtualMachineScaleSetVMInstanceRequiredIDs(msrest.serialization.Model): + """Specifies a list of virtual machine instance IDs from the VM scale set. + + All required parameters must be populated in order to send to Azure. + + :param instance_ids: Required. The virtual machine scale set instance ids. + :type instance_ids: list[str] + """ + + _validation = { + 'instance_ids': {'required': True}, + } + + _attribute_map = { + 'instance_ids': {'key': 'instanceIds', 'type': '[str]'}, + } + + def __init__( + self, + *, + instance_ids: List[str], + **kwargs + ): + super(VirtualMachineScaleSetVMInstanceRequiredIDs, self).__init__(**kwargs) + self.instance_ids = instance_ids + + +class VirtualMachineScaleSetVMInstanceView(msrest.serialization.Model): + """The instance view of a virtual machine scale set VM. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param platform_update_domain: The Update Domain count. + :type platform_update_domain: int + :param platform_fault_domain: The Fault Domain count. + :type platform_fault_domain: int + :param rdp_thumb_print: The Remote desktop certificate thumbprint. + :type rdp_thumb_print: str + :param vm_agent: The VM Agent running on the virtual machine. + :type vm_agent: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineAgentInstanceView + :param maintenance_redeploy_status: The Maintenance Operation status on the virtual machine. + :type maintenance_redeploy_status: + ~azure.mgmt.compute.v2020_06_01.models.MaintenanceRedeployStatus + :param disks: The disks information. + :type disks: list[~azure.mgmt.compute.v2020_06_01.models.DiskInstanceView] + :param extensions: The extensions information. + :type extensions: + list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtensionInstanceView] + :ivar vm_health: The health status for the VM. + :vartype vm_health: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineHealthStatus + :param boot_diagnostics: Boot Diagnostics is a debugging feature which allows you to view + Console Output and Screenshot to diagnose VM status. :code:`
    `:code:`
    ` You can easily + view the output of your console log. :code:`
    `:code:`
    ` Azure also enables you to see a + screenshot of the VM from the hypervisor. + :type boot_diagnostics: ~azure.mgmt.compute.v2020_06_01.models.BootDiagnosticsInstanceView + :param statuses: The resource status information. + :type statuses: list[~azure.mgmt.compute.v2020_06_01.models.InstanceViewStatus] + :ivar assigned_host: Resource id of the dedicated host, on which the virtual machine is + allocated through automatic placement, when the virtual machine is associated with a dedicated + host group that has automatic placement enabled. :code:`
    `:code:`
    `Minimum api-version: + 2020-06-01. + :vartype assigned_host: str + :param placement_group_id: The placement group in which the VM is running. If the VM is + deallocated it will not have a placementGroupId. + :type placement_group_id: str + """ + + _validation = { + 'vm_health': {'readonly': True}, + 'assigned_host': {'readonly': True}, + } + + _attribute_map = { + 'platform_update_domain': {'key': 'platformUpdateDomain', 'type': 'int'}, + 'platform_fault_domain': {'key': 'platformFaultDomain', 'type': 'int'}, + 'rdp_thumb_print': {'key': 'rdpThumbPrint', 'type': 'str'}, + 'vm_agent': {'key': 'vmAgent', 'type': 'VirtualMachineAgentInstanceView'}, + 'maintenance_redeploy_status': {'key': 'maintenanceRedeployStatus', 'type': 'MaintenanceRedeployStatus'}, + 'disks': {'key': 'disks', 'type': '[DiskInstanceView]'}, + 'extensions': {'key': 'extensions', 'type': '[VirtualMachineExtensionInstanceView]'}, + 'vm_health': {'key': 'vmHealth', 'type': 'VirtualMachineHealthStatus'}, + 'boot_diagnostics': {'key': 'bootDiagnostics', 'type': 'BootDiagnosticsInstanceView'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + 'assigned_host': {'key': 'assignedHost', 'type': 'str'}, + 'placement_group_id': {'key': 'placementGroupId', 'type': 'str'}, + } + + def __init__( + self, + *, + platform_update_domain: Optional[int] = None, + platform_fault_domain: Optional[int] = None, + rdp_thumb_print: Optional[str] = None, + vm_agent: Optional["VirtualMachineAgentInstanceView"] = None, + maintenance_redeploy_status: Optional["MaintenanceRedeployStatus"] = None, + disks: Optional[List["DiskInstanceView"]] = None, + extensions: Optional[List["VirtualMachineExtensionInstanceView"]] = None, + boot_diagnostics: Optional["BootDiagnosticsInstanceView"] = None, + statuses: Optional[List["InstanceViewStatus"]] = None, + placement_group_id: Optional[str] = None, + **kwargs + ): + super(VirtualMachineScaleSetVMInstanceView, self).__init__(**kwargs) + self.platform_update_domain = platform_update_domain + self.platform_fault_domain = platform_fault_domain + self.rdp_thumb_print = rdp_thumb_print + self.vm_agent = vm_agent + self.maintenance_redeploy_status = maintenance_redeploy_status + self.disks = disks + self.extensions = extensions + self.vm_health = None + self.boot_diagnostics = boot_diagnostics + self.statuses = statuses + self.assigned_host = None + self.placement_group_id = placement_group_id + + +class VirtualMachineScaleSetVMListResult(msrest.serialization.Model): + """The List Virtual Machine Scale Set VMs operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of virtual machine scale sets VMs. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVM] + :param next_link: The uri to fetch the next page of Virtual Machine Scale Set VMs. Call + ListNext() with this to fetch the next page of VMSS VMs. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualMachineScaleSetVM]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["VirtualMachineScaleSetVM"], + next_link: Optional[str] = None, + **kwargs + ): + super(VirtualMachineScaleSetVMListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class VirtualMachineScaleSetVMNetworkProfileConfiguration(msrest.serialization.Model): + """Describes a virtual machine scale set VM network profile. + + :param network_interface_configurations: The list of network configurations. + :type network_interface_configurations: + list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetNetworkConfiguration] + """ + + _attribute_map = { + 'network_interface_configurations': {'key': 'networkInterfaceConfigurations', 'type': '[VirtualMachineScaleSetNetworkConfiguration]'}, + } + + def __init__( + self, + *, + network_interface_configurations: Optional[List["VirtualMachineScaleSetNetworkConfiguration"]] = None, + **kwargs + ): + super(VirtualMachineScaleSetVMNetworkProfileConfiguration, self).__init__(**kwargs) + self.network_interface_configurations = network_interface_configurations + + +class VirtualMachineScaleSetVMProfile(msrest.serialization.Model): + """Describes a virtual machine scale set virtual machine profile. + + :param os_profile: Specifies the operating system settings for the virtual machines in the + scale set. + :type os_profile: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetOSProfile + :param storage_profile: Specifies the storage settings for the virtual machine disks. + :type storage_profile: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetStorageProfile + :param network_profile: Specifies properties of the network interfaces of the virtual machines + in the scale set. + :type network_profile: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetNetworkProfile + :param security_profile: Specifies the Security related profile settings for the virtual + machines in the scale set. + :type security_profile: ~azure.mgmt.compute.v2020_06_01.models.SecurityProfile + :param diagnostics_profile: Specifies the boot diagnostic settings state. + :code:`
    `:code:`
    `Minimum api-version: 2015-06-15. + :type diagnostics_profile: ~azure.mgmt.compute.v2020_06_01.models.DiagnosticsProfile + :param extension_profile: Specifies a collection of settings for extensions installed on + virtual machines in the scale set. + :type extension_profile: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetExtensionProfile + :param license_type: Specifies that the image or disk that is being used was licensed on- + premises. This element is only used for images that contain the Windows Server operating + system. :code:`
    `:code:`
    ` Possible values are: :code:`
    `:code:`
    ` Windows_Client + :code:`
    `:code:`
    ` Windows_Server :code:`
    `:code:`
    ` If this element is included in + a request for an update, the value must match the initial value. This value cannot be updated. + :code:`
    `:code:`
    ` For more information, see `Azure Hybrid Use Benefit for Windows Server + `_ :code:`
    `:code:`
    ` + Minimum api-version: 2015-06-15. + :type license_type: str + :param priority: Specifies the priority for the virtual machines in the scale set. + :code:`
    `:code:`
    `Minimum api-version: 2017-10-30-preview. Possible values include: + "Regular", "Low", "Spot". + :type priority: str or ~azure.mgmt.compute.v2020_06_01.models.VirtualMachinePriorityTypes + :param eviction_policy: Specifies the eviction policy for the Azure Spot virtual machine and + Azure Spot scale set. :code:`
    `:code:`
    `For Azure Spot virtual machines, both + 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01. + :code:`
    `:code:`
    `For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported + and the minimum api-version is 2017-10-30-preview. Possible values include: "Deallocate", + "Delete". + :type eviction_policy: str or + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineEvictionPolicyTypes + :param billing_profile: Specifies the billing related details of a Azure Spot VMSS. + :code:`
    `:code:`
    `Minimum api-version: 2019-03-01. + :type billing_profile: ~azure.mgmt.compute.v2020_06_01.models.BillingProfile + :param scheduled_events_profile: Specifies Scheduled Event related configurations. + :type scheduled_events_profile: ~azure.mgmt.compute.v2020_06_01.models.ScheduledEventsProfile + """ + + _attribute_map = { + 'os_profile': {'key': 'osProfile', 'type': 'VirtualMachineScaleSetOSProfile'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'VirtualMachineScaleSetStorageProfile'}, + 'network_profile': {'key': 'networkProfile', 'type': 'VirtualMachineScaleSetNetworkProfile'}, + 'security_profile': {'key': 'securityProfile', 'type': 'SecurityProfile'}, + 'diagnostics_profile': {'key': 'diagnosticsProfile', 'type': 'DiagnosticsProfile'}, + 'extension_profile': {'key': 'extensionProfile', 'type': 'VirtualMachineScaleSetExtensionProfile'}, + 'license_type': {'key': 'licenseType', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'str'}, + 'eviction_policy': {'key': 'evictionPolicy', 'type': 'str'}, + 'billing_profile': {'key': 'billingProfile', 'type': 'BillingProfile'}, + 'scheduled_events_profile': {'key': 'scheduledEventsProfile', 'type': 'ScheduledEventsProfile'}, + } + + def __init__( + self, + *, + os_profile: Optional["VirtualMachineScaleSetOSProfile"] = None, + storage_profile: Optional["VirtualMachineScaleSetStorageProfile"] = None, + network_profile: Optional["VirtualMachineScaleSetNetworkProfile"] = None, + security_profile: Optional["SecurityProfile"] = None, + diagnostics_profile: Optional["DiagnosticsProfile"] = None, + extension_profile: Optional["VirtualMachineScaleSetExtensionProfile"] = None, + license_type: Optional[str] = None, + priority: Optional[Union[str, "VirtualMachinePriorityTypes"]] = None, + eviction_policy: Optional[Union[str, "VirtualMachineEvictionPolicyTypes"]] = None, + billing_profile: Optional["BillingProfile"] = None, + scheduled_events_profile: Optional["ScheduledEventsProfile"] = None, + **kwargs + ): + super(VirtualMachineScaleSetVMProfile, self).__init__(**kwargs) + self.os_profile = os_profile + self.storage_profile = storage_profile + self.network_profile = network_profile + self.security_profile = security_profile + self.diagnostics_profile = diagnostics_profile + self.extension_profile = extension_profile + self.license_type = license_type + self.priority = priority + self.eviction_policy = eviction_policy + self.billing_profile = billing_profile + self.scheduled_events_profile = scheduled_events_profile + + +class VirtualMachineScaleSetVMProtectionPolicy(msrest.serialization.Model): + """The protection policy of a virtual machine scale set VM. + + :param protect_from_scale_in: Indicates that the virtual machine scale set VM shouldn't be + considered for deletion during a scale-in operation. + :type protect_from_scale_in: bool + :param protect_from_scale_set_actions: Indicates that model updates or actions (including + scale-in) initiated on the virtual machine scale set should not be applied to the virtual + machine scale set VM. + :type protect_from_scale_set_actions: bool + """ + + _attribute_map = { + 'protect_from_scale_in': {'key': 'protectFromScaleIn', 'type': 'bool'}, + 'protect_from_scale_set_actions': {'key': 'protectFromScaleSetActions', 'type': 'bool'}, + } + + def __init__( + self, + *, + protect_from_scale_in: Optional[bool] = None, + protect_from_scale_set_actions: Optional[bool] = None, + **kwargs + ): + super(VirtualMachineScaleSetVMProtectionPolicy, self).__init__(**kwargs) + self.protect_from_scale_in = protect_from_scale_in + self.protect_from_scale_set_actions = protect_from_scale_set_actions + + +class VirtualMachineScaleSetVMReimageParameters(VirtualMachineReimageParameters): + """Describes a Virtual Machine Scale Set VM Reimage Parameters. + + :param temp_disk: Specifies whether to reimage temp disk. Default value: false. Note: This temp + disk reimage parameter is only supported for VM/VMSS with Ephemeral OS disk. + :type temp_disk: bool + """ + + _attribute_map = { + 'temp_disk': {'key': 'tempDisk', 'type': 'bool'}, + } + + def __init__( + self, + *, + temp_disk: Optional[bool] = None, + **kwargs + ): + super(VirtualMachineScaleSetVMReimageParameters, self).__init__(temp_disk=temp_disk, **kwargs) + + +class VirtualMachineSize(msrest.serialization.Model): + """Describes the properties of a VM size. + + :param name: The name of the virtual machine size. + :type name: str + :param number_of_cores: The number of cores supported by the virtual machine size. + :type number_of_cores: int + :param os_disk_size_in_mb: The OS disk size, in MB, allowed by the virtual machine size. + :type os_disk_size_in_mb: int + :param resource_disk_size_in_mb: The resource disk size, in MB, allowed by the virtual machine + size. + :type resource_disk_size_in_mb: int + :param memory_in_mb: The amount of memory, in MB, supported by the virtual machine size. + :type memory_in_mb: int + :param max_data_disk_count: The maximum number of data disks that can be attached to the + virtual machine size. + :type max_data_disk_count: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'number_of_cores': {'key': 'numberOfCores', 'type': 'int'}, + 'os_disk_size_in_mb': {'key': 'osDiskSizeInMB', 'type': 'int'}, + 'resource_disk_size_in_mb': {'key': 'resourceDiskSizeInMB', 'type': 'int'}, + 'memory_in_mb': {'key': 'memoryInMB', 'type': 'int'}, + 'max_data_disk_count': {'key': 'maxDataDiskCount', 'type': 'int'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + number_of_cores: Optional[int] = None, + os_disk_size_in_mb: Optional[int] = None, + resource_disk_size_in_mb: Optional[int] = None, + memory_in_mb: Optional[int] = None, + max_data_disk_count: Optional[int] = None, + **kwargs + ): + super(VirtualMachineSize, self).__init__(**kwargs) + self.name = name + self.number_of_cores = number_of_cores + self.os_disk_size_in_mb = os_disk_size_in_mb + self.resource_disk_size_in_mb = resource_disk_size_in_mb + self.memory_in_mb = memory_in_mb + self.max_data_disk_count = max_data_disk_count + + +class VirtualMachineSizeListResult(msrest.serialization.Model): + """The List Virtual Machine operation response. + + :param value: The list of virtual machine sizes. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineSize] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualMachineSize]'}, + } + + def __init__( + self, + *, + value: Optional[List["VirtualMachineSize"]] = None, + **kwargs + ): + super(VirtualMachineSizeListResult, self).__init__(**kwargs) + self.value = value + + +class VirtualMachineSoftwarePatchProperties(msrest.serialization.Model): + """Describes the properties of a Virtual Machine software patch. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar patch_id: A unique identifier for the patch. + :vartype patch_id: str + :ivar name: The friendly name of the patch. + :vartype name: str + :ivar version: The version number of the patch. This property applies only to Linux patches. + :vartype version: str + :ivar kbid: The KBID of the patch. Only applies to Windows patches. + :vartype kbid: str + :ivar classifications: The classification(s) of the patch as provided by the patch publisher. + :vartype classifications: list[str] + :ivar reboot_behavior: Describes the reboot requirements of the patch. Possible values include: + "NeverReboots", "AlwaysRequiresReboot", "CanRequestReboot". + :vartype reboot_behavior: str or + ~azure.mgmt.compute.v2020_06_01.models.SoftwareUpdateRebootBehavior + :ivar activity_id: The activity ID of the operation that produced this result. It is used to + correlate across CRP and extension logs. + :vartype activity_id: str + :ivar published_date: The UTC timestamp when the repository published this patch. + :vartype published_date: ~datetime.datetime + :ivar last_modified_date_time: The UTC timestamp of the last update to this patch record. + :vartype last_modified_date_time: ~datetime.datetime + :ivar assessment_state: Describes the outcome of an install operation for a given patch. + Possible values include: "Installed", "Failed", "Excluded", "NotSelected", "Pending", + "Available". + :vartype assessment_state: str or ~azure.mgmt.compute.v2020_06_01.models.PatchAssessmentState + """ + + _validation = { + 'patch_id': {'readonly': True}, + 'name': {'readonly': True}, + 'version': {'readonly': True}, + 'kbid': {'readonly': True}, + 'classifications': {'readonly': True}, + 'reboot_behavior': {'readonly': True}, + 'activity_id': {'readonly': True}, + 'published_date': {'readonly': True}, + 'last_modified_date_time': {'readonly': True}, + 'assessment_state': {'readonly': True}, + } + + _attribute_map = { + 'patch_id': {'key': 'patchId', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'kbid': {'key': 'kbid', 'type': 'str'}, + 'classifications': {'key': 'classifications', 'type': '[str]'}, + 'reboot_behavior': {'key': 'rebootBehavior', 'type': 'str'}, + 'activity_id': {'key': 'activityId', 'type': 'str'}, + 'published_date': {'key': 'publishedDate', 'type': 'iso-8601'}, + 'last_modified_date_time': {'key': 'lastModifiedDateTime', 'type': 'iso-8601'}, + 'assessment_state': {'key': 'assessmentState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineSoftwarePatchProperties, self).__init__(**kwargs) + self.patch_id = None + self.name = None + self.version = None + self.kbid = None + self.classifications = None + self.reboot_behavior = None + self.activity_id = None + self.published_date = None + self.last_modified_date_time = None + self.assessment_state = None + + +class VirtualMachineStatusCodeCount(msrest.serialization.Model): + """The status code and count of the virtual machine scale set instance view status summary. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The instance view status code. + :vartype code: str + :ivar count: The number of instances having a particular status code. + :vartype count: int + """ + + _validation = { + 'code': {'readonly': True}, + 'count': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineStatusCodeCount, self).__init__(**kwargs) + self.code = None + self.count = None + + +class VirtualMachineUpdate(UpdateResource): + """Describes a Virtual Machine Update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param plan: Specifies information about the marketplace image used to create the virtual + machine. This element is only used for marketplace images. Before you can use a marketplace + image from an API, you must enable the image for programmatic use. In the Azure portal, find + the marketplace image that you want to use and then click **Want to deploy programmatically, + Get Started ->**. Enter any required information and then click **Save**. + :type plan: ~azure.mgmt.compute.v2020_06_01.models.Plan + :param identity: The identity of the virtual machine, if configured. + :type identity: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineIdentity + :param zones: The virtual machine zones. + :type zones: list[str] + :param hardware_profile: Specifies the hardware settings for the virtual machine. + :type hardware_profile: ~azure.mgmt.compute.v2020_06_01.models.HardwareProfile + :param storage_profile: Specifies the storage settings for the virtual machine disks. + :type storage_profile: ~azure.mgmt.compute.v2020_06_01.models.StorageProfile + :param additional_capabilities: Specifies additional capabilities enabled or disabled on the + virtual machine. + :type additional_capabilities: ~azure.mgmt.compute.v2020_06_01.models.AdditionalCapabilities + :param os_profile: Specifies the operating system settings used while creating the virtual + machine. Some of the settings cannot be changed once VM is provisioned. + :type os_profile: ~azure.mgmt.compute.v2020_06_01.models.OSProfile + :param network_profile: Specifies the network interfaces of the virtual machine. + :type network_profile: ~azure.mgmt.compute.v2020_06_01.models.NetworkProfile + :param security_profile: Specifies the Security related profile settings for the virtual + machine. + :type security_profile: ~azure.mgmt.compute.v2020_06_01.models.SecurityProfile + :param diagnostics_profile: Specifies the boot diagnostic settings state. + :code:`
    `:code:`
    `Minimum api-version: 2015-06-15. + :type diagnostics_profile: ~azure.mgmt.compute.v2020_06_01.models.DiagnosticsProfile + :param availability_set: Specifies information about the availability set that the virtual + machine should be assigned to. Virtual machines specified in the same availability set are + allocated to different nodes to maximize availability. For more information about availability + sets, see `Manage the availability of virtual machines + `_. :code:`
    `:code:`
    ` + For more information on Azure planned maintenance, see `Planned maintenance for virtual + machines in Azure `_ + :code:`
    `:code:`
    ` Currently, a VM can only be added to availability set at creation + time. The availability set to which the VM is being added should be under the same resource + group as the availability set resource. An existing VM cannot be added to an availability set. + :code:`
    `:code:`
    `This property cannot exist along with a non-null + properties.virtualMachineScaleSet reference. + :type availability_set: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param virtual_machine_scale_set: Specifies information about the virtual machine scale set + that the virtual machine should be assigned to. Virtual machines specified in the same virtual + machine scale set are allocated to different nodes to maximize availability. Currently, a VM + can only be added to virtual machine scale set at creation time. An existing VM cannot be added + to a virtual machine scale set. :code:`
    `:code:`
    `This property cannot exist along with a + non-null properties.availabilitySet reference. :code:`
    `:code:`
    `Minimum api‐version: + 2019‐03‐01. + :type virtual_machine_scale_set: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param proximity_placement_group: Specifies information about the proximity placement group + that the virtual machine should be assigned to. :code:`
    `:code:`
    `Minimum api-version: + 2018-04-01. + :type proximity_placement_group: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param priority: Specifies the priority for the virtual machine. + :code:`
    `:code:`
    `Minimum api-version: 2019-03-01. Possible values include: "Regular", + "Low", "Spot". + :type priority: str or ~azure.mgmt.compute.v2020_06_01.models.VirtualMachinePriorityTypes + :param eviction_policy: Specifies the eviction policy for the Azure Spot virtual machine and + Azure Spot scale set. :code:`
    `:code:`
    `For Azure Spot virtual machines, both + 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01. + :code:`
    `:code:`
    `For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported + and the minimum api-version is 2017-10-30-preview. Possible values include: "Deallocate", + "Delete". + :type eviction_policy: str or + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineEvictionPolicyTypes + :param billing_profile: Specifies the billing related details of a Azure Spot virtual machine. + :code:`
    `:code:`
    `Minimum api-version: 2019-03-01. + :type billing_profile: ~azure.mgmt.compute.v2020_06_01.models.BillingProfile + :param host: Specifies information about the dedicated host that the virtual machine resides + in. :code:`
    `:code:`
    `Minimum api-version: 2018-10-01. + :type host: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :param host_group: Specifies information about the dedicated host group that the virtual + machine resides in. :code:`
    `:code:`
    `Minimum api-version: 2020-06-01. + :code:`
    `:code:`
    `NOTE: User cannot specify both host and hostGroup properties. + :type host_group: ~azure.mgmt.compute.v2020_06_01.models.SubResource + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :ivar instance_view: The virtual machine instance view. + :vartype instance_view: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineInstanceView + :param license_type: Specifies that the image or disk that is being used was licensed on- + premises. This element is only used for images that contain the Windows Server operating + system. :code:`
    `:code:`
    ` Possible values are: :code:`
    `:code:`
    ` Windows_Client + :code:`
    `:code:`
    ` Windows_Server :code:`
    `:code:`
    ` If this element is included in + a request for an update, the value must match the initial value. This value cannot be updated. + :code:`
    `:code:`
    ` For more information, see `Azure Hybrid Use Benefit for Windows Server + `_ :code:`
    `:code:`
    ` + Minimum api-version: 2015-06-15. + :type license_type: str + :ivar vm_id: Specifies the VM unique ID which is a 128-bits identifier that is encoded and + stored in all Azure IaaS VMs SMBIOS and can be read using platform BIOS commands. + :vartype vm_id: str + :param extensions_time_budget: Specifies the time alloted for all extensions to start. The time + duration should be between 15 minutes and 120 minutes (inclusive) and should be specified in + ISO 8601 format. The default value is 90 minutes (PT1H30M). :code:`
    `:code:`
    ` Minimum + api-version: 2020-06-01. + :type extensions_time_budget: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'instance_view': {'readonly': True}, + 'vm_id': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'identity': {'key': 'identity', 'type': 'VirtualMachineIdentity'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'hardware_profile': {'key': 'properties.hardwareProfile', 'type': 'HardwareProfile'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, + 'additional_capabilities': {'key': 'properties.additionalCapabilities', 'type': 'AdditionalCapabilities'}, + 'os_profile': {'key': 'properties.osProfile', 'type': 'OSProfile'}, + 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'}, + 'security_profile': {'key': 'properties.securityProfile', 'type': 'SecurityProfile'}, + 'diagnostics_profile': {'key': 'properties.diagnosticsProfile', 'type': 'DiagnosticsProfile'}, + 'availability_set': {'key': 'properties.availabilitySet', 'type': 'SubResource'}, + 'virtual_machine_scale_set': {'key': 'properties.virtualMachineScaleSet', 'type': 'SubResource'}, + 'proximity_placement_group': {'key': 'properties.proximityPlacementGroup', 'type': 'SubResource'}, + 'priority': {'key': 'properties.priority', 'type': 'str'}, + 'eviction_policy': {'key': 'properties.evictionPolicy', 'type': 'str'}, + 'billing_profile': {'key': 'properties.billingProfile', 'type': 'BillingProfile'}, + 'host': {'key': 'properties.host', 'type': 'SubResource'}, + 'host_group': {'key': 'properties.hostGroup', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineInstanceView'}, + 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, + 'vm_id': {'key': 'properties.vmId', 'type': 'str'}, + 'extensions_time_budget': {'key': 'properties.extensionsTimeBudget', 'type': 'str'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + plan: Optional["Plan"] = None, + identity: Optional["VirtualMachineIdentity"] = None, + zones: Optional[List[str]] = None, + hardware_profile: Optional["HardwareProfile"] = None, + storage_profile: Optional["StorageProfile"] = None, + additional_capabilities: Optional["AdditionalCapabilities"] = None, + os_profile: Optional["OSProfile"] = None, + network_profile: Optional["NetworkProfile"] = None, + security_profile: Optional["SecurityProfile"] = None, + diagnostics_profile: Optional["DiagnosticsProfile"] = None, + availability_set: Optional["SubResource"] = None, + virtual_machine_scale_set: Optional["SubResource"] = None, + proximity_placement_group: Optional["SubResource"] = None, + priority: Optional[Union[str, "VirtualMachinePriorityTypes"]] = None, + eviction_policy: Optional[Union[str, "VirtualMachineEvictionPolicyTypes"]] = None, + billing_profile: Optional["BillingProfile"] = None, + host: Optional["SubResource"] = None, + host_group: Optional["SubResource"] = None, + license_type: Optional[str] = None, + extensions_time_budget: Optional[str] = None, + **kwargs + ): + super(VirtualMachineUpdate, self).__init__(tags=tags, **kwargs) + self.plan = plan + self.identity = identity + self.zones = zones + self.hardware_profile = hardware_profile + self.storage_profile = storage_profile + self.additional_capabilities = additional_capabilities + self.os_profile = os_profile + self.network_profile = network_profile + self.security_profile = security_profile + self.diagnostics_profile = diagnostics_profile + self.availability_set = availability_set + self.virtual_machine_scale_set = virtual_machine_scale_set + self.proximity_placement_group = proximity_placement_group + self.priority = priority + self.eviction_policy = eviction_policy + self.billing_profile = billing_profile + self.host = host + self.host_group = host_group + self.provisioning_state = None + self.instance_view = None + self.license_type = license_type + self.vm_id = None + self.extensions_time_budget = extensions_time_budget + + +class VMScaleSetConvertToSinglePlacementGroupInput(msrest.serialization.Model): + """VMScaleSetConvertToSinglePlacementGroupInput. + + :param active_placement_group_id: Id of the placement group in which you want future virtual + machine instances to be placed. To query placement group Id, please use Virtual Machine Scale + Set VMs - Get API. If not provided, the platform will choose one with maximum number of virtual + machine instances. + :type active_placement_group_id: str + """ + + _attribute_map = { + 'active_placement_group_id': {'key': 'activePlacementGroupId', 'type': 'str'}, + } + + def __init__( + self, + *, + active_placement_group_id: Optional[str] = None, + **kwargs + ): + super(VMScaleSetConvertToSinglePlacementGroupInput, self).__init__(**kwargs) + self.active_placement_group_id = active_placement_group_id + + +class WindowsConfiguration(msrest.serialization.Model): + """Specifies Windows operating system settings on the virtual machine. + + :param provision_vm_agent: Indicates whether virtual machine agent should be provisioned on the + virtual machine. :code:`
    `:code:`
    ` When this property is not specified in the request + body, default behavior is to set it to true. This will ensure that VM Agent is installed on + the VM so that extensions can be added to the VM later. + :type provision_vm_agent: bool + :param enable_automatic_updates: Indicates whether Automatic Updates is enabled for the Windows + virtual machine. Default value is true. :code:`
    `:code:`
    ` For virtual machine scale + sets, this property can be updated and updates will take effect on OS reprovisioning. + :type enable_automatic_updates: bool + :param time_zone: Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time". + :code:`
    `:code:`
    ` Possible values can be `TimeZoneInfo.Id + `_ + value from time zones returned by `TimeZoneInfo.GetSystemTimeZones + `_. + :type time_zone: str + :param additional_unattend_content: Specifies additional base-64 encoded XML formatted + information that can be included in the Unattend.xml file, which is used by Windows Setup. + :type additional_unattend_content: + list[~azure.mgmt.compute.v2020_06_01.models.AdditionalUnattendContent] + :param patch_settings: Specifies settings related to in-guest patching (KBs). + :type patch_settings: ~azure.mgmt.compute.v2020_06_01.models.PatchSettings + :param win_rm: Specifies the Windows Remote Management listeners. This enables remote Windows + PowerShell. + :type win_rm: ~azure.mgmt.compute.v2020_06_01.models.WinRMConfiguration + """ + + _attribute_map = { + 'provision_vm_agent': {'key': 'provisionVMAgent', 'type': 'bool'}, + 'enable_automatic_updates': {'key': 'enableAutomaticUpdates', 'type': 'bool'}, + 'time_zone': {'key': 'timeZone', 'type': 'str'}, + 'additional_unattend_content': {'key': 'additionalUnattendContent', 'type': '[AdditionalUnattendContent]'}, + 'patch_settings': {'key': 'patchSettings', 'type': 'PatchSettings'}, + 'win_rm': {'key': 'winRM', 'type': 'WinRMConfiguration'}, + } + + def __init__( + self, + *, + provision_vm_agent: Optional[bool] = None, + enable_automatic_updates: Optional[bool] = None, + time_zone: Optional[str] = None, + additional_unattend_content: Optional[List["AdditionalUnattendContent"]] = None, + patch_settings: Optional["PatchSettings"] = None, + win_rm: Optional["WinRMConfiguration"] = None, + **kwargs + ): + super(WindowsConfiguration, self).__init__(**kwargs) + self.provision_vm_agent = provision_vm_agent + self.enable_automatic_updates = enable_automatic_updates + self.time_zone = time_zone + self.additional_unattend_content = additional_unattend_content + self.patch_settings = patch_settings + self.win_rm = win_rm + + +class WinRMConfiguration(msrest.serialization.Model): + """Describes Windows Remote Management configuration of the VM. + + :param listeners: The list of Windows Remote Management listeners. + :type listeners: list[~azure.mgmt.compute.v2020_06_01.models.WinRMListener] + """ + + _attribute_map = { + 'listeners': {'key': 'listeners', 'type': '[WinRMListener]'}, + } + + def __init__( + self, + *, + listeners: Optional[List["WinRMListener"]] = None, + **kwargs + ): + super(WinRMConfiguration, self).__init__(**kwargs) + self.listeners = listeners + + +class WinRMListener(msrest.serialization.Model): + """Describes Protocol and thumbprint of Windows Remote Management listener. + + :param protocol: Specifies the protocol of WinRM listener. :code:`
    `:code:`
    ` Possible + values are: :code:`
    `\ **http** :code:`
    `:code:`
    ` **https**. Possible values include: + "Http", "Https". + :type protocol: str or ~azure.mgmt.compute.v2020_06_01.models.ProtocolTypes + :param certificate_url: This is the URL of a certificate that has been uploaded to Key Vault as + a secret. For adding a secret to the Key Vault, see `Add a key or secret to the key vault + `_. In this case, your + certificate needs to be It is the Base64 encoding of the following JSON Object which is encoded + in UTF-8: :code:`
    `:code:`
    ` {:code:`
    ` "data":":code:``",:code:`
    ` "dataType":"pfx",:code:`
    ` "password":":code:``":code:`
    `}. + :type certificate_url: str + """ + + _attribute_map = { + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'certificate_url': {'key': 'certificateUrl', 'type': 'str'}, + } + + def __init__( + self, + *, + protocol: Optional[Union[str, "ProtocolTypes"]] = None, + certificate_url: Optional[str] = None, + **kwargs + ): + super(WinRMListener, self).__init__(**kwargs) + self.protocol = protocol + self.certificate_url = certificate_url diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/__init__.py new file mode 100644 index 000000000000..059428308b09 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/__init__.py @@ -0,0 +1,51 @@ +# 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 ._operations import Operations +from ._availability_sets_operations import AvailabilitySetsOperations +from ._proximity_placement_groups_operations import ProximityPlacementGroupsOperations +from ._dedicated_host_groups_operations import DedicatedHostGroupsOperations +from ._dedicated_hosts_operations import DedicatedHostsOperations +from ._ssh_public_keys_operations import SshPublicKeysOperations +from ._virtual_machine_extension_images_operations import VirtualMachineExtensionImagesOperations +from ._virtual_machine_extensions_operations import VirtualMachineExtensionsOperations +from ._virtual_machine_images_operations import VirtualMachineImagesOperations +from ._usage_operations import UsageOperations +from ._virtual_machines_operations import VirtualMachinesOperations +from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations +from ._images_operations import ImagesOperations +from ._virtual_machine_scale_sets_operations import VirtualMachineScaleSetsOperations +from ._virtual_machine_scale_set_extensions_operations import VirtualMachineScaleSetExtensionsOperations +from ._virtual_machine_scale_set_rolling_upgrades_operations import VirtualMachineScaleSetRollingUpgradesOperations +from ._virtual_machine_scale_set_vm_extensions_operations import VirtualMachineScaleSetVMExtensionsOperations +from ._virtual_machine_scale_set_vms_operations import VirtualMachineScaleSetVMsOperations +from ._log_analytics_operations import LogAnalyticsOperations +from ._virtual_machine_run_commands_operations import VirtualMachineRunCommandsOperations + +__all__ = [ + 'Operations', + 'AvailabilitySetsOperations', + 'ProximityPlacementGroupsOperations', + 'DedicatedHostGroupsOperations', + 'DedicatedHostsOperations', + 'SshPublicKeysOperations', + 'VirtualMachineExtensionImagesOperations', + 'VirtualMachineExtensionsOperations', + 'VirtualMachineImagesOperations', + 'UsageOperations', + 'VirtualMachinesOperations', + 'VirtualMachineSizesOperations', + 'ImagesOperations', + 'VirtualMachineScaleSetsOperations', + 'VirtualMachineScaleSetExtensionsOperations', + 'VirtualMachineScaleSetRollingUpgradesOperations', + 'VirtualMachineScaleSetVMExtensionsOperations', + 'VirtualMachineScaleSetVMsOperations', + 'LogAnalyticsOperations', + 'VirtualMachineRunCommandsOperations', +] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_availability_sets_operations.py new file mode 100644 index 000000000000..f91ad1088426 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_availability_sets_operations.py @@ -0,0 +1,513 @@ +# 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 + +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 AvailabilitySetsOperations(object): + """AvailabilitySetsOperations 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_06_01.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( + self, + resource_group_name, # type: str + availability_set_name, # type: str + parameters, # type: "models.AvailabilitySet" + **kwargs # type: Any + ): + # type: (...) -> "models.AvailabilitySet" + """Create or update an availability set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param availability_set_name: The name of the availability set. + :type availability_set_name: str + :param parameters: Parameters supplied to the Create Availability Set operation. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.AvailabilitySet + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AvailabilitySet, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.AvailabilitySet + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'availabilitySetName': self._serialize.url("availability_set_name", availability_set_name, 'str'), + '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') + + # 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(parameters, 'AvailabilitySet') + 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AvailabilitySet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + availability_set_name, # type: str + parameters, # type: "models.AvailabilitySetUpdate" + **kwargs # type: Any + ): + # type: (...) -> "models.AvailabilitySet" + """Update an availability set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param availability_set_name: The name of the availability set. + :type availability_set_name: str + :param parameters: Parameters supplied to the Update Availability Set operation. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.AvailabilitySetUpdate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AvailabilitySet, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.AvailabilitySet + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'availabilitySetName': self._serialize.url("availability_set_name", availability_set_name, 'str'), + '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') + + # 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(parameters, 'AvailabilitySetUpdate') + 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AvailabilitySet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + availability_set_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete an availability set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param availability_set_name: The name of the availability set. + :type availability_set_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-06-01" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'availabilitySetName': self._serialize.url("availability_set_name", availability_set_name, 'str'), + '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') + + # 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, 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + availability_set_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AvailabilitySet" + """Retrieves information about an availability set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param availability_set_name: The name of the availability set. + :type availability_set_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AvailabilitySet, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.AvailabilitySet + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'availabilitySetName': self._serialize.url("availability_set_name", availability_set_name, 'str'), + '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') + + # 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('AvailabilitySet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}'} # type: ignore + + def list_by_subscription( + self, + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.AvailabilitySetListResult"] + """Lists all availability sets in a subscription. + + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AvailabilitySetListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.AvailabilitySetListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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_subscription.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') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, '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('AvailabilitySetListResult', 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_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/availabilitySets'} # type: ignore + + def list( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.AvailabilitySetListResult"] + """Lists all availability sets in 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 AvailabilitySetListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.AvailabilitySetListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + '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('AvailabilitySetListResult', 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets'} # type: ignore + + def list_available_sizes( + self, + resource_group_name, # type: str + availability_set_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + """Lists all available virtual machine sizes that can be used to create a new virtual machine in + an existing availability set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param availability_set_name: The name of the availability set. + :type availability_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 VirtualMachineSizeListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineSizeListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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_available_sizes.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'availabilitySetName': self._serialize.url("availability_set_name", availability_set_name, 'str'), + '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('VirtualMachineSizeListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return 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_available_sizes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/vmSizes'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_dedicated_host_groups_operations.py new file mode 100644 index 000000000000..79f0fb8ebc96 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_dedicated_host_groups_operations.py @@ -0,0 +1,445 @@ +# 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 + +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 DedicatedHostGroupsOperations(object): + """DedicatedHostGroupsOperations 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_06_01.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( + self, + resource_group_name, # type: str + host_group_name, # type: str + parameters, # type: "models.DedicatedHostGroup" + **kwargs # type: Any + ): + # type: (...) -> "models.DedicatedHostGroup" + """Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host + Groups please see [Dedicated Host Documentation] + (https://go.microsoft.com/fwlink/?linkid=2082596). + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param host_group_name: The name of the dedicated host group. + :type host_group_name: str + :param parameters: Parameters supplied to the Create Dedicated Host Group. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.DedicatedHostGroup + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DedicatedHostGroup, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.DedicatedHostGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + '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') + + # 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(parameters, 'DedicatedHostGroup') + 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, 201]: + 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('DedicatedHostGroup', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DedicatedHostGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + host_group_name, # type: str + parameters, # type: "models.DedicatedHostGroupUpdate" + **kwargs # type: Any + ): + # type: (...) -> "models.DedicatedHostGroup" + """Update an dedicated host group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param host_group_name: The name of the dedicated host group. + :type host_group_name: str + :param parameters: Parameters supplied to the Update Dedicated Host Group operation. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.DedicatedHostGroupUpdate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DedicatedHostGroup, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.DedicatedHostGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + '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') + + # 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(parameters, 'DedicatedHostGroupUpdate') + 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DedicatedHostGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + host_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a dedicated host group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param host_group_name: The name of the dedicated host group. + :type host_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-06-01" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + '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') + + # 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, 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + host_group_name, # type: str + expand="instanceView", # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.DedicatedHostGroup" + """Retrieves information about a dedicated host group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param host_group_name: The name of the dedicated host group. + :type host_group_name: str + :param expand: The expand expression to apply on the operation. The response shows the list of + instance view of the dedicated hosts under the dedicated host group. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DedicatedHostGroup, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.DedicatedHostGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + '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] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + 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('DedicatedHostGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.DedicatedHostGroupListResult"] + """Lists all of the dedicated host groups in the specified resource group. Use the nextLink + property in the response to get the next page of dedicated host groups. + + :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 DedicatedHostGroupListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.DedicatedHostGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + '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('DedicatedHostGroupListResult', 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/hostGroups'} # type: ignore + + def list_by_subscription( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.DedicatedHostGroupListResult"] + """Lists all of the dedicated host groups in the subscription. Use the nextLink property in the + response to get the next page of dedicated host groups. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DedicatedHostGroupListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.DedicatedHostGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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_subscription.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('DedicatedHostGroupListResult', 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_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/hostGroups'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_dedicated_hosts_operations.py new file mode 100644 index 000000000000..a5b7c07a63c1 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_dedicated_hosts_operations.py @@ -0,0 +1,556 @@ +# 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 + +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 DedicatedHostsOperations(object): + """DedicatedHostsOperations 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_06_01.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 + host_group_name, # type: str + host_name, # type: str + parameters, # type: "models.DedicatedHost" + **kwargs # type: Any + ): + # type: (...) -> "models.DedicatedHost" + cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + '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') + + # 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(parameters, 'DedicatedHost') + 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, 201]: + 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('DedicatedHost', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DedicatedHost', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + host_group_name, # type: str + host_name, # type: str + parameters, # type: "models.DedicatedHost" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.DedicatedHost"] + """Create or update a dedicated host . + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param host_group_name: The name of the dedicated host group. + :type host_group_name: str + :param host_name: The name of the dedicated host . + :type host_name: str + :param parameters: Parameters supplied to the Create Dedicated Host. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.DedicatedHost + :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 DedicatedHost or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_06_01.models.DedicatedHost] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + 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, + host_group_name=host_group_name, + host_name=host_name, + parameters=parameters, + 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('DedicatedHost', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = ARMPolling(lro_delay, **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/hostGroups/{hostGroupName}/hosts/{hostName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + host_group_name, # type: str + host_name, # type: str + parameters, # type: "models.DedicatedHostUpdate" + **kwargs # type: Any + ): + # type: (...) -> "models.DedicatedHost" + cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + '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') + + # 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(parameters, 'DedicatedHostUpdate') + 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DedicatedHost', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + host_group_name, # type: str + host_name, # type: str + parameters, # type: "models.DedicatedHostUpdate" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.DedicatedHost"] + """Update an dedicated host . + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param host_group_name: The name of the dedicated host group. + :type host_group_name: str + :param host_name: The name of the dedicated host . + :type host_name: str + :param parameters: Parameters supplied to the Update Dedicated Host operation. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.DedicatedHostUpdate + :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 DedicatedHost or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_06_01.models.DedicatedHost] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + 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, + host_group_name=host_group_name, + host_name=host_name, + parameters=parameters, + 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('DedicatedHost', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = ARMPolling(lro_delay, **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/hostGroups/{hostGroupName}/hosts/{hostName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + host_group_name, # type: str + host_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-06-01" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + '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') + + # 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/hostGroups/{hostGroupName}/hosts/{hostName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + host_group_name, # type: str + host_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Delete a dedicated host. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param host_group_name: The name of the dedicated host group. + :type host_group_name: str + :param host_name: The name of the dedicated host. + :type host_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, + host_group_name=host_group_name, + host_name=host_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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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/hostGroups/{hostGroupName}/hosts/{hostName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + host_group_name, # type: str + host_name, # type: str + expand="instanceView", # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.DedicatedHost" + """Retrieves information about a dedicated host. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param host_group_name: The name of the dedicated host group. + :type host_group_name: str + :param host_name: The name of the dedicated host. + :type host_name: str + :param expand: The expand expression to apply on the operation. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DedicatedHost, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.DedicatedHost + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + '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] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + 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('DedicatedHost', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}'} # type: ignore + + def list_by_host_group( + self, + resource_group_name, # type: str + host_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.DedicatedHostListResult"] + """Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink + property in the response to get the next page of dedicated hosts. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param host_group_name: The name of the dedicated host group. + :type host_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 DedicatedHostListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.DedicatedHostListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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_host_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + '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('DedicatedHostListResult', 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_host_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_images_operations.py new file mode 100644 index 000000000000..dd4e0dd1c34e --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_images_operations.py @@ -0,0 +1,601 @@ +# 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 + +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 ImagesOperations(object): + """ImagesOperations 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_06_01.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 + image_name, # type: str + parameters, # type: "models.Image" + **kwargs # type: Any + ): + # type: (...) -> "models.Image" + cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + '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') + + # 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(parameters, 'Image') + 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, 201]: + 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('Image', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Image', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + image_name, # type: str + parameters, # type: "models.Image" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.Image"] + """Create or update an image. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param image_name: The name of the image. + :type image_name: str + :param parameters: Parameters supplied to the Create Image operation. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.Image + :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 Image or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_06_01.models.Image] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + 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, + image_name=image_name, + parameters=parameters, + 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('Image', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = ARMPolling(lro_delay, **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/images/{imageName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + image_name, # type: str + parameters, # type: "models.ImageUpdate" + **kwargs # type: Any + ): + # type: (...) -> "models.Image" + cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + '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') + + # 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(parameters, 'ImageUpdate') + 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, 201]: + 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('Image', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Image', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + image_name, # type: str + parameters, # type: "models.ImageUpdate" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.Image"] + """Update an image. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param image_name: The name of the image. + :type image_name: str + :param parameters: Parameters supplied to the Update Image operation. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.ImageUpdate + :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 Image or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_06_01.models.Image] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + 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, + image_name=image_name, + parameters=parameters, + 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('Image', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = ARMPolling(lro_delay, **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/images/{imageName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + image_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-06-01" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + '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') + + # 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/images/{imageName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + image_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes an Image. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param image_name: The name of the image. + :type image_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, + image_name=image_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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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/images/{imageName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + image_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.Image" + """Gets an image. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param image_name: The name of the image. + :type image_name: str + :param expand: The expand expression to apply on the operation. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Image, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.Image + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + '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] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + 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('Image', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.ImageListResult"] + """Gets the list of images 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 ImageListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.ImageListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + '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('ImageListResult', 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/images'} # type: ignore + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.ImageListResult"] + """Gets the list of Images in the subscription. Use nextLink property in the response to get the + next page of Images. Do this till nextLink is null to fetch all the Images. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ImageListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.ImageListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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('ImageListResult', 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/images'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_log_analytics_operations.py new file mode 100644 index 000000000000..7ffe9ff1cb31 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_log_analytics_operations.py @@ -0,0 +1,281 @@ +# 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.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 + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class LogAnalyticsOperations(object): + """LogAnalyticsOperations 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_06_01.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 _export_request_rate_by_interval_initial( + self, + location, # type: str + parameters, # type: "models.RequestRateByIntervalInput" + **kwargs # type: Any + ): + # type: (...) -> Optional["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._export_request_rate_by_interval_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + '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') + + # 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(parameters, 'RequestRateByIntervalInput') + 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('LogAnalyticsOperationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _export_request_rate_by_interval_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getRequestRateByInterval'} # type: ignore + + def begin_export_request_rate_by_interval( + self, + location, # type: str + parameters, # type: "models.RequestRateByIntervalInput" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.LogAnalyticsOperationResult"] + """Export logs that show Api requests made by this subscription in the given time window to show + throttling activities. + + :param location: The location upon which virtual-machine-sizes is queried. + :type location: str + :param parameters: Parameters supplied to the LogAnalytics getRequestRateByInterval Api. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.RequestRateByIntervalInput + :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 LogAnalyticsOperationResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_06_01.models.LogAnalyticsOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] + 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._export_request_rate_by_interval_initial( + location=location, + parameters=parameters, + 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('LogAnalyticsOperationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_export_request_rate_by_interval.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getRequestRateByInterval'} # type: ignore + + def _export_throttled_requests_initial( + self, + location, # type: str + parameters, # type: "models.LogAnalyticsInputBase" + **kwargs # type: Any + ): + # type: (...) -> Optional["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._export_throttled_requests_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + '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') + + # 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(parameters, 'LogAnalyticsInputBase') + 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('LogAnalyticsOperationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _export_throttled_requests_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getThrottledRequests'} # type: ignore + + def begin_export_throttled_requests( + self, + location, # type: str + parameters, # type: "models.LogAnalyticsInputBase" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.LogAnalyticsOperationResult"] + """Export logs that show total throttled Api requests for this subscription in the given time + window. + + :param location: The location upon which virtual-machine-sizes is queried. + :type location: str + :param parameters: Parameters supplied to the LogAnalytics getThrottledRequests Api. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.LogAnalyticsInputBase + :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 LogAnalyticsOperationResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_06_01.models.LogAnalyticsOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] + 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._export_throttled_requests_initial( + location=location, + parameters=parameters, + 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('LogAnalyticsOperationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_export_throttled_requests.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getThrottledRequests'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_operations.py new file mode 100644 index 000000000000..44bff37857c6 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_operations.py @@ -0,0 +1,109 @@ +# 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 + +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 Operations(object): + """Operations 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_06_01.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 list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.ComputeOperationListResult"] + """Gets a list of compute operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ComputeOperationListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.ComputeOperationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeOperationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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 + # 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('ComputeOperationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return 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': '/providers/Microsoft.Compute/operations'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_proximity_placement_groups_operations.py new file mode 100644 index 000000000000..8e71ef581a63 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_proximity_placement_groups_operations.py @@ -0,0 +1,441 @@ +# 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 + +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 ProximityPlacementGroupsOperations(object): + """ProximityPlacementGroupsOperations 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_06_01.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( + self, + resource_group_name, # type: str + proximity_placement_group_name, # type: str + parameters, # type: "models.ProximityPlacementGroup" + **kwargs # type: Any + ): + # type: (...) -> "models.ProximityPlacementGroup" + """Create or update a proximity placement group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param proximity_placement_group_name: The name of the proximity placement group. + :type proximity_placement_group_name: str + :param parameters: Parameters supplied to the Create Proximity Placement Group operation. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.ProximityPlacementGroup + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProximityPlacementGroup, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.ProximityPlacementGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'proximityPlacementGroupName': self._serialize.url("proximity_placement_group_name", proximity_placement_group_name, 'str'), + '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') + + # 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(parameters, 'ProximityPlacementGroup') + 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, 201]: + 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('ProximityPlacementGroup', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ProximityPlacementGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + proximity_placement_group_name, # type: str + parameters, # type: "models.UpdateResource" + **kwargs # type: Any + ): + # type: (...) -> "models.ProximityPlacementGroup" + """Update a proximity placement group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param proximity_placement_group_name: The name of the proximity placement group. + :type proximity_placement_group_name: str + :param parameters: Parameters supplied to the Update Proximity Placement Group operation. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.UpdateResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProximityPlacementGroup, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.ProximityPlacementGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'proximityPlacementGroupName': self._serialize.url("proximity_placement_group_name", proximity_placement_group_name, 'str'), + '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') + + # 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(parameters, 'UpdateResource') + 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ProximityPlacementGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + proximity_placement_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a proximity placement group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param proximity_placement_group_name: The name of the proximity placement group. + :type proximity_placement_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-06-01" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'proximityPlacementGroupName': self._serialize.url("proximity_placement_group_name", proximity_placement_group_name, 'str'), + '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') + + # 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]: + 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + proximity_placement_group_name, # type: str + include_colocation_status=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.ProximityPlacementGroup" + """Retrieves information about a proximity placement group . + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param proximity_placement_group_name: The name of the proximity placement group. + :type proximity_placement_group_name: str + :param include_colocation_status: includeColocationStatus=true enables fetching the colocation + status of all the resources in the proximity placement group. + :type include_colocation_status: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProximityPlacementGroup, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.ProximityPlacementGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'proximityPlacementGroupName': self._serialize.url("proximity_placement_group_name", proximity_placement_group_name, 'str'), + '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] + if include_colocation_status is not None: + query_parameters['includeColocationStatus'] = self._serialize.query("include_colocation_status", include_colocation_status, 'str') + 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('ProximityPlacementGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}'} # type: ignore + + def list_by_subscription( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.ProximityPlacementGroupListResult"] + """Lists all proximity placement groups in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProximityPlacementGroupListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.ProximityPlacementGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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_subscription.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('ProximityPlacementGroupListResult', 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_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/proximityPlacementGroups'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.ProximityPlacementGroupListResult"] + """Lists all proximity placement groups in 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 ProximityPlacementGroupListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.ProximityPlacementGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + '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('ProximityPlacementGroupListResult', 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/proximityPlacementGroups'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_ssh_public_keys_operations.py new file mode 100644 index 000000000000..180952c99c94 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_ssh_public_keys_operations.py @@ -0,0 +1,498 @@ +# 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 + +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 SshPublicKeysOperations(object): + """SshPublicKeysOperations 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_06_01.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 list_by_subscription( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.SshPublicKeysGroupListResult"] + """Lists all of the SSH public keys in the subscription. Use the nextLink property in the response + to get the next page of SSH public keys. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SshPublicKeysGroupListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.SshPublicKeysGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeysGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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_subscription.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('SshPublicKeysGroupListResult', 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_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/sshPublicKeys'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.SshPublicKeysGroupListResult"] + """Lists all of the SSH public keys in the specified resource group. Use the nextLink property in + the response to get the next page of SSH public keys. + + :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 SshPublicKeysGroupListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.SshPublicKeysGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeysGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + '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('SshPublicKeysGroupListResult', 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/sshPublicKeys'} # type: ignore + + def create( + self, + resource_group_name, # type: str + ssh_public_key_name, # type: str + parameters, # type: "models.SshPublicKeyResource" + **kwargs # type: Any + ): + # type: (...) -> "models.SshPublicKeyResource" + """Creates a new SSH public key resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ssh_public_key_name: The name of the SSH public key. + :type ssh_public_key_name: str + :param parameters: Parameters supplied to create the SSH public key. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.SshPublicKeyResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SshPublicKeyResource, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.SshPublicKeyResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeyResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sshPublicKeyName': self._serialize.url("ssh_public_key_name", ssh_public_key_name, 'str'), + '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') + + # 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(parameters, 'SshPublicKeyResource') + 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, 201]: + 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('SshPublicKeyResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SshPublicKeyResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + ssh_public_key_name, # type: str + parameters, # type: "models.SshPublicKeyUpdateResource" + **kwargs # type: Any + ): + # type: (...) -> "models.SshPublicKeyResource" + """Updates a new SSH public key resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ssh_public_key_name: The name of the SSH public key. + :type ssh_public_key_name: str + :param parameters: Parameters supplied to update the SSH public key. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.SshPublicKeyUpdateResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SshPublicKeyResource, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.SshPublicKeyResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeyResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sshPublicKeyName': self._serialize.url("ssh_public_key_name", ssh_public_key_name, 'str'), + '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') + + # 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(parameters, 'SshPublicKeyUpdateResource') + 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SshPublicKeyResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + ssh_public_key_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete an SSH public key. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ssh_public_key_name: The name of the SSH public key. + :type ssh_public_key_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-06-01" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sshPublicKeyName': self._serialize.url("ssh_public_key_name", ssh_public_key_name, 'str'), + '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') + + # 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, 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + ssh_public_key_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.SshPublicKeyResource" + """Retrieves information about an SSH public key. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ssh_public_key_name: The name of the SSH public key. + :type ssh_public_key_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SshPublicKeyResource, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.SshPublicKeyResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeyResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sshPublicKeyName': self._serialize.url("ssh_public_key_name", ssh_public_key_name, 'str'), + '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') + + # 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('SshPublicKeyResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}'} # type: ignore + + def generate_key_pair( + self, + resource_group_name, # type: str + ssh_public_key_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.SshPublicKeyGenerateKeyPairResult" + """Generates and returns a public/private key pair and populates the SSH public key resource with + the public key. The length of the key will be 3072 bits. This operation can only be performed + once per SSH public key resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ssh_public_key_name: The name of the SSH public key. + :type ssh_public_key_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SshPublicKeyGenerateKeyPairResult, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.SshPublicKeyGenerateKeyPairResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeyGenerateKeyPairResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.generate_key_pair.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sshPublicKeyName': self._serialize.url("ssh_public_key_name", ssh_public_key_name, 'str'), + '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SshPublicKeyGenerateKeyPairResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + generate_key_pair.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}/generateKeyPair'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_usage_operations.py new file mode 100644 index 000000000000..4c7e6beba9e9 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_usage_operations.py @@ -0,0 +1,118 @@ +# 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 + +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 UsageOperations(object): + """UsageOperations 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_06_01.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 list( + self, + location, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.ListUsagesResult"] + """Gets, for the specified location, the current compute resource usage information as well as the + limits for compute resources under the subscription. + + :param location: The location for which resource usage is queried. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListUsagesResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.ListUsagesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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 = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + '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('ListUsagesResult', 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/locations/{location}/usages'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_extension_images_operations.py new file mode 100644 index 000000000000..acccd3ea823e --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_extension_images_operations.py @@ -0,0 +1,249 @@ +# 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.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VirtualMachineExtensionImagesOperations(object): + """VirtualMachineExtensionImagesOperations 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_06_01.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, + location, # type: str + publisher_name, # type: str + type, # type: str + version, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.VirtualMachineExtensionImage" + """Gets a virtual machine extension image. + + :param location: The name of a supported Azure region. + :type location: str + :param publisher_name: + :type publisher_name: str + :param type: + :type type: str + :param version: + :type version: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualMachineExtensionImage, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtensionImage + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), + 'type': self._serialize.url("type", type, 'str'), + 'version': self._serialize.url("version", version, 'str'), + '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') + + # 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('VirtualMachineExtensionImage', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}'} # type: ignore + + def list_types( + self, + location, # type: str + publisher_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["models.VirtualMachineExtensionImage"] + """Gets a list of virtual machine extension image types. + + :param location: The name of a supported Azure region. + :type location: str + :param publisher_name: + :type publisher_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VirtualMachineExtensionImage, or the result of cls(response) + :rtype: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtensionImage] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_types.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), + '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') + + # 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('[VirtualMachineExtensionImage]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_types.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types'} # type: ignore + + def list_versions( + self, + location, # type: str + publisher_name, # type: str + type, # type: str + filter=None, # type: Optional[str] + top=None, # type: Optional[int] + orderby=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> List["models.VirtualMachineExtensionImage"] + """Gets a list of virtual machine extension image versions. + + :param location: The name of a supported Azure region. + :type location: str + :param publisher_name: + :type publisher_name: str + :param type: + :type type: str + :param filter: The filter to apply on the operation. + :type filter: str + :param top: + :type top: int + :param orderby: + :type orderby: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VirtualMachineExtensionImage, or the result of cls(response) + :rtype: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtensionImage] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_versions.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), + 'type': self._serialize.url("type", type, 'str'), + '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] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + 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('[VirtualMachineExtensionImage]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_versions.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_extensions_operations.py new file mode 100644 index 000000000000..cea48dfdc574 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_extensions_operations.py @@ -0,0 +1,546 @@ +# 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.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 + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VirtualMachineExtensionsOperations(object): + """VirtualMachineExtensionsOperations 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_06_01.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 + vm_name, # type: str + vm_extension_name, # type: str + extension_parameters, # type: "models.VirtualMachineExtension" + **kwargs # type: Any + ): + # type: (...) -> "models.VirtualMachineExtension" + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + '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') + + # 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(extension_parameters, 'VirtualMachineExtension') + 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, 201]: + 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('VirtualMachineExtension', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualMachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + vm_name, # type: str + vm_extension_name, # type: str + extension_parameters, # type: "models.VirtualMachineExtension" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.VirtualMachineExtension"] + """The operation to create or update the extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine where the extension should be created or + updated. + :type vm_name: str + :param vm_extension_name: The name of the virtual machine extension. + :type vm_extension_name: str + :param extension_parameters: Parameters supplied to the Create Virtual Machine Extension + operation. + :type extension_parameters: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtension + :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 VirtualMachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + 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, + vm_name=vm_name, + vm_extension_name=vm_extension_name, + extension_parameters=extension_parameters, + 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('VirtualMachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = ARMPolling(lro_delay, **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/virtualMachines/{vmName}/extensions/{vmExtensionName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + vm_name, # type: str + vm_extension_name, # type: str + extension_parameters, # type: "models.VirtualMachineExtensionUpdate" + **kwargs # type: Any + ): + # type: (...) -> "models.VirtualMachineExtension" + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + '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') + + # 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(extension_parameters, 'VirtualMachineExtensionUpdate') + 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualMachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + vm_name, # type: str + vm_extension_name, # type: str + extension_parameters, # type: "models.VirtualMachineExtensionUpdate" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.VirtualMachineExtension"] + """The operation to update the extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine where the extension should be updated. + :type vm_name: str + :param vm_extension_name: The name of the virtual machine extension. + :type vm_extension_name: str + :param extension_parameters: Parameters supplied to the Update Virtual Machine Extension + operation. + :type extension_parameters: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtensionUpdate + :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 VirtualMachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + 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, + vm_name=vm_name, + vm_extension_name=vm_extension_name, + extension_parameters=extension_parameters, + 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('VirtualMachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = ARMPolling(lro_delay, **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/virtualMachines/{vmName}/extensions/{vmExtensionName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + vm_name, # type: str + vm_extension_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-06-01" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + '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') + + # 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/virtualMachines/{vmName}/extensions/{vmExtensionName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + vm_name, # type: str + vm_extension_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """The operation to delete the extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine where the extension should be deleted. + :type vm_name: str + :param vm_extension_name: The name of the virtual machine extension. + :type vm_extension_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, + vm_name=vm_name, + vm_extension_name=vm_extension_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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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/virtualMachines/{vmName}/extensions/{vmExtensionName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + vm_name, # type: str + vm_extension_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.VirtualMachineExtension" + """The operation to get the extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine containing the extension. + :type vm_name: str + :param vm_extension_name: The name of the virtual machine extension. + :type vm_extension_name: str + :param expand: The expand expression to apply on the operation. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualMachineExtension, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtension + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + '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] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + 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('VirtualMachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + vm_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.VirtualMachineExtensionsListResult" + """The operation to get all extensions of a Virtual Machine. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine containing the extension. + :type vm_name: str + :param expand: The expand expression to apply on the operation. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualMachineExtensionsListResult, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtensionsListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + 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('VirtualMachineExtensionsListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_images_operations.py new file mode 100644 index 000000000000..1c31c270461e --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_images_operations.py @@ -0,0 +1,376 @@ +# 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.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VirtualMachineImagesOperations(object): + """VirtualMachineImagesOperations 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_06_01.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, + location, # type: str + publisher_name, # type: str + offer, # type: str + skus, # type: str + version, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.VirtualMachineImage" + """Gets a virtual machine image. + + :param location: The name of a supported Azure region. + :type location: str + :param publisher_name: A valid image publisher. + :type publisher_name: str + :param offer: A valid image publisher offer. + :type offer: str + :param skus: A valid image SKU. + :type skus: str + :param version: A valid image SKU version. + :type version: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualMachineImage, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineImage + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), + 'offer': self._serialize.url("offer", offer, 'str'), + 'skus': self._serialize.url("skus", skus, 'str'), + 'version': self._serialize.url("version", version, 'str'), + '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') + + # 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('VirtualMachineImage', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}'} # type: ignore + + def list( + self, + location, # type: str + publisher_name, # type: str + offer, # type: str + skus, # type: str + expand=None, # type: Optional[str] + top=None, # type: Optional[int] + orderby=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> List["models.VirtualMachineImageResource"] + """Gets a list of all virtual machine image versions for the specified location, publisher, offer, + and SKU. + + :param location: The name of a supported Azure region. + :type location: str + :param publisher_name: A valid image publisher. + :type publisher_name: str + :param offer: A valid image publisher offer. + :type offer: str + :param skus: A valid image SKU. + :type skus: str + :param expand: The expand expression to apply on the operation. + :type expand: str + :param top: + :type top: int + :param orderby: + :type orderby: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VirtualMachineImageResource, or the result of cls(response) + :rtype: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineImageResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), + 'offer': self._serialize.url("offer", offer, 'str'), + 'skus': self._serialize.url("skus", skus, 'str'), + '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] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + 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('[VirtualMachineImageResource]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions'} # type: ignore + + def list_offers( + self, + location, # type: str + publisher_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["models.VirtualMachineImageResource"] + """Gets a list of virtual machine image offers for the specified location and publisher. + + :param location: The name of a supported Azure region. + :type location: str + :param publisher_name: A valid image publisher. + :type publisher_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VirtualMachineImageResource, or the result of cls(response) + :rtype: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineImageResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_offers.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), + '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') + + # 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('[VirtualMachineImageResource]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_offers.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers'} # type: ignore + + def list_publishers( + self, + location, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["models.VirtualMachineImageResource"] + """Gets a list of virtual machine image publishers for the specified Azure location. + + :param location: The name of a supported Azure region. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VirtualMachineImageResource, or the result of cls(response) + :rtype: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineImageResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_publishers.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + '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') + + # 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('[VirtualMachineImageResource]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_publishers.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers'} # type: ignore + + def list_skus( + self, + location, # type: str + publisher_name, # type: str + offer, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["models.VirtualMachineImageResource"] + """Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. + + :param location: The name of a supported Azure region. + :type location: str + :param publisher_name: A valid image publisher. + :type publisher_name: str + :param offer: A valid image publisher offer. + :type offer: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VirtualMachineImageResource, or the result of cls(response) + :rtype: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineImageResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_skus.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), + 'offer': self._serialize.url("offer", offer, 'str'), + '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') + + # 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('[VirtualMachineImageResource]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_run_commands_operations.py new file mode 100644 index 000000000000..8acf5a168394 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_run_commands_operations.py @@ -0,0 +1,176 @@ +# 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 + +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 VirtualMachineRunCommandsOperations(object): + """VirtualMachineRunCommandsOperations 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_06_01.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 list( + self, + location, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.RunCommandListResult"] + """Lists all available run commands for a subscription in a location. + + :param location: The location upon which run commands is queried. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RunCommandListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.RunCommandListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json, text/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 = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + '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('RunCommandListResult', 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/locations/{location}/runCommands'} # type: ignore + + def get( + self, + location, # type: str + command_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.RunCommandDocument" + """Gets specific run command for a subscription in a location. + + :param location: The location upon which run commands is queried. + :type location: str + :param command_id: The command id. + :type command_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RunCommandDocument, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.RunCommandDocument + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandDocument"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json, text/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'commandId': self._serialize.url("command_id", command_id, 'str'), + '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') + + # 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('RunCommandDocument', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands/{commandId}'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_extensions_operations.py new file mode 100644 index 000000000000..5e0ada43ed90 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -0,0 +1,562 @@ +# 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 + +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 VirtualMachineScaleSetExtensionsOperations(object): + """VirtualMachineScaleSetExtensionsOperations 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_06_01.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 + vm_scale_set_name, # type: str + vmss_extension_name, # type: str + extension_parameters, # type: "models.VirtualMachineScaleSetExtension" + **kwargs # type: Any + ): + # type: (...) -> "models.VirtualMachineScaleSetExtension" + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + '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') + + # 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(extension_parameters, 'VirtualMachineScaleSetExtension') + 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, 201]: + 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('VirtualMachineScaleSetExtension', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualMachineScaleSetExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + vmss_extension_name, # type: str + extension_parameters, # type: "models.VirtualMachineScaleSetExtension" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.VirtualMachineScaleSetExtension"] + """The operation to create or update an extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set where the extension should be create or + updated. + :type vm_scale_set_name: str + :param vmss_extension_name: The name of the VM scale set extension. + :type vmss_extension_name: str + :param extension_parameters: Parameters supplied to the Create VM scale set Extension + operation. + :type extension_parameters: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetExtension + :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 VirtualMachineScaleSetExtension or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetExtension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + 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, + vm_scale_set_name=vm_scale_set_name, + vmss_extension_name=vmss_extension_name, + extension_parameters=extension_parameters, + 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('VirtualMachineScaleSetExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = ARMPolling(lro_delay, **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/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + vmss_extension_name, # type: str + extension_parameters, # type: "models.VirtualMachineScaleSetExtensionUpdate" + **kwargs # type: Any + ): + # type: (...) -> "models.VirtualMachineScaleSetExtension" + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + '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') + + # 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(extension_parameters, 'VirtualMachineScaleSetExtensionUpdate') + 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, 201]: + 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('VirtualMachineScaleSetExtension', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualMachineScaleSetExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + vmss_extension_name, # type: str + extension_parameters, # type: "models.VirtualMachineScaleSetExtensionUpdate" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.VirtualMachineScaleSetExtension"] + """The operation to update an extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set where the extension should be updated. + :type vm_scale_set_name: str + :param vmss_extension_name: The name of the VM scale set extension. + :type vmss_extension_name: str + :param extension_parameters: Parameters supplied to the Update VM scale set Extension + operation. + :type extension_parameters: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetExtensionUpdate + :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 VirtualMachineScaleSetExtension or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetExtension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + 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, + vm_scale_set_name=vm_scale_set_name, + vmss_extension_name=vmss_extension_name, + extension_parameters=extension_parameters, + 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('VirtualMachineScaleSetExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = ARMPolling(lro_delay, **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/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + vmss_extension_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-06-01" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + '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') + + # 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/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + vmss_extension_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """The operation to delete the extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set where the extension should be deleted. + :type vm_scale_set_name: str + :param vmss_extension_name: The name of the VM scale set extension. + :type vmss_extension_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, + vm_scale_set_name=vm_scale_set_name, + vmss_extension_name=vmss_extension_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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + vmss_extension_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.VirtualMachineScaleSetExtension" + """The operation to get the extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set containing the extension. + :type vm_scale_set_name: str + :param vmss_extension_name: The name of the VM scale set extension. + :type vmss_extension_name: str + :param expand: The expand expression to apply on the operation. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualMachineScaleSetExtension, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetExtension + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + '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] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + 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('VirtualMachineScaleSetExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.VirtualMachineScaleSetExtensionListResult"] + """Gets a list of all extensions in a VM scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set containing the extension. + :type vm_scale_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 VirtualMachineScaleSetExtensionListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetExtensionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtensionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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('VirtualMachineScaleSetExtensionListResult', 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py new file mode 100644 index 000000000000..61d959420bc8 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -0,0 +1,416 @@ +# 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.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 + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VirtualMachineScaleSetRollingUpgradesOperations(object): + """VirtualMachineScaleSetRollingUpgradesOperations 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_06_01.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 _cancel_initial( + self, + resource_group_name, # type: str + vm_scale_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-06-01" + + # Construct URL + url = self._cancel_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # 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, {}) + + _cancel_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/cancel'} # type: ignore + + def begin_cancel( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Cancels the current virtual machine scale set rolling upgrade. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_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._cancel_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/cancel'} # type: ignore + + def _start_os_upgrade_initial( + self, + resource_group_name, # type: str + vm_scale_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-06-01" + + # Construct URL + url = self._start_os_upgrade_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # 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, {}) + + _start_os_upgrade_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osRollingUpgrade'} # type: ignore + + def begin_start_os_upgrade( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Starts a rolling upgrade to move all virtual machine scale set instances to the latest + available Platform Image OS version. Instances which are already running the latest available + OS version are not affected. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_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._start_os_upgrade_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_start_os_upgrade.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osRollingUpgrade'} # type: ignore + + def _start_extension_upgrade_initial( + self, + resource_group_name, # type: str + vm_scale_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-06-01" + + # Construct URL + url = self._start_extension_upgrade_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # 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, {}) + + _start_extension_upgrade_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensionRollingUpgrade'} # type: ignore + + def begin_start_extension_upgrade( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to + the latest available extension version. Instances which are already running the latest + extension versions are not affected. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_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._start_extension_upgrade_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_start_extension_upgrade.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensionRollingUpgrade'} # type: ignore + + def get_latest( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.RollingUpgradeStatusInfo" + """Gets the status of the latest virtual machine scale set rolling upgrade. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RollingUpgradeStatusInfo, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.RollingUpgradeStatusInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RollingUpgradeStatusInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_latest.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # 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('RollingUpgradeStatusInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_latest.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/latest'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py new file mode 100644 index 000000000000..289855936133 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -0,0 +1,573 @@ +# 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.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 + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VirtualMachineScaleSetVMExtensionsOperations(object): + """VirtualMachineScaleSetVMExtensionsOperations 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_06_01.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 + vm_scale_set_name, # type: str + instance_id, # type: str + vm_extension_name, # type: str + extension_parameters, # type: "models.VirtualMachineExtension" + **kwargs # type: Any + ): + # type: (...) -> "models.VirtualMachineExtension" + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + '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') + + # 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(extension_parameters, 'VirtualMachineExtension') + 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, 201]: + 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('VirtualMachineExtension', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualMachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + vm_extension_name, # type: str + extension_parameters, # type: "models.VirtualMachineExtension" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.VirtualMachineExtension"] + """The operation to create or update the VMSS VM extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: str + :param vm_extension_name: The name of the virtual machine extension. + :type vm_extension_name: str + :param extension_parameters: Parameters supplied to the Create Virtual Machine Extension + operation. + :type extension_parameters: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtension + :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 VirtualMachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + 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, + vm_scale_set_name=vm_scale_set_name, + instance_id=instance_id, + vm_extension_name=vm_extension_name, + extension_parameters=extension_parameters, + 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('VirtualMachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = ARMPolling(lro_delay, **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/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + vm_extension_name, # type: str + extension_parameters, # type: "models.VirtualMachineExtensionUpdate" + **kwargs # type: Any + ): + # type: (...) -> "models.VirtualMachineExtension" + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + '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') + + # 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(extension_parameters, 'VirtualMachineExtensionUpdate') + 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualMachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + vm_extension_name, # type: str + extension_parameters, # type: "models.VirtualMachineExtensionUpdate" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.VirtualMachineExtension"] + """The operation to update the VMSS VM extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: str + :param vm_extension_name: The name of the virtual machine extension. + :type vm_extension_name: str + :param extension_parameters: Parameters supplied to the Update Virtual Machine Extension + operation. + :type extension_parameters: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtensionUpdate + :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 VirtualMachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + 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, + vm_scale_set_name=vm_scale_set_name, + instance_id=instance_id, + vm_extension_name=vm_extension_name, + extension_parameters=extension_parameters, + 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('VirtualMachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = ARMPolling(lro_delay, **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/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + vm_extension_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-06-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + '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') + + # 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/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + vm_extension_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """The operation to delete the VMSS VM extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: str + :param vm_extension_name: The name of the virtual machine extension. + :type vm_extension_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, + vm_scale_set_name=vm_scale_set_name, + instance_id=instance_id, + vm_extension_name=vm_extension_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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + vm_extension_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.VirtualMachineExtension" + """The operation to get the VMSS VM extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: str + :param vm_extension_name: The name of the virtual machine extension. + :type vm_extension_name: str + :param expand: The expand expression to apply on the operation. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualMachineExtension, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtension + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + '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] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + 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('VirtualMachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.VirtualMachineExtensionsListResult" + """The operation to get all extensions of an instance in Virtual Machine Scaleset. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: str + :param expand: The expand expression to apply on the operation. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualMachineExtensionsListResult, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtensionsListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + '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] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + 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('VirtualMachineExtensionsListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vms_operations.py new file mode 100644 index 000000000000..6ec84f5d9ab2 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -0,0 +1,1660 @@ +# 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 + +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 VirtualMachineScaleSetVMsOperations(object): + """VirtualMachineScaleSetVMsOperations 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_06_01.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 _reimage_initial( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + vm_scale_set_vm_reimage_input=None, # type: Optional["models.VirtualMachineReimageParameters"] + **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-06-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._reimage_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if vm_scale_set_vm_reimage_input is not None: + body_content = self._serialize.body(vm_scale_set_vm_reimage_input, 'VirtualMachineReimageParameters') + else: + body_content = None + 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) + + if cls: + return cls(pipeline_response, None, {}) + + _reimage_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimage'} # type: ignore + + def begin_reimage( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + vm_scale_set_vm_reimage_input=None, # type: Optional["models.VirtualMachineReimageParameters"] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: str + :param vm_scale_set_vm_reimage_input: Parameters for the Reimaging Virtual machine in ScaleSet. + :type vm_scale_set_vm_reimage_input: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineReimageParameters + :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._reimage_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + instance_id=instance_id, + vm_scale_set_vm_reimage_input=vm_scale_set_vm_reimage_input, + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_reimage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimage'} # type: ignore + + def _reimage_all_initial( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # 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-06-01" + + # Construct URL + url = self._reimage_all_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + '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') + + # 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, {}) + + _reimage_all_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimageall'} # type: ignore + + def begin_reimage_all( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. + This operation is only supported for managed disks. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: 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._reimage_all_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + instance_id=instance_id, + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_reimage_all.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimageall'} # type: ignore + + def _deallocate_initial( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # 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-06-01" + + # Construct URL + url = self._deallocate_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + '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') + + # 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, {}) + + _deallocate_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate'} # type: ignore + + def begin_deallocate( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and + releases the compute resources it uses. You are not billed for the compute resources of this + virtual machine once it is deallocated. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: 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._deallocate_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + instance_id=instance_id, + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_deallocate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + parameters, # type: "models.VirtualMachineScaleSetVM" + **kwargs # type: Any + ): + # type: (...) -> "models.VirtualMachineScaleSetVM" + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + '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') + + # 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(parameters, 'VirtualMachineScaleSetVM') + 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('VirtualMachineScaleSetVM', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('VirtualMachineScaleSetVM', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + parameters, # type: "models.VirtualMachineScaleSetVM" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.VirtualMachineScaleSetVM"] + """Updates a virtual machine of a VM scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set where the extension should be create or + updated. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: str + :param parameters: Parameters supplied to the Update Virtual Machine Scale Sets VM operation. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVM + :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 VirtualMachineScaleSetVM or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVM] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + 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, + vm_scale_set_name=vm_scale_set_name, + instance_id=instance_id, + parameters=parameters, + 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('VirtualMachineScaleSetVM', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = ARMPolling(lro_delay, **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/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # 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-06-01" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + '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') + + # 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/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a virtual machine from a VM scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: 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, + vm_scale_set_name=vm_scale_set_name, + instance_id=instance_id, + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + expand="instanceView", # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.VirtualMachineScaleSetVM" + """Gets a virtual machine from a VM scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: str + :param expand: The expand expression to apply on the operation. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualMachineScaleSetVM, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVM + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + '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] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + 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('VirtualMachineScaleSetVM', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'} # type: ignore + + def get_instance_view( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.VirtualMachineScaleSetVMInstanceView" + """Gets the status of a virtual machine from a VM scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualMachineScaleSetVMInstanceView, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMInstanceView + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_view.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + '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') + + # 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('VirtualMachineScaleSetVMInstanceView', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_view.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/instanceView'} # type: ignore + + def list( + self, + resource_group_name, # type: str + virtual_machine_scale_set_name, # type: str + filter=None, # type: Optional[str] + select=None, # type: Optional[str] + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.VirtualMachineScaleSetVMListResult"] + """Gets a list of all virtual machines in a VM scale sets. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the VM scale set. + :type virtual_machine_scale_set_name: str + :param filter: The filter to apply to the operation. Allowed values are + 'startswith(instanceView/statuses/code, 'PowerState') eq true', 'properties/latestModelApplied + eq true', 'properties/latestModelApplied eq false'. + :type filter: str + :param select: The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. + :type select: str + :param expand: The expand expression to apply to the operation. Allowed values are + 'instanceView'. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualMachineScaleSetVMListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), + '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] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if select is not None: + query_parameters['$select'] = self._serialize.query("select", select, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + 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('VirtualMachineScaleSetVMListResult', 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines'} # type: ignore + + def _power_off_initial( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + skip_shutdown=False, # type: Optional[bool] + **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-06-01" + + # Construct URL + url = self._power_off_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + '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] + if skip_shutdown is not None: + query_parameters['skipShutdown'] = self._serialize.query("skip_shutdown", skip_shutdown, 'bool') + 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, {}) + + _power_off_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff'} # type: ignore + + def begin_power_off( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + skip_shutdown=False, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached + and you are getting charged for the resources. Instead, use deallocate to release resources and + avoid charges. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: str + :param skip_shutdown: The parameter to request non-graceful VM shutdown. True value for this + flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this + flag is false if not specified. + :type skip_shutdown: 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. + :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._power_off_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + instance_id=instance_id, + skip_shutdown=skip_shutdown, + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_power_off.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff'} # type: ignore + + def _restart_initial( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # 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-06-01" + + # Construct URL + url = self._restart_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + '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') + + # 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, {}) + + _restart_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart'} # type: ignore + + def begin_restart( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Restarts a virtual machine in a VM scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: 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._restart_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + instance_id=instance_id, + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart'} # type: ignore + + def _start_initial( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # 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-06-01" + + # Construct URL + url = self._start_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + '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') + + # 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, {}) + + _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start'} # type: ignore + + def begin_start( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Starts a virtual machine in a VM scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: 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._start_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + instance_id=instance_id, + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start'} # type: ignore + + def _redeploy_initial( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # 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-06-01" + + # Construct URL + url = self._redeploy_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + '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') + + # 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, {}) + + _redeploy_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/redeploy'} # type: ignore + + def begin_redeploy( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and + powers it back on. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: 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._redeploy_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + instance_id=instance_id, + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_redeploy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/redeploy'} # type: ignore + + def retrieve_boot_diagnostics_data( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + sas_uri_expiration_time_in_minutes=None, # type: Optional[int] + **kwargs # type: Any + ): + # type: (...) -> "models.RetrieveBootDiagnosticsDataResult" + """The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale + set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: str + :param sas_uri_expiration_time_in_minutes: Expiration duration in minutes for the SAS URIs with + a value between 1 to 1440 minutes. :code:`
    `:code:`
    `NOTE: If not specified, SAS URIs + will be generated with a default expiration duration of 120 minutes. + :type sas_uri_expiration_time_in_minutes: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RetrieveBootDiagnosticsDataResult, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.RetrieveBootDiagnosticsDataResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RetrieveBootDiagnosticsDataResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.retrieve_boot_diagnostics_data.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + '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] + if sas_uri_expiration_time_in_minutes is not None: + query_parameters['sasUriExpirationTimeInMinutes'] = self._serialize.query("sas_uri_expiration_time_in_minutes", sas_uri_expiration_time_in_minutes, 'int') + 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.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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RetrieveBootDiagnosticsDataResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + retrieve_boot_diagnostics_data.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/retrieveBootDiagnosticsData'} # type: ignore + + def _perform_maintenance_initial( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # 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-06-01" + + # Construct URL + url = self._perform_maintenance_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + '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') + + # 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, {}) + + _perform_maintenance_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/performMaintenance'} # type: ignore + + def begin_perform_maintenance( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Performs maintenance on a virtual machine in a VM scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: 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._perform_maintenance_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + instance_id=instance_id, + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_perform_maintenance.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/performMaintenance'} # type: ignore + + def simulate_eviction( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """The operation to simulate the eviction of spot virtual machine in a VM scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-06-01" + + # Construct URL + url = self.simulate_eviction.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + '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') + + # 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 [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, {}) + + simulate_eviction.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/simulateEviction'} # type: ignore + + def _run_command_initial( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + parameters, # type: "models.RunCommandInput" + **kwargs # type: Any + ): + # type: (...) -> Optional["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" + + # Construct URL + url = self._run_command_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + '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') + + # 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(parameters, 'RunCommandInput') + 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('RunCommandResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _run_command_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/runCommand'} # type: ignore + + def begin_run_command( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + parameters, # type: "models.RunCommandInput" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.RunCommandResult"] + """Run command on a virtual machine in a VM scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: str + :param parameters: Parameters supplied to the Run command operation. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.RunCommandInput + :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 RunCommandResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_06_01.models.RunCommandResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] + 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._run_command_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + instance_id=instance_id, + parameters=parameters, + 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('RunCommandResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_run_command.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/runCommand'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_sets_operations.py new file mode 100644 index 000000000000..78de6880d145 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_sets_operations.py @@ -0,0 +1,2206 @@ +# 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 + +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 VirtualMachineScaleSetsOperations(object): + """VirtualMachineScaleSetsOperations 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_06_01.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 + vm_scale_set_name, # type: str + parameters, # type: "models.VirtualMachineScaleSet" + **kwargs # type: Any + ): + # type: (...) -> "models.VirtualMachineScaleSet" + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # 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(parameters, 'VirtualMachineScaleSet') + 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, 201]: + 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('VirtualMachineScaleSet', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualMachineScaleSet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + parameters, # type: "models.VirtualMachineScaleSet" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] + """Create or update a VM scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set to create or update. + :type vm_scale_set_name: str + :param parameters: The scale set object. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSet + :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 VirtualMachineScaleSet or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + 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, + vm_scale_set_name=vm_scale_set_name, + parameters=parameters, + 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('VirtualMachineScaleSet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = ARMPolling(lro_delay, **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/virtualMachineScaleSets/{vmScaleSetName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + parameters, # type: "models.VirtualMachineScaleSetUpdate" + **kwargs # type: Any + ): + # type: (...) -> "models.VirtualMachineScaleSet" + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # 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(parameters, 'VirtualMachineScaleSetUpdate') + 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualMachineScaleSet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + parameters, # type: "models.VirtualMachineScaleSetUpdate" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] + """Update a VM scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set to create or update. + :type vm_scale_set_name: str + :param parameters: The scale set object. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetUpdate + :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 VirtualMachineScaleSet or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + 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, + vm_scale_set_name=vm_scale_set_name, + parameters=parameters, + 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('VirtualMachineScaleSet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = ARMPolling(lro_delay, **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/virtualMachineScaleSets/{vmScaleSetName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + vm_scale_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-06-01" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # 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/virtualMachineScaleSets/{vmScaleSetName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a VM scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_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, + vm_scale_set_name=vm_scale_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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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/virtualMachineScaleSets/{vmScaleSetName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.VirtualMachineScaleSet" + """Display information about a virtual machine scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualMachineScaleSet, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSet + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # 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('VirtualMachineScaleSet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'} # type: ignore + + def _deallocate_initial( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + **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-06-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._deallocate_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if vm_instance_i_ds is not None: + body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') + else: + body_content = None + 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) + + if cls: + return cls(pipeline_response, None, {}) + + _deallocate_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate'} # type: ignore + + def begin_deallocate( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and + releases the compute resources. You are not billed for the compute resources that this virtual + machine scale set deallocates. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param vm_instance_i_ds: A list of virtual machine instance IDs from the VM scale set. + :type vm_instance_i_ds: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMInstanceIDs + :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._deallocate_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + vm_instance_i_ds=vm_instance_i_ds, + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_deallocate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate'} # type: ignore + + def _delete_instances_initial( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + **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-06-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._delete_instances_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') + 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) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_instances_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete'} # type: ignore + + def begin_delete_instances( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes virtual machines in a VM scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param vm_instance_i_ds: A list of virtual machine instance IDs from the VM scale set. + :type vm_instance_i_ds: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMInstanceRequiredIDs + :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_instances_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + vm_instance_i_ds=vm_instance_i_ds, + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_instances.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete'} # type: ignore + + def get_instance_view( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.VirtualMachineScaleSetInstanceView" + """Gets the status of a VM scale set instance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualMachineScaleSetInstanceView, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetInstanceView + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_view.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # 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('VirtualMachineScaleSetInstanceView', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_view.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/instanceView'} # type: ignore + + def list( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.VirtualMachineScaleSetListResult"] + """Gets a list of all VM scale 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 VirtualMachineScaleSetListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + '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('VirtualMachineScaleSetListResult', 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets'} # type: ignore + + def list_all( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.VirtualMachineScaleSetListWithLinkResult"] + """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource + group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this + till nextLink is null to fetch all the VM Scale Sets. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualMachineScaleSetListWithLinkResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetListWithLinkResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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_all.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('VirtualMachineScaleSetListWithLinkResult', 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_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets'} # type: ignore + + def list_skus( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.VirtualMachineScaleSetListSkusResult"] + """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM + instances allowed for each SKU. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_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 VirtualMachineScaleSetListSkusResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetListSkusResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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_skus.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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('VirtualMachineScaleSetListSkusResult', 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_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/skus'} # type: ignore + + def get_os_upgrade_history( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.VirtualMachineScaleSetListOSUpgradeHistory"] + """Gets list of OS upgrades on a VM scale set instance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_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 VirtualMachineScaleSetListOSUpgradeHistory or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetListOSUpgradeHistory] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListOSUpgradeHistory"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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.get_os_upgrade_history.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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('VirtualMachineScaleSetListOSUpgradeHistory', 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 + ) + get_os_upgrade_history.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osUpgradeHistory'} # type: ignore + + def _power_off_initial( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + skip_shutdown=False, # type: Optional[bool] + vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + **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-06-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._power_off_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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] + if skip_shutdown is not None: + query_parameters['skipShutdown'] = self._serialize.query("skip_shutdown", skip_shutdown, 'bool') + 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') + + body_content_kwargs = {} # type: Dict[str, Any] + if vm_instance_i_ds is not None: + body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') + else: + body_content = None + 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) + + if cls: + return cls(pipeline_response, None, {}) + + _power_off_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff'} # type: ignore + + def begin_power_off( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + skip_shutdown=False, # type: Optional[bool] + vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still + attached and you are getting charged for the resources. Instead, use deallocate to release + resources and avoid charges. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param skip_shutdown: The parameter to request non-graceful VM shutdown. True value for this + flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this + flag is false if not specified. + :type skip_shutdown: bool + :param vm_instance_i_ds: A list of virtual machine instance IDs from the VM scale set. + :type vm_instance_i_ds: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMInstanceIDs + :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._power_off_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + skip_shutdown=skip_shutdown, + vm_instance_i_ds=vm_instance_i_ds, + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_power_off.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff'} # type: ignore + + def _restart_initial( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + **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-06-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._restart_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if vm_instance_i_ds is not None: + body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') + else: + body_content = None + 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) + + if cls: + return cls(pipeline_response, None, {}) + + _restart_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart'} # type: ignore + + def begin_restart( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Restarts one or more virtual machines in a VM scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param vm_instance_i_ds: A list of virtual machine instance IDs from the VM scale set. + :type vm_instance_i_ds: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMInstanceIDs + :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._restart_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + vm_instance_i_ds=vm_instance_i_ds, + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart'} # type: ignore + + def _start_initial( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + **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-06-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._start_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if vm_instance_i_ds is not None: + body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') + else: + body_content = None + 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) + + if cls: + return cls(pipeline_response, None, {}) + + _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start'} # type: ignore + + def begin_start( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Starts one or more virtual machines in a VM scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param vm_instance_i_ds: A list of virtual machine instance IDs from the VM scale set. + :type vm_instance_i_ds: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMInstanceIDs + :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._start_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + vm_instance_i_ds=vm_instance_i_ds, + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start'} # type: ignore + + def _redeploy_initial( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + **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-06-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._redeploy_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if vm_instance_i_ds is not None: + body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') + else: + body_content = None + 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) + + if cls: + return cls(pipeline_response, None, {}) + + _redeploy_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/redeploy'} # type: ignore + + def begin_redeploy( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, + and powers them back on. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param vm_instance_i_ds: A list of virtual machine instance IDs from the VM scale set. + :type vm_instance_i_ds: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMInstanceIDs + :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._redeploy_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + vm_instance_i_ds=vm_instance_i_ds, + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_redeploy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/redeploy'} # type: ignore + + def _perform_maintenance_initial( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + **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-06-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._perform_maintenance_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if vm_instance_i_ds is not None: + body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') + else: + body_content = None + 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) + + if cls: + return cls(pipeline_response, None, {}) + + _perform_maintenance_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/performMaintenance'} # type: ignore + + def begin_perform_maintenance( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances + which are not eligible for perform maintenance will be failed. Please refer to best practices + for more details: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual- + machine-scale-sets-maintenance-notifications. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param vm_instance_i_ds: A list of virtual machine instance IDs from the VM scale set. + :type vm_instance_i_ds: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMInstanceIDs + :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._perform_maintenance_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + vm_instance_i_ds=vm_instance_i_ds, + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_perform_maintenance.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/performMaintenance'} # type: ignore + + def _update_instances_initial( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + **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-06-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._update_instances_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceRequiredIDs') + 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) + + if cls: + return cls(pipeline_response, None, {}) + + _update_instances_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade'} # type: ignore + + def begin_update_instances( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param vm_instance_i_ds: A list of virtual machine instance IDs from the VM scale set. + :type vm_instance_i_ds: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMInstanceRequiredIDs + :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._update_instances_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + vm_instance_i_ds=vm_instance_i_ds, + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_instances.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade'} # type: ignore + + def _reimage_initial( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + vm_scale_set_reimage_input=None, # type: Optional["models.VirtualMachineScaleSetReimageParameters"] + **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-06-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._reimage_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if vm_scale_set_reimage_input is not None: + body_content = self._serialize.body(vm_scale_set_reimage_input, 'VirtualMachineScaleSetReimageParameters') + else: + body_content = None + 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) + + if cls: + return cls(pipeline_response, None, {}) + + _reimage_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage'} # type: ignore + + def begin_reimage( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + vm_scale_set_reimage_input=None, # type: Optional["models.VirtualMachineScaleSetReimageParameters"] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which + don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual + machine is reset to initial state. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param vm_scale_set_reimage_input: Parameters for Reimaging VM ScaleSet. + :type vm_scale_set_reimage_input: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetReimageParameters + :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._reimage_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + vm_scale_set_reimage_input=vm_scale_set_reimage_input, + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_reimage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage'} # type: ignore + + def _reimage_all_initial( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + **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-06-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._reimage_all_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if vm_instance_i_ds is not None: + body_content = self._serialize.body(vm_instance_i_ds, 'VirtualMachineScaleSetVMInstanceIDs') + else: + body_content = None + 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) + + if cls: + return cls(pipeline_response, None, {}) + + _reimage_all_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimageall'} # type: ignore + + def begin_reimage_all( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This + operation is only supported for managed disks. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param vm_instance_i_ds: A list of virtual machine instance IDs from the VM scale set. + :type vm_instance_i_ds: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMInstanceIDs + :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._reimage_all_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + vm_instance_i_ds=vm_instance_i_ds, + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_reimage_all.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimageall'} # type: ignore + + def force_recovery_service_fabric_platform_update_domain_walk( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + platform_update_domain, # type: int + **kwargs # type: Any + ): + # type: (...) -> "models.RecoveryWalkResponse" + """Manual platform update domain walk to update virtual machines in a service fabric virtual + machine scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param platform_update_domain: The platform update domain for which a manual recovery walk is + requested. + :type platform_update_domain: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RecoveryWalkResponse, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.RecoveryWalkResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RecoveryWalkResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.force_recovery_service_fabric_platform_update_domain_walk.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + query_parameters['platformUpdateDomain'] = self._serialize.query("platform_update_domain", platform_update_domain, 'int') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RecoveryWalkResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + force_recovery_service_fabric_platform_update_domain_walk.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/forceRecoveryServiceFabricPlatformUpdateDomainWalk'} # type: ignore + + def convert_to_single_placement_group( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + parameters, # type: "models.VMScaleSetConvertToSinglePlacementGroupInput" + **kwargs # type: Any + ): + # type: (...) -> None + """Converts SinglePlacementGroup property to false for a existing virtual machine scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the virtual machine scale set to create or update. + :type vm_scale_set_name: str + :param parameters: The input object for ConvertToSinglePlacementGroup API. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.VMScaleSetConvertToSinglePlacementGroupInput + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-06-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.convert_to_single_placement_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'VMScaleSetConvertToSinglePlacementGroupInput') + 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]: + 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, {}) + + convert_to_single_placement_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/convertToSinglePlacementGroup'} # type: ignore + + def _set_orchestration_service_state_initial( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + parameters, # type: "models.OrchestrationServiceStateInput" + **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-06-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._set_orchestration_service_state_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'OrchestrationServiceStateInput') + 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) + + if cls: + return cls(pipeline_response, None, {}) + + _set_orchestration_service_state_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/setOrchestrationServiceState'} # type: ignore + + def begin_set_orchestration_service_state( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + parameters, # type: "models.OrchestrationServiceStateInput" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Changes ServiceState property for a given service. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the virtual machine scale set to create or update. + :type vm_scale_set_name: str + :param parameters: The input object for SetOrchestrationServiceState API. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.OrchestrationServiceStateInput + :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._set_orchestration_service_state_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + parameters=parameters, + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_set_orchestration_service_state.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/setOrchestrationServiceState'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_sizes_operations.py new file mode 100644 index 000000000000..d3b9315e39a5 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_sizes_operations.py @@ -0,0 +1,118 @@ +# 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 + +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 VirtualMachineSizesOperations(object): + """VirtualMachineSizesOperations 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_06_01.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 list( + self, + location, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + """This API is deprecated. Use `Resources Skus `_. + + :param location: The location upon which virtual-machine-sizes is queried. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualMachineSizeListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineSizeListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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 = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + '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('VirtualMachineSizeListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return 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/locations/{location}/vmSizes'} # type: ignore 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 new file mode 100644 index 000000000000..039e0a4b0939 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machines_operations.py @@ -0,0 +1,2296 @@ +# 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 + +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 VirtualMachinesOperations(object): + """VirtualMachinesOperations 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_06_01.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 list_by_location( + self, + location, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.VirtualMachineListResult"] + """Gets all the virtual machines under the specified subscription for the specified location. + + :param location: The location for which virtual machines under the subscription are queried. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualMachineListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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_location.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + '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('VirtualMachineListResult', 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_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/virtualMachines'} # type: ignore + + def _capture_initial( + self, + resource_group_name, # type: str + vm_name, # type: str + parameters, # type: "models.VirtualMachineCaptureParameters" + **kwargs # type: Any + ): + # type: (...) -> Optional["models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._capture_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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') + + # 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(parameters, 'VirtualMachineCaptureParameters') + 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('VirtualMachineCaptureResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _capture_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture'} # type: ignore + + def begin_capture( + self, + resource_group_name, # type: str + vm_name, # type: str + parameters, # type: "models.VirtualMachineCaptureParameters" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.VirtualMachineCaptureResult"] + """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used + to create similar VMs. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :param parameters: Parameters supplied to the Capture Virtual Machine operation. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineCaptureParameters + :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 VirtualMachineCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineCaptureResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] + 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._capture_initial( + resource_group_name=resource_group_name, + vm_name=vm_name, + parameters=parameters, + 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('VirtualMachineCaptureResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_capture.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + vm_name, # type: str + parameters, # type: "models.VirtualMachine" + **kwargs # type: Any + ): + # type: (...) -> "models.VirtualMachine" + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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') + + # 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(parameters, 'VirtualMachine') + 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, 201]: + 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('VirtualMachine', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualMachine', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + vm_name, # type: str + parameters, # type: "models.VirtualMachine" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.VirtualMachine"] + """The operation to create or update a virtual machine. Please note some properties can be set + only during virtual machine creation. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :param parameters: Parameters supplied to the Create Virtual Machine operation. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachine + :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 VirtualMachine or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + 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, + vm_name=vm_name, + parameters=parameters, + 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('VirtualMachine', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = ARMPolling(lro_delay, **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/virtualMachines/{vmName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + vm_name, # type: str + parameters, # type: "models.VirtualMachineUpdate" + **kwargs # type: Any + ): + # type: (...) -> "models.VirtualMachine" + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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') + + # 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(parameters, 'VirtualMachineUpdate') + 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, 201]: + 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('VirtualMachine', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualMachine', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + vm_name, # type: str + parameters, # type: "models.VirtualMachineUpdate" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.VirtualMachine"] + """The operation to update a virtual machine. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :param parameters: Parameters supplied to the Update Virtual Machine operation. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineUpdate + :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 VirtualMachine or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + 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, + vm_name=vm_name, + parameters=parameters, + 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('VirtualMachine', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = ARMPolling(lro_delay, **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/virtualMachines/{vmName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + vm_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-06-01" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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') + + # 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/virtualMachines/{vmName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + vm_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """The operation to delete a virtual machine. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_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, + vm_name=vm_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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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/virtualMachines/{vmName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + vm_name, # type: str + expand="instanceView", # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.VirtualMachine" + """Retrieves information about the model view or the instance view of a virtual machine. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :param expand: The expand expression to apply on the operation. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualMachine, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachine + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + 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('VirtualMachine', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'} # type: ignore + + def instance_view( + self, + resource_group_name, # type: str + vm_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.VirtualMachineInstanceView" + """Retrieves information about the run-time state of a virtual machine. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualMachineInstanceView, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineInstanceView + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineInstanceView"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.instance_view.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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') + + # 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('VirtualMachineInstanceView', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + instance_view.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/instanceView'} # type: ignore + + def _convert_to_managed_disks_initial( + self, + resource_group_name, # type: str + vm_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-06-01" + + # Construct URL + url = self._convert_to_managed_disks_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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') + + # 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, {}) + + _convert_to_managed_disks_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/convertToManagedDisks'} # type: ignore + + def begin_convert_to_managed_disks( + self, + resource_group_name, # type: str + vm_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop- + deallocated before invoking this operation. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_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._convert_to_managed_disks_initial( + resource_group_name=resource_group_name, + vm_name=vm_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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_convert_to_managed_disks.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/convertToManagedDisks'} # type: ignore + + def _deallocate_initial( + self, + resource_group_name, # type: str + vm_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-06-01" + + # Construct URL + url = self._deallocate_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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') + + # 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, {}) + + _deallocate_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/deallocate'} # type: ignore + + def begin_deallocate( + self, + resource_group_name, # type: str + vm_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Shuts down the virtual machine and releases the compute resources. You are not billed for the + compute resources that this virtual machine uses. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_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._deallocate_initial( + resource_group_name=resource_group_name, + vm_name=vm_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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_deallocate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/deallocate'} # type: ignore + + def generalize( + self, + resource_group_name, # type: str + vm_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the + virtual machine before performing this operation. :code:`
    `For Windows, please refer to + `Create a managed image of a generalized VM in Azure `_.:code:`
    `For Linux, please refer + to `How to create an image of a virtual machine or VHD `_. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-06-01" + + # Construct URL + url = self.generalize.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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') + + # 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]: + 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, {}) + + generalize.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/generalize'} # type: ignore + + def list( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.VirtualMachineListResult"] + """Lists all of the virtual machines in the specified resource group. Use the nextLink property in + the response to get the next page of virtual machines. + + :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 VirtualMachineListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + '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('VirtualMachineListResult', 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines'} # type: ignore + + def list_all( + self, + status_only=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.VirtualMachineListResult"] + """Lists all of the virtual machines in the specified subscription. Use the nextLink property in + the response to get the next page of virtual machines. + + :param status_only: statusOnly=true enables fetching run time status of all Virtual Machines in + the subscription. + :type status_only: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualMachineListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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_all.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') + if status_only is not None: + query_parameters['statusOnly'] = self._serialize.query("status_only", status_only, '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('VirtualMachineListResult', 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_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines'} # type: ignore + + def list_available_sizes( + self, + resource_group_name, # type: str + vm_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + """Lists all available virtual machine sizes to which the specified virtual machine can be + resized. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualMachineSizeListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineSizeListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + 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_available_sizes.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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('VirtualMachineSizeListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return 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_available_sizes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/vmSizes'} # type: ignore + + def _power_off_initial( + self, + resource_group_name, # type: str + vm_name, # type: str + skip_shutdown=False, # type: Optional[bool] + **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-06-01" + + # Construct URL + url = self._power_off_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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] + if skip_shutdown is not None: + query_parameters['skipShutdown'] = self._serialize.query("skip_shutdown", skip_shutdown, 'bool') + 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, {}) + + _power_off_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff'} # type: ignore + + def begin_power_off( + self, + resource_group_name, # type: str + vm_name, # type: str + skip_shutdown=False, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with + the same provisioned resources. You are still charged for this virtual machine. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :param skip_shutdown: The parameter to request non-graceful VM shutdown. True value for this + flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this + flag is false if not specified. + :type skip_shutdown: 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. + :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._power_off_initial( + resource_group_name=resource_group_name, + vm_name=vm_name, + skip_shutdown=skip_shutdown, + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_power_off.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff'} # type: ignore + + def _reapply_initial( + self, + resource_group_name, # type: str + vm_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-06-01" + accept = "application/json" + + # Construct URL + url = self._reapply_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + 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, {}) + + _reapply_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/reapply'} # type: ignore + + def begin_reapply( + self, + resource_group_name, # type: str + vm_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """The operation to reapply a virtual machine's state. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_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._reapply_initial( + resource_group_name=resource_group_name, + vm_name=vm_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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_reapply.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/reapply'} # type: ignore + + def _restart_initial( + self, + resource_group_name, # type: str + vm_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-06-01" + + # Construct URL + url = self._restart_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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') + + # 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, {}) + + _restart_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/restart'} # type: ignore + + def begin_restart( + self, + resource_group_name, # type: str + vm_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """The operation to restart a virtual machine. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_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._restart_initial( + resource_group_name=resource_group_name, + vm_name=vm_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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/restart'} # type: ignore + + def _start_initial( + self, + resource_group_name, # type: str + vm_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-06-01" + + # Construct URL + url = self._start_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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') + + # 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, {}) + + _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/start'} # type: ignore + + def begin_start( + self, + resource_group_name, # type: str + vm_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """The operation to start a virtual machine. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_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._start_initial( + resource_group_name=resource_group_name, + vm_name=vm_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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/start'} # type: ignore + + def _redeploy_initial( + self, + resource_group_name, # type: str + vm_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-06-01" + + # Construct URL + url = self._redeploy_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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') + + # 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, {}) + + _redeploy_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/redeploy'} # type: ignore + + def begin_redeploy( + self, + resource_group_name, # type: str + vm_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Shuts down the virtual machine, moves it to a new node, and powers it back on. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_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._redeploy_initial( + resource_group_name=resource_group_name, + vm_name=vm_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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_redeploy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/redeploy'} # type: ignore + + def _reimage_initial( + self, + resource_group_name, # type: str + vm_name, # type: str + parameters=None, # type: Optional["models.VirtualMachineReimageParameters"] + **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-06-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._reimage_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if parameters is not None: + body_content = self._serialize.body(parameters, 'VirtualMachineReimageParameters') + else: + body_content = None + 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) + + if cls: + return cls(pipeline_response, None, {}) + + _reimage_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/reimage'} # type: ignore + + def begin_reimage( + self, + resource_group_name, # type: str + vm_name, # type: str + parameters=None, # type: Optional["models.VirtualMachineReimageParameters"] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Reimages the virtual machine which has an ephemeral OS disk back to its initial state. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :param parameters: Parameters supplied to the Reimage Virtual Machine operation. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineReimageParameters + :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._reimage_initial( + resource_group_name=resource_group_name, + vm_name=vm_name, + parameters=parameters, + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_reimage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/reimage'} # type: ignore + + def retrieve_boot_diagnostics_data( + self, + resource_group_name, # type: str + vm_name, # type: str + sas_uri_expiration_time_in_minutes=None, # type: Optional[int] + **kwargs # type: Any + ): + # type: (...) -> "models.RetrieveBootDiagnosticsDataResult" + """The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :param sas_uri_expiration_time_in_minutes: Expiration duration in minutes for the SAS URIs with + a value between 1 to 1440 minutes. :code:`
    `:code:`
    `NOTE: If not specified, SAS URIs + will be generated with a default expiration duration of 120 minutes. + :type sas_uri_expiration_time_in_minutes: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RetrieveBootDiagnosticsDataResult, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.RetrieveBootDiagnosticsDataResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RetrieveBootDiagnosticsDataResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.retrieve_boot_diagnostics_data.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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] + if sas_uri_expiration_time_in_minutes is not None: + query_parameters['sasUriExpirationTimeInMinutes'] = self._serialize.query("sas_uri_expiration_time_in_minutes", sas_uri_expiration_time_in_minutes, 'int') + 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.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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RetrieveBootDiagnosticsDataResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + retrieve_boot_diagnostics_data.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/retrieveBootDiagnosticsData'} # type: ignore + + def _perform_maintenance_initial( + self, + resource_group_name, # type: str + vm_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-06-01" + + # Construct URL + url = self._perform_maintenance_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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') + + # 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, {}) + + _perform_maintenance_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/performMaintenance'} # type: ignore + + def begin_perform_maintenance( + self, + resource_group_name, # type: str + vm_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """The operation to perform maintenance on a virtual machine. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_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._perform_maintenance_initial( + resource_group_name=resource_group_name, + vm_name=vm_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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_perform_maintenance.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/performMaintenance'} # type: ignore + + def simulate_eviction( + self, + resource_group_name, # type: str + vm_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """The operation to simulate the eviction of spot virtual machine. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-06-01" + + # Construct URL + url = self.simulate_eviction.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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') + + # 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 [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, {}) + + simulate_eviction.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/simulateEviction'} # type: ignore + + def _assess_patches_initial( + self, + resource_group_name, # type: str + vm_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["models.VirtualMachineAssessPatchesResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineAssessPatchesResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self._assess_patches_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + 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) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VirtualMachineAssessPatchesResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _assess_patches_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/assessPatches'} # type: ignore + + def begin_assess_patches( + self, + resource_group_name, # type: str + vm_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.VirtualMachineAssessPatchesResult"] + """Assess patches on the VM. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_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 VirtualMachineAssessPatchesResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineAssessPatchesResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineAssessPatchesResult"] + 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._assess_patches_initial( + resource_group_name=resource_group_name, + vm_name=vm_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): + deserialized = self._deserialize('VirtualMachineAssessPatchesResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_assess_patches.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/assessPatches'} # type: ignore + + def _run_command_initial( + self, + resource_group_name, # type: str + vm_name, # type: str + parameters, # type: "models.RunCommandInput" + **kwargs # type: Any + ): + # type: (...) -> Optional["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" + + # Construct URL + url = self._run_command_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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') + + # 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(parameters, 'RunCommandInput') + 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('RunCommandResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _run_command_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommand'} # type: ignore + + def begin_run_command( + self, + resource_group_name, # type: str + vm_name, # type: str + parameters, # type: "models.RunCommandInput" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.RunCommandResult"] + """Run command on the VM. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :param parameters: Parameters supplied to the Run command operation. + :type parameters: ~azure.mgmt.compute.v2020_06_01.models.RunCommandInput + :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 RunCommandResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_06_01.models.RunCommandResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] + 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._run_command_initial( + resource_group_name=resource_group_name, + vm_name=vm_name, + parameters=parameters, + 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('RunCommandResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_run_command.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommand'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/py.typed b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/__init__.py new file mode 100644 index 000000000000..cdc7f7a1709a --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/__init__.py @@ -0,0 +1,16 @@ +# 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 ._compute_management_client import ComputeManagementClient +__all__ = ['ComputeManagementClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass 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 new file mode 100644 index 000000000000..4fd16125d667 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_compute_management_client.py @@ -0,0 +1,85 @@ +# 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 + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + 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 . import models + + +class ComputeManagementClient(object): + """Compute Client. + + :ivar disks: DisksOperations operations + :vartype disks: azure.mgmt.compute.v2020_06_30.operations.DisksOperations + :ivar snapshots: SnapshotsOperations operations + :vartype snapshots: azure.mgmt.compute.v2020_06_30.operations.SnapshotsOperations + :ivar disk_encryption_sets: DiskEncryptionSetsOperations operations + :vartype disk_encryption_sets: azure.mgmt.compute.v2020_06_30.operations.DiskEncryptionSetsOperations + :ivar disk_accesses: DiskAccessesOperations operations + :vartype disk_accesses: azure.mgmt.compute.v2020_06_30.operations.DiskAccessesOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = ComputeManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + 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) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> ComputeManagementClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_configuration.py new file mode 100644 index 000000000000..c72f367f2b70 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_configuration.py @@ -0,0 +1,70 @@ +# 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 + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class ComputeManagementClientConfiguration(Configuration): + """Configuration for ComputeManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(ComputeManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-06-30" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-compute/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) 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 new file mode 100644 index 000000000000..e8b40122ed40 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_metadata.json @@ -0,0 +1,63 @@ +{ + "chosen_version": "2020-06-30", + "total_api_version_list": ["2020-06-30"], + "client": { + "name": "ComputeManagementClient", + "filename": "_compute_management_client", + "description": "Compute Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true + }, + "global_parameters": { + "sync_method": { + "credential": { + "method_signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "method_signature": "subscription_id, # type: str", + "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + "docstring_type": "str", + "required": true + } + }, + "async_method": { + "credential": { + "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "method_signature": "subscription_id, # type: str", + "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id" + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null + }, + "operation_groups": { + "disks": "DisksOperations", + "snapshots": "SnapshotsOperations", + "disk_encryption_sets": "DiskEncryptionSetsOperations", + "disk_accesses": "DiskAccessesOperations" + }, + "operation_mixins": { + }, + "sync_imports": "None", + "async_imports": "None" +} \ No newline at end of file diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/__init__.py new file mode 100644 index 000000000000..9e9459635989 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/__init__.py @@ -0,0 +1,10 @@ +# 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 ._compute_management_client import ComputeManagementClient +__all__ = ['ComputeManagementClient'] 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 new file mode 100644 index 000000000000..06ad146f3eb1 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/_compute_management_client.py @@ -0,0 +1,79 @@ +# 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, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + 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 .. import models + + +class ComputeManagementClient(object): + """Compute Client. + + :ivar disks: DisksOperations operations + :vartype disks: azure.mgmt.compute.v2020_06_30.aio.operations.DisksOperations + :ivar snapshots: SnapshotsOperations operations + :vartype snapshots: azure.mgmt.compute.v2020_06_30.aio.operations.SnapshotsOperations + :ivar disk_encryption_sets: DiskEncryptionSetsOperations operations + :vartype disk_encryption_sets: azure.mgmt.compute.v2020_06_30.aio.operations.DiskEncryptionSetsOperations + :ivar disk_accesses: DiskAccessesOperations operations + :vartype disk_accesses: azure.mgmt.compute.v2020_06_30.aio.operations.DiskAccessesOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = ComputeManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + 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) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "ComputeManagementClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/_configuration.py new file mode 100644 index 000000000000..217ef7f77827 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/_configuration.py @@ -0,0 +1,66 @@ +# 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, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class ComputeManagementClientConfiguration(Configuration): + """Configuration for ComputeManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(ComputeManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-06-30" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-compute/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/__init__.py new file mode 100644 index 000000000000..22cffb20eb1d --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/__init__.py @@ -0,0 +1,19 @@ +# 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 ._disks_operations import DisksOperations +from ._snapshots_operations import SnapshotsOperations +from ._disk_encryption_sets_operations import DiskEncryptionSetsOperations +from ._disk_accesses_operations import DiskAccessesOperations + +__all__ = [ + 'DisksOperations', + 'SnapshotsOperations', + 'DiskEncryptionSetsOperations', + 'DiskAccessesOperations', +] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disk_accesses_operations.py new file mode 100644 index 000000000000..a4069d42171b --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disk_accesses_operations.py @@ -0,0 +1,652 @@ +# 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 + +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_06_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-06-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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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-06-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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_06_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-06-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-06-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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_06_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-06-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_06_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-06-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_06_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-06-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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disk_encryption_sets_operations.py new file mode 100644 index 000000000000..2addc1954dfc --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disk_encryption_sets_operations.py @@ -0,0 +1,670 @@ +# 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 + +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_06_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-06-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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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-06-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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_06_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-06-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-06-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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_06_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-06-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_06_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-06-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_06_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-06-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_06_30/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disks_operations.py new file mode 100644 index 000000000000..6b09dc2534cf --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disks_operations.py @@ -0,0 +1,815 @@ +# 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 + +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_06_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-06-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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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-06-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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_06_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-06-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-06-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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_06_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-06-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_06_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-06-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-06-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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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-06-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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_30/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_snapshots_operations.py new file mode 100644 index 000000000000..cae8ec003a67 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_snapshots_operations.py @@ -0,0 +1,815 @@ +# 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 + +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_06_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-06-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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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-06-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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_06_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-06-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-06-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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_06_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-06-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_06_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-06-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-06-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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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-06-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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_30/models/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/models/__init__.py new file mode 100644 index 000000000000..48e3cd444b99 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/models/__init__.py @@ -0,0 +1,150 @@ +# 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. +# -------------------------------------------------------------------------- + +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 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 DiskList + from ._models_py3 import DiskSku + from ._models_py3 import DiskUpdate + from ._models_py3 import Encryption + from ._models_py3 import EncryptionSetIdentity + from ._models_py3 import EncryptionSettingsCollection + from ._models_py3 import EncryptionSettingsElement + from ._models_py3 import GrantAccessData + from ._models_py3 import ImageDiskReference + from ._models_py3 import InnerError + from ._models_py3 import KeyVaultAndKeyReference + from ._models_py3 import KeyVaultAndSecretReference + from ._models_py3 import PrivateEndpoint + from ._models_py3 import PrivateEndpointConnection + from ._models_py3 import PrivateLinkResource + from ._models_py3 import PrivateLinkResourceListResult + from ._models_py3 import PrivateLinkServiceConnectionState + from ._models_py3 import Resource + from ._models_py3 import ResourceUriList + from ._models_py3 import ShareInfoElement + 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 +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 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 DiskList # type: ignore + from ._models import DiskSku # type: ignore + from ._models import DiskUpdate # type: ignore + from ._models import Encryption # type: ignore + from ._models import EncryptionSetIdentity # type: ignore + from ._models import EncryptionSettingsCollection # type: ignore + from ._models import EncryptionSettingsElement # type: ignore + from ._models import GrantAccessData # type: ignore + from ._models import ImageDiskReference # type: ignore + from ._models import InnerError # type: ignore + from ._models import KeyVaultAndKeyReference # type: ignore + from ._models import KeyVaultAndSecretReference # type: ignore + from ._models import PrivateEndpoint # type: ignore + from ._models import PrivateEndpointConnection # type: ignore + from ._models import PrivateLinkResource # type: ignore + from ._models import PrivateLinkResourceListResult # type: ignore + from ._models import PrivateLinkServiceConnectionState # type: ignore + from ._models import Resource # type: ignore + from ._models import ResourceUriList # type: ignore + from ._models import ShareInfoElement # 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 ._compute_management_client_enums import ( + AccessLevel, + DiskCreateOption, + DiskEncryptionSetIdentityType, + DiskEncryptionSetType, + DiskState, + DiskStorageAccountTypes, + EncryptionType, + HyperVGeneration, + NetworkAccessPolicy, + OperatingSystemTypes, + PrivateEndpointConnectionProvisioningState, + PrivateEndpointServiceConnectionStatus, + SnapshotStorageAccountTypes, +) + +__all__ = [ + 'AccessUri', + 'ApiError', + 'ApiErrorBase', + 'CreationData', + 'Disk', + 'DiskAccess', + 'DiskAccessList', + 'DiskAccessUpdate', + 'DiskEncryptionSet', + 'DiskEncryptionSetList', + 'DiskEncryptionSetUpdate', + 'DiskList', + 'DiskSku', + 'DiskUpdate', + 'Encryption', + 'EncryptionSetIdentity', + 'EncryptionSettingsCollection', + 'EncryptionSettingsElement', + 'GrantAccessData', + 'ImageDiskReference', + 'InnerError', + 'KeyVaultAndKeyReference', + 'KeyVaultAndSecretReference', + 'PrivateEndpoint', + 'PrivateEndpointConnection', + 'PrivateLinkResource', + 'PrivateLinkResourceListResult', + 'PrivateLinkServiceConnectionState', + 'Resource', + 'ResourceUriList', + 'ShareInfoElement', + 'Snapshot', + 'SnapshotList', + 'SnapshotSku', + 'SnapshotUpdate', + 'SourceVault', + 'AccessLevel', + 'DiskCreateOption', + 'DiskEncryptionSetIdentityType', + 'DiskEncryptionSetType', + 'DiskState', + 'DiskStorageAccountTypes', + 'EncryptionType', + 'HyperVGeneration', + 'NetworkAccessPolicy', + 'OperatingSystemTypes', + 'PrivateEndpointConnectionProvisioningState', + 'PrivateEndpointServiceConnectionStatus', + 'SnapshotStorageAccountTypes', +] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/models/_compute_management_client_enums.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/models/_compute_management_client_enums.py new file mode 100644 index 000000000000..1d10f820d183 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/models/_compute_management_client_enums.py @@ -0,0 +1,133 @@ +# 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 enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class AccessLevel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + NONE = "None" + READ = "Read" + WRITE = "Write" + +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. + """ + + SYSTEM_ASSIGNED = "SystemAssigned" + +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 HyperVGeneration(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The hypervisor generation of the Virtual Machine. Applicable to OS disks only. + """ + + 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 OperatingSystemTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """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 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. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/models/_models.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/models/_models.py new file mode 100644 index 000000000000..b35541f7b433 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/models/_models.py @@ -0,0 +1,1519 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import 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. + + :param details: The Api error details. + :type details: list[~azure.mgmt.compute.v2020_06_30.models.ApiErrorBase] + :param innererror: The Api inner error. + :type innererror: ~azure.mgmt.compute.v2020_06_30.models.InnerError + :param code: The error code. + :type code: str + :param target: The target of the particular error. + :type target: str + :param message: The error message. + :type message: str + """ + + _attribute_map = { + 'details': {'key': 'details', 'type': '[ApiErrorBase]'}, + 'innererror': {'key': 'innererror', 'type': 'InnerError'}, + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiError, self).__init__(**kwargs) + self.details = kwargs.get('details', None) + self.innererror = kwargs.get('innererror', None) + self.code = kwargs.get('code', None) + self.target = kwargs.get('target', None) + self.message = kwargs.get('message', None) + + +class ApiErrorBase(msrest.serialization.Model): + """Api error base. + + :param code: The error code. + :type code: str + :param target: The target of the particular error. + :type target: str + :param message: The error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiErrorBase, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.target = kwargs.get('target', None) + 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_06_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_06_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_06_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 Resource(msrest.serialization.Model): + """The 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. + + :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] + """ + + _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}'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs['location'] + self.tags = kwargs.get('tags', None) + + +class Disk(Resource): + """Disk 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: 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_06_30.models.DiskSku + :param zones: The Logical zone list for Disk. + :type zones: list[str] + :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_06_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_06_30.models.HyperVGeneration + :param creation_data: Disk source information. CreationData information cannot be changed after + the disk has been created. + :type creation_data: ~azure.mgmt.compute.v2020_06_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_06_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_06_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_06_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_06_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_06_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 + """ + + _validation = { + 'id': {'readonly': True}, + '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 = { + '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'}, + 'managed_by_extended': {'key': 'managedByExtended', 'type': '[str]'}, + 'sku': {'key': 'sku', 'type': 'DiskSku'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'time_created': {'key': 'properties.timeCreated', 'type': 'iso-8601'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, + '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'}, + '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'}, + } + + def __init__( + self, + **kwargs + ): + 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.time_created = None + self.os_type = kwargs.get('os_type', None) + self.hyper_v_generation = kwargs.get('hyper_v_generation', 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.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) + + +class DiskAccess(Resource): + """disk access 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 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_06_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 = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'private_endpoint_connections': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'time_created': {'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}'}, + '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(DiskAccess, self).__init__(**kwargs) + self.private_endpoint_connections = None + self.provisioning_state = None + self.time_created = None + + +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 disk access resources. + :type value: list[~azure.mgmt.compute.v2020_06_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 + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DiskAccess]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DiskAccessList, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class DiskAccessUpdate(msrest.serialization.Model): + """Used for updating a disk access resource. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(DiskAccessUpdate, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +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 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_06_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_06_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_06_30.models.KeyVaultAndKeyReference + :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_06_30.models.KeyVaultAndKeyReference] + :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}'}, + 'identity': {'key': 'identity', 'type': 'EncryptionSetIdentity'}, + 'encryption_type': {'key': 'properties.encryptionType', 'type': 'str'}, + 'active_key': {'key': 'properties.activeKey', 'type': 'KeyVaultAndKeyReference'}, + 'previous_keys': {'key': 'properties.previousKeys', 'type': '[KeyVaultAndKeyReference]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + 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 + + +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 disk encryption sets. + :type value: list[~azure.mgmt.compute.v2020_06_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 = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DiskEncryptionSet]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DiskEncryptionSetList, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class DiskEncryptionSetUpdate(msrest.serialization.Model): + """disk encryption set update resource. + + :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_06_30.models.DiskEncryptionSetType + :param active_key: Key Vault Key Url and vault id of KeK, KeK is optional and when provided is + used to unwrap the encryptionKey. + :type active_key: ~azure.mgmt.compute.v2020_06_30.models.KeyVaultAndKeyReference + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'encryption_type': {'key': 'properties.encryptionType', 'type': 'str'}, + 'active_key': {'key': 'properties.activeKey', 'type': 'KeyVaultAndKeyReference'}, + } + + def __init__( + self, + **kwargs + ): + 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 DiskList(msrest.serialization.Model): + """The List Disks operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of disks. + :type value: list[~azure.mgmt.compute.v2020_06_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 = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Disk]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DiskList, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +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. + + :param name: The sku name. Possible values include: "Standard_LRS", "Premium_LRS", + "StandardSSD_LRS", "UltraSSD_LRS". + :type name: str or ~azure.mgmt.compute.v2020_06_30.models.DiskStorageAccountTypes + :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(DiskSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = None + + +class DiskUpdate(msrest.serialization.Model): + """Disk update resource. + + :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_06_30.models.DiskSku + :param os_type: the Operating System type. Possible values include: "Windows", "Linux". + :type os_type: str or ~azure.mgmt.compute.v2020_06_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_06_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_06_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_06_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 + """ + + _attribute_map = { + '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'}, + } + + def __init__( + self, + **kwargs + ): + 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) + + +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_06_30.models.EncryptionType + """ + + _attribute_map = { + 'disk_encryption_set_id': {'key': 'diskEncryptionSetId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Encryption, self).__init__(**kwargs) + self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) + self.type = kwargs.get('type', 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. Possible values include: "SystemAssigned". + :type type: str or ~azure.mgmt.compute.v2020_06_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, + **kwargs + ): + super(EncryptionSetIdentity, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + 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. + + :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_06_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 = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'encryption_settings': {'key': 'encryptionSettings', 'type': '[EncryptionSettingsElement]'}, + 'encryption_settings_version': {'key': 'encryptionSettingsVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + 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 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_06_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_06_30.models.KeyVaultAndKeyReference + """ + + _attribute_map = { + 'disk_encryption_key': {'key': 'diskEncryptionKey', 'type': 'KeyVaultAndSecretReference'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyVaultAndKeyReference'}, + } + + def __init__( + self, + **kwargs + ): + 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 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_06_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 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 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_06_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, + **kwargs + ): + super(KeyVaultAndKeyReference, self).__init__(**kwargs) + self.source_vault = kwargs['source_vault'] + self.key_url = kwargs['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_06_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, + **kwargs + ): + super(KeyVaultAndSecretReference, self).__init__(**kwargs) + self.source_vault = kwargs['source_vault'] + self.secret_url = kwargs['secret_url'] + + +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 id: The ARM identifier for Private Endpoint. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None + + +class PrivateEndpointConnection(msrest.serialization.Model): + """The Private Endpoint Connection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: private endpoint connection Id. + :vartype id: str + :ivar name: private endpoint connection name. + :vartype name: str + :ivar type: private endpoint connection type. + :vartype type: str + :param private_endpoint: The resource of private end point. + :type private_endpoint: ~azure.mgmt.compute.v2020_06_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_06_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_06_30.models.PrivateEndpointConnectionProvisioningState + """ + + _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'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + 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 PrivateLinkResource(msrest.serialization.Model): + """A private link resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :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': {'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(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 PrivateLinkResourceListResult(msrest.serialization.Model): + """A list of private link resources. + + :param value: Array of private link resources. + :type value: list[~azure.mgmt.compute.v2020_06_30.models.PrivateLinkResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResourceListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class PrivateLinkServiceConnectionState(msrest.serialization.Model): + """A collection of information about the state of the connection between service consumer and provider. + + :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_06_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 + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + 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 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 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 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. + :type sku: ~azure.mgmt.compute.v2020_06_30.models.SnapshotSku + :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_06_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_06_30.models.HyperVGeneration + :param creation_data: Disk source information. CreationData information cannot be changed after + the disk has been created. + :type creation_data: ~azure.mgmt.compute.v2020_06_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_06_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_06_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_06_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_06_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'}, + 'time_created': {'key': 'properties.timeCreated', 'type': 'iso-8601'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, + '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.time_created = None + self.os_type = kwargs.get('os_type', None) + self.hyper_v_generation = kwargs.get('hyper_v_generation', 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_06_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. + + 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_06_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. + :type sku: ~azure.mgmt.compute.v2020_06_30.models.SnapshotSku + :param os_type: the Operating System type. Possible values include: "Windows", "Linux". + :type os_type: str or ~azure.mgmt.compute.v2020_06_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_06_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_06_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_06_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) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/models/_models_py3.py new file mode 100644 index 000000000000..791ce85eb47a --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/models/_models_py3.py @@ -0,0 +1,1675 @@ +# 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 Dict, List, Optional, Union + +import msrest.serialization + +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. + + :param details: The Api error details. + :type details: list[~azure.mgmt.compute.v2020_06_30.models.ApiErrorBase] + :param innererror: The Api inner error. + :type innererror: ~azure.mgmt.compute.v2020_06_30.models.InnerError + :param code: The error code. + :type code: str + :param target: The target of the particular error. + :type target: str + :param message: The error message. + :type message: str + """ + + _attribute_map = { + 'details': {'key': 'details', 'type': '[ApiErrorBase]'}, + 'innererror': {'key': 'innererror', 'type': 'InnerError'}, + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + details: Optional[List["ApiErrorBase"]] = None, + innererror: Optional["InnerError"] = None, + code: Optional[str] = None, + target: Optional[str] = None, + message: Optional[str] = None, + **kwargs + ): + super(ApiError, self).__init__(**kwargs) + self.details = details + self.innererror = innererror + self.code = code + self.target = target + self.message = message + + +class ApiErrorBase(msrest.serialization.Model): + """Api error base. + + :param code: The error code. + :type code: str + :param target: The target of the particular error. + :type target: str + :param message: The error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + target: Optional[str] = None, + message: Optional[str] = None, + **kwargs + ): + super(ApiErrorBase, self).__init__(**kwargs) + self.code = code + self.target = target + 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_06_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_06_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_06_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 Resource(msrest.serialization.Model): + """The 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. + + :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] + """ + + _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}'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + + +class Disk(Resource): + """Disk 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: 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_06_30.models.DiskSku + :param zones: The Logical zone list for Disk. + :type zones: list[str] + :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_06_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_06_30.models.HyperVGeneration + :param creation_data: Disk source information. CreationData information cannot be changed after + the disk has been created. + :type creation_data: ~azure.mgmt.compute.v2020_06_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_06_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_06_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_06_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_06_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_06_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 + """ + + _validation = { + 'id': {'readonly': True}, + '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 = { + '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'}, + 'managed_by_extended': {'key': 'managedByExtended', 'type': '[str]'}, + 'sku': {'key': 'sku', 'type': 'DiskSku'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'time_created': {'key': 'properties.timeCreated', 'type': 'iso-8601'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, + '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'}, + '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'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + sku: Optional["DiskSku"] = None, + zones: Optional[List[str]] = None, + os_type: Optional[Union[str, "OperatingSystemTypes"]] = None, + hyper_v_generation: Optional[Union[str, "HyperVGeneration"]] = 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, + **kwargs + ): + 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.time_created = None + self.os_type = os_type + self.hyper_v_generation = hyper_v_generation + 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.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 + + +class DiskAccess(Resource): + """disk access 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 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_06_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 = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'private_endpoint_connections': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'time_created': {'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}'}, + '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, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(DiskAccess, self).__init__(location=location, tags=tags, **kwargs) + self.private_endpoint_connections = None + self.provisioning_state = None + self.time_created = None + + +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 disk access resources. + :type value: list[~azure.mgmt.compute.v2020_06_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 + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DiskAccess]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["DiskAccess"], + next_link: Optional[str] = None, + **kwargs + ): + super(DiskAccessList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class DiskAccessUpdate(msrest.serialization.Model): + """Used for updating a disk access resource. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(DiskAccessUpdate, self).__init__(**kwargs) + self.tags = tags + + +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 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_06_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_06_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_06_30.models.KeyVaultAndKeyReference + :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_06_30.models.KeyVaultAndKeyReference] + :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}'}, + 'identity': {'key': 'identity', 'type': 'EncryptionSetIdentity'}, + 'encryption_type': {'key': 'properties.encryptionType', 'type': 'str'}, + 'active_key': {'key': 'properties.activeKey', 'type': 'KeyVaultAndKeyReference'}, + 'previous_keys': {'key': 'properties.previousKeys', 'type': '[KeyVaultAndKeyReference]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + identity: Optional["EncryptionSetIdentity"] = None, + encryption_type: Optional[Union[str, "DiskEncryptionSetType"]] = None, + active_key: Optional["KeyVaultAndKeyReference"] = None, + **kwargs + ): + 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 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 disk encryption sets. + :type value: list[~azure.mgmt.compute.v2020_06_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 = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DiskEncryptionSet]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["DiskEncryptionSet"], + next_link: Optional[str] = None, + **kwargs + ): + super(DiskEncryptionSetList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class DiskEncryptionSetUpdate(msrest.serialization.Model): + """disk encryption set update resource. + + :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_06_30.models.DiskEncryptionSetType + :param active_key: Key Vault Key Url and vault id of KeK, KeK is optional and when provided is + used to unwrap the encryptionKey. + :type active_key: ~azure.mgmt.compute.v2020_06_30.models.KeyVaultAndKeyReference + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'encryption_type': {'key': 'properties.encryptionType', 'type': 'str'}, + 'active_key': {'key': 'properties.activeKey', 'type': 'KeyVaultAndKeyReference'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + encryption_type: Optional[Union[str, "DiskEncryptionSetType"]] = None, + active_key: Optional["KeyVaultAndKeyReference"] = None, + **kwargs + ): + super(DiskEncryptionSetUpdate, self).__init__(**kwargs) + self.tags = tags + self.encryption_type = encryption_type + self.active_key = active_key + + +class DiskList(msrest.serialization.Model): + """The List Disks operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of disks. + :type value: list[~azure.mgmt.compute.v2020_06_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 = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Disk]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["Disk"], + next_link: Optional[str] = None, + **kwargs + ): + super(DiskList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +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. + + :param name: The sku name. Possible values include: "Standard_LRS", "Premium_LRS", + "StandardSSD_LRS", "UltraSSD_LRS". + :type name: str or ~azure.mgmt.compute.v2020_06_30.models.DiskStorageAccountTypes + :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, "DiskStorageAccountTypes"]] = None, + **kwargs + ): + super(DiskSku, self).__init__(**kwargs) + self.name = name + self.tier = None + + +class DiskUpdate(msrest.serialization.Model): + """Disk update resource. + + :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_06_30.models.DiskSku + :param os_type: the Operating System type. Possible values include: "Windows", "Linux". + :type os_type: str or ~azure.mgmt.compute.v2020_06_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_06_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_06_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_06_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 + """ + + _attribute_map = { + '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'}, + } + + def __init__( + self, + *, + 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, + **kwargs + ): + 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 + + +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_06_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 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. Possible values include: "SystemAssigned". + :type type: str or ~azure.mgmt.compute.v2020_06_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. + + :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_06_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 = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'encryption_settings': {'key': 'encryptionSettings', 'type': '[EncryptionSettingsElement]'}, + 'encryption_settings_version': {'key': 'encryptionSettingsVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + enabled: bool, + encryption_settings: Optional[List["EncryptionSettingsElement"]] = None, + encryption_settings_version: Optional[str] = None, + **kwargs + ): + super(EncryptionSettingsCollection, self).__init__(**kwargs) + self.enabled = enabled + self.encryption_settings = encryption_settings + self.encryption_settings_version = encryption_settings_version + + +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_06_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_06_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 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_06_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 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 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_06_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_06_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 PrivateEndpoint(msrest.serialization.Model): + """The Private Endpoint resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ARM identifier for Private Endpoint. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None + + +class PrivateEndpointConnection(msrest.serialization.Model): + """The Private Endpoint Connection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: private endpoint connection Id. + :vartype id: str + :ivar name: private endpoint connection name. + :vartype name: str + :ivar type: private endpoint connection type. + :vartype type: str + :param private_endpoint: The resource of private end point. + :type private_endpoint: ~azure.mgmt.compute.v2020_06_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_06_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_06_30.models.PrivateEndpointConnectionProvisioningState + """ + + _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'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + private_endpoint: Optional["PrivateEndpoint"] = None, + private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, + **kwargs + ): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + self.provisioning_state = None + + +class PrivateLinkResource(msrest.serialization.Model): + """A private link resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :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': {'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, + *, + required_zone_names: Optional[List[str]] = None, + **kwargs + ): + 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 PrivateLinkResourceListResult(msrest.serialization.Model): + """A list of private link resources. + + :param value: Array of private link resources. + :type value: list[~azure.mgmt.compute.v2020_06_30.models.PrivateLinkResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__( + self, + *, + value: Optional[List["PrivateLinkResource"]] = None, + **kwargs + ): + super(PrivateLinkResourceListResult, self).__init__(**kwargs) + self.value = value + + +class PrivateLinkServiceConnectionState(msrest.serialization.Model): + """A collection of information about the state of the connection between service consumer and provider. + + :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_06_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 + """ + + _attribute_map = { + '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(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + self.actions_required = actions_required + + +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 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 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. + :type sku: ~azure.mgmt.compute.v2020_06_30.models.SnapshotSku + :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_06_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_06_30.models.HyperVGeneration + :param creation_data: Disk source information. CreationData information cannot be changed after + the disk has been created. + :type creation_data: ~azure.mgmt.compute.v2020_06_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_06_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_06_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_06_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_06_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'}, + 'time_created': {'key': 'properties.timeCreated', 'type': 'iso-8601'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, + '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, + os_type: Optional[Union[str, "OperatingSystemTypes"]] = None, + hyper_v_generation: Optional[Union[str, "HyperVGeneration"]] = 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.time_created = None + self.os_type = os_type + self.hyper_v_generation = hyper_v_generation + 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_06_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. + + 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_06_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. + :type sku: ~azure.mgmt.compute.v2020_06_30.models.SnapshotSku + :param os_type: the Operating System type. Possible values include: "Windows", "Linux". + :type os_type: str or ~azure.mgmt.compute.v2020_06_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_06_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_06_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_06_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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/__init__.py new file mode 100644 index 000000000000..22cffb20eb1d --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/__init__.py @@ -0,0 +1,19 @@ +# 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 ._disks_operations import DisksOperations +from ._snapshots_operations import SnapshotsOperations +from ._disk_encryption_sets_operations import DiskEncryptionSetsOperations +from ._disk_accesses_operations import DiskAccessesOperations + +__all__ = [ + 'DisksOperations', + 'SnapshotsOperations', + 'DiskEncryptionSetsOperations', + 'DiskAccessesOperations', +] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disk_accesses_operations.py new file mode 100644 index 000000000000..f16acba79993 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disk_accesses_operations.py @@ -0,0 +1,666 @@ +# 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 + +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_06_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-06-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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, **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-06-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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, **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_06_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-06-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-06-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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_06_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-06-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_06_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-06-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_06_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-06-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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disk_encryption_sets_operations.py new file mode 100644 index 000000000000..e98d04b473be --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disk_encryption_sets_operations.py @@ -0,0 +1,684 @@ +# 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 + +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_06_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-06-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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, **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-06-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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, **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_06_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-06-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-06-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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_06_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-06-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_06_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-06-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_06_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-06-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_06_30/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disks_operations.py new file mode 100644 index 000000000000..a1e62b7afa55 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disks_operations.py @@ -0,0 +1,832 @@ +# 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 + +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_06_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-06-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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, **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-06-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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, **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_06_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-06-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-06-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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_06_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-06-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_06_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-06-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-06-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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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-06-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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_30/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_snapshots_operations.py new file mode 100644 index 000000000000..f34000502562 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_snapshots_operations.py @@ -0,0 +1,832 @@ +# 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 + +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_06_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-06-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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, **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-06-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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, **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_06_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-06-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-06-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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **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_06_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-06-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_06_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-06-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-06-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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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-06-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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/py.typed b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute.test_compute_availability_sets.yaml b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute.test_compute_availability_sets.yaml index 180fa5b20248..a2c7387282ac 100644 --- a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute.test_compute_availability_sets.yaml +++ b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute.test_compute_availability_sets.yaml @@ -14,9 +14,9 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/availabilitySets/availabilitysetse7f013f3?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/availabilitySets/availabilitysetse7f013f3?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"availabilitysetse7f013f3\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/availabilitySets/availabilitysetse7f013f3\"\ @@ -28,11 +28,11 @@ interactions: cache-control: - no-cache content-length: - - '461' + - '480' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:03:32 GMT + - Wed, 16 Sep 2020 05:36:11 GMT expires: - '-1' pragma: @@ -49,9 +49,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/PutVM3Min;573,Microsoft.Compute/PutVM30Min;2877 + - Microsoft.Compute/PutVM3Min;239,Microsoft.Compute/PutVM30Min;1199 x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' status: code: 200 message: OK @@ -65,9 +65,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/availabilitySets/availabilitysetse7f013f3?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/availabilitySets/availabilitysetse7f013f3?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"availabilitysetse7f013f3\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/availabilitySets/availabilitysetse7f013f3\"\ @@ -79,11 +79,11 @@ interactions: cache-control: - no-cache content-length: - - '489' + - '508' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:03:32 GMT + - Wed, 16 Sep 2020 05:36:11 GMT expires: - '-1' pragma: @@ -100,7 +100,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;3999,Microsoft.Compute/LowCostGet30Min;31999 + - Microsoft.Compute/LowCostGet3Min;3998,Microsoft.Compute/LowCostGet30Min;31998 status: code: 200 message: OK @@ -119,9 +119,9 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/availabilitySets/availabilitysetse7f013f3?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/availabilitySets/availabilitysetse7f013f3?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"availabilitysetse7f013f3\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/availabilitySets/availabilitysetse7f013f3\"\ @@ -133,11 +133,11 @@ interactions: cache-control: - no-cache content-length: - - '461' + - '480' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:03:33 GMT + - Wed, 16 Sep 2020 05:36:12 GMT expires: - '-1' pragma: @@ -154,9 +154,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/PutVM3Min;572,Microsoft.Compute/PutVM30Min;2876 + - Microsoft.Compute/PutVM3Min;238,Microsoft.Compute/PutVM30Min;1198 x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1197' status: code: 200 message: OK @@ -172,9 +172,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/availabilitySets/availabilitysetse7f013f3?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/availabilitySets/availabilitysetse7f013f3?api-version=2020-06-01 response: body: string: '' @@ -184,7 +184,7 @@ interactions: content-length: - '0' date: - - Mon, 18 May 2020 15:03:35 GMT + - Wed, 16 Sep 2020 05:36:18 GMT expires: - '-1' pragma: @@ -199,7 +199,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/DeleteVM3Min;239,Microsoft.Compute/DeleteVM30Min;1199 x-ms-ratelimit-remaining-subscription-deletes: - - '14999' + - '14998' status: code: 200 message: OK diff --git a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute.test_compute_log_analytics.yaml b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute.test_compute_log_analytics.yaml index d07dcb810910..5a2a3ec8fddb 100644 --- a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute.test_compute_log_analytics.yaml +++ b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute.test_compute_log_analytics.yaml @@ -2,8 +2,7 @@ interactions: - request: body: '{"sku": {"name": "Standard_GRS"}, "kind": "StorageV2", "location": "eastus", "tags": {"key1": "value1", "key2": "value2"}, "properties": {"encryption": {"services": - {"blob": {"enabled": true, "keyType": "Account"}, "file": {"enabled": true, - "keyType": "Account"}}, "keySource": "Microsoft.Storage"}}}' + {"blob": {"enabled": true}, "file": {"enabled": true}}, "keySource": "Microsoft.Storage"}}}' headers: Accept: - application/json @@ -12,16 +11,16 @@ interactions: Connection: - keep-alive Content-Length: - - '300' + - '256' Content-Type: - application/json; charset=utf-8 User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-storage/10.0.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-storage/5.0.0 Azure-SDK-For-Python accept-language: - en-US method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/accountxyz9b271243?api-version=2019-06-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/accountxyz9b271243?api-version=2019-04-01 response: body: string: '' @@ -33,11 +32,11 @@ interactions: content-type: - text/plain; charset=utf-8 date: - - Mon, 18 May 2020 15:03:47 GMT + - Thu, 17 Sep 2020 02:13:21 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/a21371b1-8837-494e-b65c-f7c6c4d667db?monitor=true&api-version=2019-06-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/dfc2ec61-073a-4e3c-9415-2c0a936ab5f5?monitor=true&api-version=2019-04-01 pragma: - no-cache server: @@ -62,21 +61,21 @@ interactions: - keep-alive User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-storage/10.0.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-storage/5.0.0 Azure-SDK-For-Python method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/a21371b1-8837-494e-b65c-f7c6c4d667db?monitor=true&api-version=2019-06-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/dfc2ec61-073a-4e3c-9415-2c0a936ab5f5?monitor=true&api-version=2019-04-01 response: body: - string: '{"sku":{"name":"Standard_GRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/accountxyz9b271243","name":"accountxyz9b271243","type":"Microsoft.Storage/storageAccounts","location":"eastus","tags":{"key1":"value1","key2":"value2"},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-05-18T15:03:48.1189336Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-05-18T15:03:48.1189336Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-05-18T15:03:48.0252078Z","primaryEndpoints":{"dfs":"https://accountxyz9b271243.dfs.core.windows.net/","web":"https://accountxyz9b271243.z13.web.core.windows.net/","blob":"https://accountxyz9b271243.blob.core.windows.net/","queue":"https://accountxyz9b271243.queue.core.windows.net/","table":"https://accountxyz9b271243.table.core.windows.net/","file":"https://accountxyz9b271243.file.core.windows.net/"},"primaryLocation":"eastus","statusOfPrimary":"available","secondaryLocation":"westus","statusOfSecondary":"available"}}' + string: '{"sku":{"name":"Standard_GRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/accountxyz9b271243","name":"accountxyz9b271243","type":"Microsoft.Storage/storageAccounts","location":"eastus","tags":{"key1":"value1","key2":"value2"},"properties":{"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"enabled":true,"lastEnabledTime":"2020-09-17T02:13:22.2931040Z"},"blob":{"enabled":true,"lastEnabledTime":"2020-09-17T02:13:22.2931040Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-09-17T02:13:22.1837626Z","primaryEndpoints":{"dfs":"https://accountxyz9b271243.dfs.core.windows.net/","web":"https://accountxyz9b271243.z13.web.core.windows.net/","blob":"https://accountxyz9b271243.blob.core.windows.net/","queue":"https://accountxyz9b271243.queue.core.windows.net/","table":"https://accountxyz9b271243.table.core.windows.net/","file":"https://accountxyz9b271243.file.core.windows.net/"},"primaryLocation":"eastus","statusOfPrimary":"available","secondaryLocation":"westus","statusOfSecondary":"available"}}' headers: cache-control: - no-cache content-length: - - '1412' + - '1363' content-type: - application/json date: - - Mon, 18 May 2020 15:04:05 GMT + - Thu, 17 Sep 2020 02:13:40 GMT expires: - '-1' pragma: @@ -107,14 +106,14 @@ interactions: - '0' User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-storage/10.0.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-storage/5.0.0 Azure-SDK-For-Python accept-language: - en-US method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/accountxyz9b271243/listKeys?api-version=2019-06-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/accountxyz9b271243/listKeys?api-version=2019-04-01 response: body: - string: '{"keys":[{"keyName":"key1","value":"qgNmRis/6xMtWLv1dgahhRl8u99KXX2h3LnvH7YdNR2auSQooBdSHjgvOdGPink7RoeoYAYDAeTX3UNi5BqP7A==","permissions":"FULL"},{"keyName":"key2","value":"FyxANqI0H3CVEL6RvEQnOz1PEq30FmD+YX3q2bcnjDWwF4mn33O1OwOdRha7k00QjpzEvd4tF4sEebcUV4d/dQ==","permissions":"FULL"}]}' + string: '{"keys":[{"keyName":"key1","value":"AAHrM3j3/4FsGPvu0uPThDo2tgAy/1qQkKI+TipRL9H58SazXrp//C1rjN1DNKInBdFNy3sP/mlhryNjWIJcVw==","permissions":"FULL"},{"keyName":"key2","value":"LLoXQ7w8nHHTg5kLPoDCXKonSuxYzpNUHwKJ8nIP00caDJgqQ2CvHk8mVGAaeOLUbFCSWEEK7CFwv8MW/MMclw==","permissions":"FULL"}]}' headers: cache-control: - no-cache @@ -123,7 +122,7 @@ interactions: content-type: - application/json date: - - Mon, 18 May 2020 15:04:06 GMT + - Thu, 17 Sep 2020 02:13:40 GMT expires: - '-1' pragma: @@ -144,8 +143,8 @@ interactions: code: 200 message: OK - request: - body: '{"blobContainerSasUri": "https://accountxyz9b271243.blob.core.windows.net/foo?st=2020-05-17T15%3A06%3A18Z&se=2020-05-10T15%3A06%3A18Z&sp=rl&sv=2019-07-07&ss=b&srt=o&sig=MXInQw7eB9wQ6voYOYx6q1A%2B5P2WSkatmcvog0JlwKQ%3D", - "fromTime": "2020-05-16T15:06:18.404047Z", "toTime": "2020-05-18T15:06:18.404052Z", + body: '{"blobContainerSasUri": "https://accountxyz9b271243.blob.core.windows.net/foo?st=2020-09-16T02%3A13%3A39Z&se=2020-09-09T02%3A13%3A39Z&sp=rl&sv=2019-12-12&ss=b&srt=o&sig=lr1T%2BLVSHvW5DA/l4Vu8LAe/pJWGljr6pQpavuSgEc8%3D", + "fromTime": "2020-09-15T02:13:39.873906Z", "toTime": "2020-09-17T02:13:39.873922Z", "groupByResourceName": true, "intervalLength": "SixtyMins"}' headers: Accept: @@ -159,25 +158,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/logAnalytics/apiAccess/getRequestRateByInterval?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/logAnalytics/apiAccess/getRequestRateByInterval?api-version=2020-06-01 response: body: - string: "{\r\n \"error\": {\r\n \"code\": \"InvalidParameter\",\r\n \"\ - message\": \"The value of parameter 'toTime':5/18/2020 3:06:18 PM +00:00 cannot\ - \ be in the future.\",\r\n \"target\": \"toTime\"\r\n }\r\n}" + string: '' headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/effeb475-6e41-405e-b4b9-c08dd2e16e68?api-version=2020-06-01 cache-control: - no-cache content-length: - - '184' - content-type: - - application/json; charset=utf-8 + - '0' date: - - Mon, 18 May 2020 15:04:08 GMT + - Thu, 17 Sep 2020 02:13:42 GMT expires: - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/effeb475-6e41-405e-b4b9-c08dd2e16e68?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -192,11 +191,61 @@ interactions: x-ms-ratelimit-remaining-subscription-writes: - '1199' status: - code: 400 - message: Bad Request + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/effeb475-6e41-405e-b4b9-c08dd2e16e68?api-version=2020-06-01 + response: + body: + string: "{\r\n \"startTime\": \"2020-09-17T02:13:42.710507+00:00\",\r\n \"\ + endTime\": \"2020-09-17T02:13:43.4136663+00:00\",\r\n \"status\": \"Failed\"\ + ,\r\n \"error\": {\r\n \"code\": \"BadRequest\",\r\n \"message\": \"\ + Could not write log analytics to the given SAS URI due to The remote server\ + \ returned an error: (403) Forbidden..\"\r\n },\r\n \"name\": \"effeb475-6e41-405e-b4b9-c08dd2e16e68\"\ + \r\n}" + headers: + cache-control: + - no-cache + content-length: + - '358' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 17 Sep 2020 02:14:12 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetOperation3Min;14998,Microsoft.Compute/GetOperation30Min;29998 + status: + code: 200 + message: OK - request: - body: '{"blobContainerSasUri": "https://accountxyz9b271243.blob.core.windows.net/foo?st=2020-05-17T15%3A06%3A18Z&se=2020-05-10T15%3A06%3A18Z&sp=rl&sv=2019-07-07&ss=b&srt=o&sig=MXInQw7eB9wQ6voYOYx6q1A%2B5P2WSkatmcvog0JlwKQ%3D", - "fromTime": "2020-05-16T15:06:20.470105Z", "toTime": "2020-05-18T15:06:20.470129Z", + body: '{"blobContainerSasUri": "https://accountxyz9b271243.blob.core.windows.net/foo?st=2020-09-16T02%3A13%3A39Z&se=2020-09-09T02%3A13%3A39Z&sp=rl&sv=2019-12-12&ss=b&srt=o&sig=lr1T%2BLVSHvW5DA/l4Vu8LAe/pJWGljr6pQpavuSgEc8%3D", + "fromTime": "2020-09-15T02:14:12.068676Z", "toTime": "2020-09-17T02:14:12.068688Z", "groupByOperationName": true, "groupByResourceName": false}' headers: Accept: @@ -210,25 +259,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/logAnalytics/apiAccess/getThrottledRequests?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/logAnalytics/apiAccess/getThrottledRequests?api-version=2020-06-01 response: body: - string: "{\r\n \"error\": {\r\n \"code\": \"InvalidParameter\",\r\n \"\ - message\": \"The value of parameter 'toTime':5/18/2020 3:06:20 PM +00:00 cannot\ - \ be in the future.\",\r\n \"target\": \"toTime\"\r\n }\r\n}" + string: '' headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/25e7796a-aab0-463e-9b05-0e91f56cbf84?api-version=2020-06-01 cache-control: - no-cache content-length: - - '184' - content-type: - - application/json; charset=utf-8 + - '0' date: - - Mon, 18 May 2020 15:04:09 GMT + - Thu, 17 Sep 2020 02:14:13 GMT expires: - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/25e7796a-aab0-463e-9b05-0e91f56cbf84?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -243,6 +292,56 @@ interactions: x-ms-ratelimit-remaining-subscription-writes: - '1198' status: - code: 400 - message: Bad Request + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/25e7796a-aab0-463e-9b05-0e91f56cbf84?api-version=2020-06-01 + response: + body: + string: "{\r\n \"startTime\": \"2020-09-17T02:14:13.7419842+00:00\",\r\n \"\ + endTime\": \"2020-09-17T02:14:13.9451034+00:00\",\r\n \"status\": \"Failed\"\ + ,\r\n \"error\": {\r\n \"code\": \"BadRequest\",\r\n \"message\": \"\ + Could not write log analytics to the given SAS URI due to The remote server\ + \ returned an error: (403) Forbidden..\"\r\n },\r\n \"name\": \"25e7796a-aab0-463e-9b05-0e91f56cbf84\"\ + \r\n}" + headers: + cache-control: + - no-cache + content-length: + - '359' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 17 Sep 2020 02:14:43 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetOperation3Min;14996,Microsoft.Compute/GetOperation30Min;29996 + status: + code: 200 + message: OK version: 1 diff --git a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute.test_compute_proximity_placement_groups.yaml b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute.test_compute_proximity_placement_groups.yaml index 9a055a201cde..2e43d577fdb2 100644 --- a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute.test_compute_proximity_placement_groups.yaml +++ b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute.test_compute_proximity_placement_groups.yaml @@ -13,9 +13,9 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/proximityPlacementGroups/proximiityplacementgroupsb24517e6?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/proximityPlacementGroups/proximiityplacementgroupsb24517e6?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"proximiityplacementgroupsb24517e6\",\r\n \"id\"\ @@ -27,11 +27,11 @@ interactions: cache-control: - no-cache content-length: - - '437' + - '447' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:04:24 GMT + - Wed, 16 Sep 2020 05:36:42 GMT expires: - '-1' pragma: @@ -46,7 +46,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/PutDeletePPG3Min;99,Microsoft.Compute/PutDeletePPG30Min;499 x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1197' status: code: 201 message: Created @@ -60,9 +60,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/proximityPlacementGroups/proximiityplacementgroupsb24517e6?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/proximityPlacementGroups/proximiityplacementgroupsb24517e6?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"proximiityplacementgroupsb24517e6\",\r\n \"id\"\ @@ -75,11 +75,11 @@ interactions: cache-control: - no-cache content-length: - - '530' + - '540' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:04:24 GMT + - Wed, 16 Sep 2020 05:36:43 GMT expires: - '-1' pragma: @@ -96,7 +96,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/HighCostGet3Min;138,Microsoft.Compute/HighCostGet30Min;692 + - Microsoft.Compute/HighCostGet3Min;139,Microsoft.Compute/HighCostGet30Min;699 status: code: 200 message: OK @@ -114,9 +114,9 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/proximityPlacementGroups/proximiityplacementgroupsb24517e6?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/proximityPlacementGroups/proximiityplacementgroupsb24517e6?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"proximiityplacementgroupsb24517e6\",\r\n \"id\"\ @@ -128,11 +128,11 @@ interactions: cache-control: - no-cache content-length: - - '437' + - '447' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:04:25 GMT + - Wed, 16 Sep 2020 05:36:43 GMT expires: - '-1' pragma: @@ -151,7 +151,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/PutDeletePPG3Min;98,Microsoft.Compute/PutDeletePPG30Min;498 x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1196' status: code: 200 message: OK @@ -167,9 +167,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/proximityPlacementGroups/proximiityplacementgroupsb24517e6?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/proximityPlacementGroups/proximiityplacementgroupsb24517e6?api-version=2020-06-01 response: body: string: '' @@ -179,7 +179,7 @@ interactions: content-length: - '0' date: - - Mon, 18 May 2020 15:04:26 GMT + - Wed, 16 Sep 2020 05:36:46 GMT expires: - '-1' pragma: @@ -194,7 +194,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/PutDeletePPG3Min;97,Microsoft.Compute/PutDeletePPG30Min;497 x-ms-ratelimit-remaining-subscription-deletes: - - '14999' + - '14997' status: code: 200 message: OK diff --git a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_base_async.test_compute_vm.yaml b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_base_async.test_compute_vm.yaml index 5fef9682910a..82e66b245a29 100644 --- a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_base_async.test_compute_vm.yaml +++ b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_base_async.test_compute_vm.yaml @@ -12,21 +12,18 @@ interactions: Content-Length: - '92' Content-Type: - - application/json; charset=utf-8 + - application/json User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexxx9a731234?api-version=2019-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexxx9a731234?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"networknamexxx9a731234\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexxx9a731234\"\ - ,\r\n \"etag\": \"W/\\\"83e156c5-41bd-4078-846e-48c36618870e\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"7651a95c-4689-4a2d-8a10-8ee7a137ec39\\\"\",\r\n \ \ \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \ - \ \"resourceGuid\": \"45bb8d07-00cf-45dc-9ab7-ed74a6b0f815\",\r\n \"\ + \ \"resourceGuid\": \"291808b4-e2b8-45e7-96d4-81c1f27182b2\",\r\n \"\ addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\ \r\n ]\r\n },\r\n \"subnets\": [],\r\n \"virtualNetworkPeerings\"\ : [],\r\n \"enableDdosProtection\": false,\r\n \"enableVmProtection\"\ @@ -35,15 +32,15 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/6de54a4f-95e8-42fe-9f39-f26088259825?api-version=2019-09-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/86191a67-a857-47c2-bce5-8ded3227ce04?api-version=2020-06-01 cache-control: - no-cache content-length: - - '708' + - '731' content-type: - application/json; charset=utf-8 date: - - Tue, 02 Jun 2020 02:43:30 GMT + - Wed, 16 Sep 2020 05:37:02 GMT expires: - '-1' pragma: @@ -56,9 +53,9 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 9ba248b7-e501-4cb3-be06-300d3ae5925c + - 693fcc31-c23e-450c-b991-a425ceb4652f x-ms-ratelimit-remaining-subscription-writes: - - '1193' + - '1194' status: code: 201 message: Created @@ -66,108 +63,15 @@ interactions: body: null headers: Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/6de54a4f-95e8-42fe-9f39-f26088259825?api-version=2019-09-01 - response: - body: - string: "{\r\n \"status\": \"InProgress\"\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '30' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 02 Jun 2020 02:43:35 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-arm-service-request-id: - - 5eb513b2-1790-4a83-b1a6-cb728feabe31 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/6de54a4f-95e8-42fe-9f39-f26088259825?api-version=2019-09-01 - response: - body: - string: "{\r\n \"status\": \"InProgress\"\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '30' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 02 Jun 2020 02:43:46 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-arm-service-request-id: - - d9adf64a-0e5f-4464-9d9d-653d716dafca - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/6de54a4f-95e8-42fe-9f39-f26088259825?api-version=2019-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/86191a67-a857-47c2-bce5-8ded3227ce04?api-version=2020-06-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -179,7 +83,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 02 Jun 2020 02:43:56 GMT + - Wed, 16 Sep 2020 05:37:06 GMT expires: - '-1' pragma: @@ -196,7 +100,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 8ab56d8f-3f14-42e5-9132-c122fe229cd2 + - 16a2c172-1996-44bc-b195-9a6671bfee5b status: code: 200 message: OK @@ -204,23 +108,22 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexxx9a731234?api-version=2019-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexxx9a731234?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"networknamexxx9a731234\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexxx9a731234\"\ - ,\r\n \"etag\": \"W/\\\"176f14c9-ea2a-4933-9bd4-f66c0b30c98f\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"d74ea635-6ad1-4135-b6d1-32f34f43bd90\\\"\",\r\n \ \ \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n\ - \ \"resourceGuid\": \"45bb8d07-00cf-45dc-9ab7-ed74a6b0f815\",\r\n \"\ + \ \"resourceGuid\": \"291808b4-e2b8-45e7-96d4-81c1f27182b2\",\r\n \"\ addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\ \r\n ]\r\n },\r\n \"subnets\": [],\r\n \"virtualNetworkPeerings\"\ : [],\r\n \"enableDdosProtection\": false,\r\n \"enableVmProtection\"\ @@ -229,13 +132,13 @@ interactions: cache-control: - no-cache content-length: - - '709' + - '732' content-type: - application/json; charset=utf-8 date: - - Tue, 02 Jun 2020 02:43:56 GMT + - Wed, 16 Sep 2020 05:37:09 GMT etag: - - W/"176f14c9-ea2a-4933-9bd4-f66c0b30c98f" + - W/"d74ea635-6ad1-4135-b6d1-32f34f43bd90" expires: - '-1' pragma: @@ -252,7 +155,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - a521ae5f-c486-4ab0-93e6-211d163af10c + - c7464fc7-39df-473c-b11b-7a8dddbaff6e status: code: 200 message: OK @@ -268,33 +171,30 @@ interactions: Content-Length: - '48' Content-Type: - - application/json; charset=utf-8 + - application/json User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexxx9a731234/subnets/subnetxxx9a731234?api-version=2019-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexxx9a731234/subnets/subnetxxx9a731234?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"subnetxxx9a731234\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexxx9a731234/subnets/subnetxxx9a731234\"\ - ,\r\n \"etag\": \"W/\\\"4a445e90-1036-4d61-a0c9-883bd5e0288a\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"22c8dff0-e1b3-4958-8d58-b3d45527fed7\\\"\",\r\n \ \ \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"\ addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\"\ : \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\ \n },\r\n \"type\": \"Microsoft.Network/virtualNetworks/subnets\"\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/fcea10a6-1097-4bf1-ad7e-1ca1a3fa8b7a?api-version=2019-09-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/9d1bbd52-8746-4c8d-9310-0ae905e10bac?api-version=2020-06-01 cache-control: - no-cache content-length: - - '599' + - '622' content-type: - application/json; charset=utf-8 date: - - Tue, 02 Jun 2020 02:43:57 GMT + - Wed, 16 Sep 2020 05:37:09 GMT expires: - '-1' pragma: @@ -307,9 +207,9 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - d149720e-d7bc-444e-a934-44af24e3a59d + - c6ea6904-276c-467f-9377-e85e46fe2d03 x-ms-ratelimit-remaining-subscription-writes: - - '1192' + - '1193' status: code: 201 message: Created @@ -317,16 +217,15 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/fcea10a6-1097-4bf1-ad7e-1ca1a3fa8b7a?api-version=2019-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/9d1bbd52-8746-4c8d-9310-0ae905e10bac?api-version=2020-06-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -338,7 +237,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 02 Jun 2020 02:44:01 GMT + - Wed, 16 Sep 2020 05:37:13 GMT expires: - '-1' pragma: @@ -355,7 +254,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 289cab28-ab9c-4482-b54d-29b5c0637222 + - e042fb03-c108-40b3-8d14-607e05ab52f3 status: code: 200 message: OK @@ -363,20 +262,19 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexxx9a731234/subnets/subnetxxx9a731234?api-version=2019-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexxx9a731234/subnets/subnetxxx9a731234?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"subnetxxx9a731234\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexxx9a731234/subnets/subnetxxx9a731234\"\ - ,\r\n \"etag\": \"W/\\\"ed5693e2-2fc9-4ac0-bdcb-78aa759bc844\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"e8ae3e51-fcf1-4a59-b6de-a9fed53ea51b\\\"\",\r\n \ \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"\ addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\"\ : \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\ @@ -385,13 +283,13 @@ interactions: cache-control: - no-cache content-length: - - '600' + - '623' content-type: - application/json; charset=utf-8 date: - - Tue, 02 Jun 2020 02:44:02 GMT + - Wed, 16 Sep 2020 05:37:13 GMT etag: - - W/"ed5693e2-2fc9-4ac0-bdcb-78aa759bc844" + - W/"e8ae3e51-fcf1-4a59-b6de-a9fed53ea51b" expires: - '-1' pragma: @@ -408,14 +306,13 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 70a2dbb7-da76-4a14-a0e5-8918e148b153 + - d3d8381c-bbff-4d54-b02c-a3872d0c44e1 status: code: 200 message: OK - request: - body: 'b''{"location": "eastus", "properties": {"ipConfigurations": [{"properties": - {"subnet": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexxx9a731234/subnets/subnetxxx9a731234"}}, - "name": "MyIpConfig"}]}}''' + body: 'b''b\''{"location": "eastus", "properties": {"ipConfigurations": [{"name": + "MyIpConfig", "properties": {"subnet": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexxx9a731234/subnets/subnetxxx9a731234"}}}]}}\''''' headers: Accept: - application/json @@ -424,25 +321,22 @@ interactions: Connection: - keep-alive Content-Length: - - '334' + - '357' Content-Type: - - application/json; charset=utf-8 + - application/json User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexxx9a731234?api-version=2019-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexxx9a731234?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"interfacexxx9a731234\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexxx9a731234\"\ - ,\r\n \"etag\": \"W/\\\"61a769b9-17cf-4823-8055-672efcfc6846\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"a6498207-d46c-417a-a194-542ecec55217\\\"\",\r\n \ \ \"location\": \"eastus\",\r\n \"properties\": {\r\n \"provisioningState\"\ - : \"Succeeded\",\r\n \"resourceGuid\": \"7d3e32e6-c37c-476c-af4a-67480fb6f077\"\ + : \"Succeeded\",\r\n \"resourceGuid\": \"f233dfd0-e70f-457f-a7e9-a725f2f8858a\"\ ,\r\n \"ipConfigurations\": [\r\n {\r\n \"name\": \"MyIpConfig\"\ ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexxx9a731234/ipConfigurations/MyIpConfig\"\ - ,\r\n \"etag\": \"W/\\\"61a769b9-17cf-4823-8055-672efcfc6846\\\"\"\ + ,\r\n \"etag\": \"W/\\\"a6498207-d46c-417a-a194-542ecec55217\\\"\"\ ,\r\n \"type\": \"Microsoft.Network/networkInterfaces/ipConfigurations\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\ ,\r\n \"privateIPAddress\": \"10.0.0.4\",\r\n \"privateIPAllocationMethod\"\ @@ -450,23 +344,24 @@ interactions: \r\n },\r\n \"primary\": true,\r\n \"privateIPAddressVersion\"\ : \"IPv4\"\r\n }\r\n }\r\n ],\r\n \"dnsSettings\": {\r\n\ \ \"dnsServers\": [],\r\n \"appliedDnsServers\": [],\r\n \"\ - internalDomainNameSuffix\": \"a4g1wropadoelgvx3v0knmhycf.bx.internal.cloudapp.net\"\ + internalDomainNameSuffix\": \"wqebqkny2ltulfwuqha5e2mcwc.bx.internal.cloudapp.net\"\ \r\n },\r\n \"enableAcceleratedNetworking\": false,\r\n \"enableIPForwarding\"\ - : false,\r\n \"hostedWorkloads\": [],\r\n \"tapConfigurations\": []\r\ - \n },\r\n \"type\": \"Microsoft.Network/networkInterfaces\"\r\n}" + : false,\r\n \"hostedWorkloads\": [],\r\n \"tapConfigurations\": [],\r\ + \n \"nicType\": \"Standard\"\r\n },\r\n \"type\": \"Microsoft.Network/networkInterfaces\"\ + \r\n}" headers: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/782e0dbc-7634-4927-8a6a-959aa9115a9b?api-version=2019-09-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/82099683-fa3f-42fb-a4fa-38012a498482?api-version=2020-06-01 cache-control: - no-cache content-length: - - '1776' + - '1873' content-type: - application/json; charset=utf-8 date: - - Tue, 02 Jun 2020 02:44:06 GMT + - Wed, 16 Sep 2020 05:37:18 GMT expires: - '-1' pragma: @@ -479,9 +374,9 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 89cc6c11-e291-4129-811c-c4019cf2aadc + - 9a2f4167-574a-4789-8839-2176ddd5d3d1 x-ms-ratelimit-remaining-subscription-writes: - - '1191' + - '1192' status: code: 201 message: Created @@ -489,16 +384,15 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/782e0dbc-7634-4927-8a6a-959aa9115a9b?api-version=2019-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/82099683-fa3f-42fb-a4fa-38012a498482?api-version=2020-06-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -510,7 +404,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 02 Jun 2020 02:44:37 GMT + - Wed, 16 Sep 2020 05:37:50 GMT expires: - '-1' pragma: @@ -527,7 +421,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 4b340bd8-6d3a-4445-ab23-7338f57602e2 + - 6319aaa3-60e4-4192-bc67-64e193149736 status: code: 200 message: OK @@ -535,25 +429,24 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexxx9a731234?api-version=2019-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexxx9a731234?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"interfacexxx9a731234\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexxx9a731234\"\ - ,\r\n \"etag\": \"W/\\\"61a769b9-17cf-4823-8055-672efcfc6846\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"a6498207-d46c-417a-a194-542ecec55217\\\"\",\r\n \ \ \"location\": \"eastus\",\r\n \"properties\": {\r\n \"provisioningState\"\ - : \"Succeeded\",\r\n \"resourceGuid\": \"7d3e32e6-c37c-476c-af4a-67480fb6f077\"\ + : \"Succeeded\",\r\n \"resourceGuid\": \"f233dfd0-e70f-457f-a7e9-a725f2f8858a\"\ ,\r\n \"ipConfigurations\": [\r\n {\r\n \"name\": \"MyIpConfig\"\ ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexxx9a731234/ipConfigurations/MyIpConfig\"\ - ,\r\n \"etag\": \"W/\\\"61a769b9-17cf-4823-8055-672efcfc6846\\\"\"\ + ,\r\n \"etag\": \"W/\\\"a6498207-d46c-417a-a194-542ecec55217\\\"\"\ ,\r\n \"type\": \"Microsoft.Network/networkInterfaces/ipConfigurations\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\ ,\r\n \"privateIPAddress\": \"10.0.0.4\",\r\n \"privateIPAllocationMethod\"\ @@ -561,21 +454,22 @@ interactions: \r\n },\r\n \"primary\": true,\r\n \"privateIPAddressVersion\"\ : \"IPv4\"\r\n }\r\n }\r\n ],\r\n \"dnsSettings\": {\r\n\ \ \"dnsServers\": [],\r\n \"appliedDnsServers\": [],\r\n \"\ - internalDomainNameSuffix\": \"a4g1wropadoelgvx3v0knmhycf.bx.internal.cloudapp.net\"\ + internalDomainNameSuffix\": \"wqebqkny2ltulfwuqha5e2mcwc.bx.internal.cloudapp.net\"\ \r\n },\r\n \"enableAcceleratedNetworking\": false,\r\n \"enableIPForwarding\"\ - : false,\r\n \"hostedWorkloads\": [],\r\n \"tapConfigurations\": []\r\ - \n },\r\n \"type\": \"Microsoft.Network/networkInterfaces\"\r\n}" + : false,\r\n \"hostedWorkloads\": [],\r\n \"tapConfigurations\": [],\r\ + \n \"nicType\": \"Standard\"\r\n },\r\n \"type\": \"Microsoft.Network/networkInterfaces\"\ + \r\n}" headers: cache-control: - no-cache content-length: - - '1776' + - '1873' content-type: - application/json; charset=utf-8 date: - - Tue, 02 Jun 2020 02:44:38 GMT + - Wed, 16 Sep 2020 05:37:50 GMT etag: - - W/"61a769b9-17cf-4823-8055-672efcfc6846" + - W/"a6498207-d46c-417a-a194-542ecec55217" expires: - '-1' pragma: @@ -592,12 +486,12 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 4ae21a5a-7c51-4234-9b87-8224c82121ff + - 82407015-ebd9-4d2d-b246-4aa86f8cae24 status: code: 200 message: OK - request: - body: 'b''{"location": "eastus", "properties": {"hardwareProfile": {"vmSize": + body: 'b''b\''{"location": "eastus", "properties": {"hardwareProfile": {"vmSize": "Standard_D2_v2"}, "storageProfile": {"imageReference": {"publisher": "MicrosoftWindowsServer", "offer": "WindowsServer", "sku": "2016-Datacenter", "version": "latest"}, "osDisk": {"name": "myVMosdisk", "caching": "ReadWrite", "createOption": "FromImage", @@ -606,28 +500,28 @@ interactions: "Empty", "diskSizeGB": 1023}]}, "osProfile": {"computerName": "myVM", "adminUsername": "testuser", "adminPassword": "Aa1!zyx_", "windowsConfiguration": {"enableAutomaticUpdates": true}}, "networkProfile": {"networkInterfaces": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexxx9a731234", - "properties": {"primary": true}}]}}}''' + "properties": {"primary": true}}]}}}\''''' headers: Accept: - application/json Content-Length: - - '939' + - '962' Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"virtualmachinexxx9a731234\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234\"\ ,\r\n \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\"\ - : \"eastus\",\r\n \"properties\": {\r\n \"vmId\": \"883a4b52-0091-48f3-a443-4ca2c729b516\"\ + : \"eastus\",\r\n \"properties\": {\r\n \"vmId\": \"38722ed0-8c2a-41c8-b86a-911c7b41900b\"\ ,\r\n \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_D2_v2\"\r\n\ \ },\r\n \"storageProfile\": {\r\n \"imageReference\": {\r\n \ \ \"publisher\": \"MicrosoftWindowsServer\",\r\n \"offer\": \"\ WindowsServer\",\r\n \"sku\": \"2016-Datacenter\",\r\n \"version\"\ - : \"latest\",\r\n \"exactVersion\": \"14393.3686.2005061700\"\r\n \ + : \"latest\",\r\n \"exactVersion\": \"14393.3930.2009041537\"\r\n \ \ },\r\n \"osDisk\": {\r\n \"osType\": \"Windows\",\r\n \ \ \"name\": \"myVMosdisk\",\r\n \"createOption\": \"FromImage\"\ ,\r\n \"caching\": \"ReadWrite\",\r\n \"managedDisk\": {\r\n\ @@ -644,46 +538,47 @@ interactions: \ }\r\n ]\r\n },\r\n \"osProfile\": {\r\n \"computerName\"\ : \"myVM\",\r\n \"adminUsername\": \"testuser\",\r\n \"windowsConfiguration\"\ : {\r\n \"provisionVMAgent\": true,\r\n \"enableAutomaticUpdates\"\ - : true\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\"\ + : true,\r\n \"patchSettings\": {\r\n \"patchMode\": \"AutomaticByOS\"\ + \r\n }\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\"\ : true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"\ networkProfile\": {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexxx9a731234\"\ ,\"properties\":{\"primary\":true}}]},\r\n \"provisioningState\": \"Creating\"\ \r\n }\r\n}" headers: azure-asyncnotification: Enabled - azure-asyncoperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e11f92dc-28fd-445d-99eb-77661f51d891?api-version=2019-12-01 + azure-asyncoperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2cef8a31-ee64-4aeb-a2be-0d3b0a23dea7?api-version=2020-06-01 cache-control: no-cache - content-length: '2197' + content-length: '2323' content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:44:48 GMT + date: Wed, 16 Sep 2020 05:38:02 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 strict-transport-security: max-age=31536000; includeSubDomains x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/PutVM3Min;239,Microsoft.Compute/PutVM30Min;1199 - x-ms-ratelimit-remaining-subscription-writes: '1198' + x-ms-ratelimit-remaining-resource: Microsoft.Compute/PutVM3Min;237,Microsoft.Compute/PutVM30Min;1197 + x-ms-ratelimit-remaining-subscription-writes: '1197' status: code: 201 message: Created - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7ptfb2ikpae54uu36j6dspcsgpshfkdjvcurhjjlqhipqtmxi4y3zoq46gypodis2e42puf3suq/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234?api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e11f92dc-28fd-445d-99eb-77661f51d891?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2cef8a31-ee64-4aeb-a2be-0d3b0a23dea7?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-02T02:44:47.8978828+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"e11f92dc-28fd-445d-99eb-77661f51d891\"\ + string: "{\r\n \"startTime\": \"2020-09-16T05:38:00.4432532+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"2cef8a31-ee64-4aeb-a2be-0d3b0a23dea7\"\ \r\n}" headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:44:59 GMT + date: Wed, 16 Sep 2020 05:38:12 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -695,24 +590,24 @@ interactions: status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/e11f92dc-28fd-445d-99eb-77661f51d891?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/2cef8a31-ee64-4aeb-a2be-0d3b0a23dea7?api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e11f92dc-28fd-445d-99eb-77661f51d891?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2cef8a31-ee64-4aeb-a2be-0d3b0a23dea7?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-02T02:44:47.8978828+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"e11f92dc-28fd-445d-99eb-77661f51d891\"\ - \r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T05:38:00.4432532+00:00\",\r\n \"\ + endTime\": \"2020-09-16T05:39:02.2093139+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"2cef8a31-ee64-4aeb-a2be-0d3b0a23dea7\"\r\n}" headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:45:50 GMT + date: Wed, 16 Sep 2020 05:39:02 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -724,84 +619,56 @@ interactions: status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/e11f92dc-28fd-445d-99eb-77661f51d891?api-version=2019-12-01 -- request: - body: null - headers: - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e11f92dc-28fd-445d-99eb-77661f51d891?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-06-02T02:44:47.8978828+00:00\",\r\n \"\ - endTime\": \"2020-06-02T02:46:09.5854983+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"e11f92dc-28fd-445d-99eb-77661f51d891\"\r\n}" - headers: - cache-control: no-cache - content-encoding: gzip - content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:46:21 GMT - expires: '-1' - pragma: no-cache - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000; includeSubDomains - transfer-encoding: chunked - vary: Accept-Encoding - x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14996,Microsoft.Compute/GetOperation30Min;29996 - status: - code: 200 - message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/e11f92dc-28fd-445d-99eb-77661f51d891?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/2cef8a31-ee64-4aeb-a2be-0d3b0a23dea7?api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"virtualmachinexxx9a731234\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234\"\ ,\r\n \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\"\ - : \"eastus\",\r\n \"properties\": {\r\n \"vmId\": \"883a4b52-0091-48f3-a443-4ca2c729b516\"\ + : \"eastus\",\r\n \"properties\": {\r\n \"vmId\": \"38722ed0-8c2a-41c8-b86a-911c7b41900b\"\ ,\r\n \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_D2_v2\"\r\n\ \ },\r\n \"storageProfile\": {\r\n \"imageReference\": {\r\n \ \ \"publisher\": \"MicrosoftWindowsServer\",\r\n \"offer\": \"\ WindowsServer\",\r\n \"sku\": \"2016-Datacenter\",\r\n \"version\"\ - : \"latest\",\r\n \"exactVersion\": \"14393.3686.2005061700\"\r\n \ + : \"latest\",\r\n \"exactVersion\": \"14393.3930.2009041537\"\r\n \ \ },\r\n \"osDisk\": {\r\n \"osType\": \"Windows\",\r\n \ \ \"name\": \"myVMosdisk\",\r\n \"createOption\": \"FromImage\"\ ,\r\n \"caching\": \"ReadWrite\",\r\n \"managedDisk\": {\r\n\ \ \"storageAccountType\": \"Standard_LRS\",\r\n \"id\":\ - \ \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/myVMosdisk\"\ + \ \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/7PTFB2IKPAE54UU36J6DSPCSGPSHFKDJVCURHJJLQHIPQTMXI4Y3ZOQ46GYPODIS2E42PUF3SUQ/providers/Microsoft.Compute/disks/myVMosdisk\"\ \r\n },\r\n \"diskSizeGB\": 127\r\n },\r\n \"dataDisks\"\ - : [\r\n {\r\n \"lun\": 0,\r\n \"name\": \"virtualmachinexxx9a731234_disk2_85ee171b01894583b0bb14ce0bbbc0a3\"\ + : [\r\n {\r\n \"lun\": 0,\r\n \"name\": \"virtualmachinexxx9a731234_disk2_65a6f784860149d4bdad9d8b9e2a8aa5\"\ ,\r\n \"createOption\": \"Empty\",\r\n \"caching\": \"None\"\ ,\r\n \"managedDisk\": {\r\n \"storageAccountType\": \"\ - Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/virtualmachinexxx9a731234_disk2_85ee171b01894583b0bb14ce0bbbc0a3\"\ + Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/7PTFB2IKPAE54UU36J6DSPCSGPSHFKDJVCURHJJLQHIPQTMXI4Y3ZOQ46GYPODIS2E42PUF3SUQ/providers/Microsoft.Compute/disks/virtualmachinexxx9a731234_disk2_65a6f784860149d4bdad9d8b9e2a8aa5\"\ \r\n },\r\n \"diskSizeGB\": 1023,\r\n \"toBeDetached\"\ : false\r\n },\r\n {\r\n \"lun\": 1,\r\n \"\ - name\": \"virtualmachinexxx9a731234_disk3_9e84ad297eb046bb918518a475f01c5d\"\ + name\": \"virtualmachinexxx9a731234_disk3_3fcecb66e0b74060a3194c7f95df789f\"\ ,\r\n \"createOption\": \"Empty\",\r\n \"caching\": \"None\"\ ,\r\n \"managedDisk\": {\r\n \"storageAccountType\": \"\ - Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/virtualmachinexxx9a731234_disk3_9e84ad297eb046bb918518a475f01c5d\"\ + Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/7PTFB2IKPAE54UU36J6DSPCSGPSHFKDJVCURHJJLQHIPQTMXI4Y3ZOQ46GYPODIS2E42PUF3SUQ/providers/Microsoft.Compute/disks/virtualmachinexxx9a731234_disk3_3fcecb66e0b74060a3194c7f95df789f\"\ \r\n },\r\n \"diskSizeGB\": 1023,\r\n \"toBeDetached\"\ : false\r\n }\r\n ]\r\n },\r\n \"osProfile\": {\r\n \ \ \"computerName\": \"myVM\",\r\n \"adminUsername\": \"testuser\",\r\ \n \"windowsConfiguration\": {\r\n \"provisionVMAgent\": true,\r\ - \n \"enableAutomaticUpdates\": true\r\n },\r\n \"secrets\"\ - : [],\r\n \"allowExtensionOperations\": true,\r\n \"requireGuestProvisionSignal\"\ - : true\r\n },\r\n \"networkProfile\": {\"networkInterfaces\":[{\"id\"\ - :\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexxx9a731234\"\ + \n \"enableAutomaticUpdates\": true,\r\n \"patchSettings\":\ + \ {\r\n \"patchMode\": \"AutomaticByOS\"\r\n }\r\n },\r\ + \n \"secrets\": [],\r\n \"allowExtensionOperations\": true,\r\n\ + \ \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\"\ + : {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexxx9a731234\"\ ,\"properties\":{\"primary\":true}}]},\r\n \"provisioningState\": \"Succeeded\"\ \r\n }\r\n}" headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:46:22 GMT + date: Wed, 16 Sep 2020 05:39:03 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -809,11 +676,11 @@ interactions: transfer-encoding: chunked vary: Accept-Encoding x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/LowCostGet3Min;3997,Microsoft.Compute/LowCostGet30Min;31997 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/LowCostGet3Min;3998,Microsoft.Compute/LowCostGet30Min;31996 status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7ptfb2ikpae54uu36j6dspcsgpshfkdjvcurhjjlqhipqtmxi4y3zoq46gypodis2e42puf3suq/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234?api-version=2020-06-01 - request: body: '{"location": "eastus", "properties": {"publisher": "Microsoft.Azure.NetworkWatcher", "type": "NetworkWatcherAgentWindows", "typeHandlerVersion": "1.4", "autoUpgradeMinorVersion": @@ -826,9 +693,9 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/extensions/virtualmachineextensionxxx9a731234?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/extensions/virtualmachineextensionxxx9a731234?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"virtualmachineextensionxxx9a731234\",\r\n \"id\"\ @@ -840,39 +707,68 @@ interactions: ,\r\n \"typeHandlerVersion\": \"1.4\"\r\n }\r\n}" headers: azure-asyncnotification: Enabled - azure-asyncoperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/ae82c9a7-e7f0-4daa-9544-8b68f40294cd?api-version=2019-12-01 + azure-asyncoperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/ad23e5d6-888c-46f9-8da1-877bb54a864a?api-version=2020-06-01 cache-control: no-cache - content-length: '613' + content-length: '636' content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:46:26 GMT + date: Wed, 16 Sep 2020 05:39:10 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 strict-transport-security: max-age=31536000; includeSubDomains x-content-type-options: nosniff x-ms-ratelimit-remaining-resource: Microsoft.Compute/UpdateVM3Min;239,Microsoft.Compute/UpdateVM30Min;1199 - x-ms-ratelimit-remaining-subscription-writes: '1195' + x-ms-ratelimit-remaining-subscription-writes: '1198' status: code: 201 message: Created - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/extensions/virtualmachineextensionxxx9a731234?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7ptfb2ikpae54uu36j6dspcsgpshfkdjvcurhjjlqhipqtmxi4y3zoq46gypodis2e42puf3suq/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/extensions/virtualmachineextensionxxx9a731234?api-version=2020-06-01 +- request: + body: null + headers: + User-Agent: + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/ad23e5d6-888c-46f9-8da1-877bb54a864a?api-version=2020-06-01 + response: + body: + string: "{\r\n \"startTime\": \"2020-09-16T05:39:09.1312305+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"ad23e5d6-888c-46f9-8da1-877bb54a864a\"\ + \r\n}" + headers: + cache-control: no-cache + content-encoding: gzip + content-type: application/json; charset=utf-8 + date: Wed, 16 Sep 2020 05:39:41 GMT + expires: '-1' + pragma: no-cache + server: Microsoft-HTTPAPI/2.0 + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + vary: Accept-Encoding + x-content-type-options: nosniff + x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14996,Microsoft.Compute/GetOperation30Min;29996 + status: + code: 200 + message: OK + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/ad23e5d6-888c-46f9-8da1-877bb54a864a?api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/ae82c9a7-e7f0-4daa-9544-8b68f40294cd?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/ad23e5d6-888c-46f9-8da1-877bb54a864a?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-02T02:46:24.9605143+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"ae82c9a7-e7f0-4daa-9544-8b68f40294cd\"\ + string: "{\r\n \"startTime\": \"2020-09-16T05:39:09.1312305+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"ad23e5d6-888c-46f9-8da1-877bb54a864a\"\ \r\n}" headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:46:57 GMT + date: Wed, 16 Sep 2020 05:40:14 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -884,24 +780,24 @@ interactions: status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/ae82c9a7-e7f0-4daa-9544-8b68f40294cd?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/ad23e5d6-888c-46f9-8da1-877bb54a864a?api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/ae82c9a7-e7f0-4daa-9544-8b68f40294cd?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/ad23e5d6-888c-46f9-8da1-877bb54a864a?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-02T02:46:24.9605143+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"ae82c9a7-e7f0-4daa-9544-8b68f40294cd\"\ + string: "{\r\n \"startTime\": \"2020-09-16T05:39:09.1312305+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"ad23e5d6-888c-46f9-8da1-877bb54a864a\"\ \r\n}" headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:47:27 GMT + date: Wed, 16 Sep 2020 05:40:45 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -913,24 +809,24 @@ interactions: status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/ae82c9a7-e7f0-4daa-9544-8b68f40294cd?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/ad23e5d6-888c-46f9-8da1-877bb54a864a?api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/ae82c9a7-e7f0-4daa-9544-8b68f40294cd?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/ad23e5d6-888c-46f9-8da1-877bb54a864a?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-02T02:46:24.9605143+00:00\",\r\n \"\ - endTime\": \"2020-06-02T02:47:41.3511247+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"ae82c9a7-e7f0-4daa-9544-8b68f40294cd\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T05:39:09.1312305+00:00\",\r\n \"\ + endTime\": \"2020-09-16T05:40:54.8194118+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"ad23e5d6-888c-46f9-8da1-877bb54a864a\"\r\n}" headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:47:58 GMT + date: Wed, 16 Sep 2020 05:41:16 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -938,18 +834,18 @@ interactions: transfer-encoding: chunked vary: Accept-Encoding x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14992,Microsoft.Compute/GetOperation30Min;29992 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29992 status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/ae82c9a7-e7f0-4daa-9544-8b68f40294cd?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/ad23e5d6-888c-46f9-8da1-877bb54a864a?api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/extensions/virtualmachineextensionxxx9a731234?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/extensions/virtualmachineextensionxxx9a731234?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"virtualmachineextensionxxx9a731234\",\r\n \"id\"\ @@ -963,7 +859,7 @@ interactions: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:47:58 GMT + date: Wed, 16 Sep 2020 05:41:16 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -971,66 +867,66 @@ interactions: transfer-encoding: chunked vary: Accept-Encoding x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/LowCostGet3Min;3995,Microsoft.Compute/LowCostGet30Min;31995 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/LowCostGet3Min;3995,Microsoft.Compute/LowCostGet30Min;31992 status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/extensions/virtualmachineextensionxxx9a731234?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7ptfb2ikpae54uu36j6dspcsgpshfkdjvcurhjjlqhipqtmxi4y3zoq46gypodis2e42puf3suq/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/extensions/virtualmachineextensionxxx9a731234?api-version=2020-06-01 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/instanceView?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/instanceView?api-version=2020-06-01 response: body: string: "{\r\n \"computerName\": \"myVM\",\r\n \"osName\": \"Windows Server\ \ 2016 Datacenter\",\r\n \"osVersion\": \"Microsoft Windows NT 10.0.14393.0\"\ - ,\r\n \"vmAgent\": {\r\n \"vmAgentVersion\": \"2.7.41491.971\",\r\n \ + ,\r\n \"vmAgent\": {\r\n \"vmAgentVersion\": \"2.7.41491.992\",\r\n \ \ \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\"\ ,\r\n \"level\": \"Info\",\r\n \"displayStatus\": \"Ready\"\ ,\r\n \"message\": \"GuestAgent is running and processing the extensions.\"\ - ,\r\n \"time\": \"2020-06-02T02:47:59+00:00\"\r\n }\r\n ],\r\ + ,\r\n \"time\": \"2020-09-16T05:41:05+00:00\"\r\n }\r\n ],\r\ \n \"extensionHandlers\": [\r\n {\r\n \"type\": \"Microsoft.Azure.NetworkWatcher.NetworkWatcherAgentWindows\"\ - ,\r\n \"typeHandlerVersion\": \"1.4.1527.2\",\r\n \"status\"\ + ,\r\n \"typeHandlerVersion\": \"1.4.1587.1\",\r\n \"status\"\ : {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n \"\ level\": \"Info\",\r\n \"displayStatus\": \"Ready\",\r\n \ \ \"message\": \"Plugin enabled (handler name: Microsoft.Azure.NetworkWatcher.NetworkWatcherAgentWindows,\ - \ extension name: , version: 1.4.1527.2).\"\r\n }\r\n }\r\n \ + \ extension name: , version: 1.4.1587.1).\"\r\n }\r\n }\r\n \ \ ]\r\n },\r\n \"disks\": [\r\n {\r\n \"name\": \"myVMosdisk\"\ ,\r\n \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\"\ ,\r\n \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning\ - \ succeeded\",\r\n \"time\": \"2020-06-02T02:44:49.9447917+00:00\"\ - \r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"virtualmachinexxx9a731234_disk2_85ee171b01894583b0bb14ce0bbbc0a3\"\ + \ succeeded\",\r\n \"time\": \"2020-09-16T05:38:03.3026458+00:00\"\ + \r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"virtualmachinexxx9a731234_disk2_65a6f784860149d4bdad9d8b9e2a8aa5\"\ ,\r\n \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\"\ ,\r\n \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning\ - \ succeeded\",\r\n \"time\": \"2020-06-02T02:44:49.9447917+00:00\"\ - \r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"virtualmachinexxx9a731234_disk3_9e84ad297eb046bb918518a475f01c5d\"\ + \ succeeded\",\r\n \"time\": \"2020-09-16T05:38:03.3026458+00:00\"\ + \r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"virtualmachinexxx9a731234_disk3_3fcecb66e0b74060a3194c7f95df789f\"\ ,\r\n \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\"\ ,\r\n \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning\ - \ succeeded\",\r\n \"time\": \"2020-06-02T02:44:49.9447917+00:00\"\ + \ succeeded\",\r\n \"time\": \"2020-09-16T05:38:03.3026458+00:00\"\ \r\n }\r\n ]\r\n }\r\n ],\r\n \"extensions\": [\r\n {\r\ \n \"name\": \"virtualmachineextensionxxx9a731234\",\r\n \"type\"\ : \"Microsoft.Azure.NetworkWatcher.NetworkWatcherAgentWindows\",\r\n \ - \ \"typeHandlerVersion\": \"1.4.1527.2\",\r\n \"statuses\": [\r\n \ + \ \"typeHandlerVersion\": \"1.4.1587.1\",\r\n \"statuses\": [\r\n \ \ {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n \ \ \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning succeeded\"\ ,\r\n \"message\": \"Plugin enabled (handler name: Microsoft.Azure.NetworkWatcher.NetworkWatcherAgentWindows,\ - \ extension name: , version: 1.4.1527.2).\"\r\n }\r\n ]\r\n \ + \ extension name: , version: 1.4.1587.1).\"\r\n }\r\n ]\r\n \ \ }\r\n ],\r\n \"hyperVGeneration\": \"V1\",\r\n \"statuses\": [\r\n \ \ {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n \"level\"\ : \"Info\",\r\n \"displayStatus\": \"Provisioning succeeded\",\r\n \ - \ \"time\": \"2020-06-02T02:47:41.3511247+00:00\"\r\n },\r\n {\r\n\ + \ \"time\": \"2020-09-16T05:40:54.8194118+00:00\"\r\n },\r\n {\r\n\ \ \"code\": \"PowerState/running\",\r\n \"level\": \"Info\",\r\n\ \ \"displayStatus\": \"VM running\"\r\n }\r\n ]\r\n}" headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:47:59 GMT + date: Wed, 16 Sep 2020 05:41:16 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -1038,20 +934,20 @@ interactions: transfer-encoding: chunked vary: Accept-Encoding x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/LowCostGet3Min;3994,Microsoft.Compute/LowCostGet30Min;31994 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/LowCostGet3Min;3994,Microsoft.Compute/LowCostGet30Min;31991 status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/instanceView?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7ptfb2ikpae54uu36j6dspcsgpshfkdjvcurhjjlqhipqtmxi4y3zoq46gypodis2e42puf3suq/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/instanceView?api-version=2020-06-01 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/extensions/virtualmachineextensionxxx9a731234?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/extensions/virtualmachineextensionxxx9a731234?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"virtualmachineextensionxxx9a731234\",\r\n \"id\"\ @@ -1065,7 +961,7 @@ interactions: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:47:59 GMT + date: Wed, 16 Sep 2020 05:41:17 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -1073,20 +969,20 @@ interactions: transfer-encoding: chunked vary: Accept-Encoding x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/LowCostGet3Min;3993,Microsoft.Compute/LowCostGet30Min;31993 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/LowCostGet3Min;3993,Microsoft.Compute/LowCostGet30Min;31990 status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/extensions/virtualmachineextensionxxx9a731234?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7ptfb2ikpae54uu36j6dspcsgpshfkdjvcurhjjlqhipqtmxi4y3zoq46gypodis2e42puf3suq/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/extensions/virtualmachineextensionxxx9a731234?api-version=2020-06-01 - request: body: null headers: Accept: - - application/json + - application/json, text/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/runCommands/RunPowerShellScript?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/runCommands/RunPowerShellScript?api-version=2020-06-01 response: body: string: "{\r\n \"script\": [\r\n \"param(\",\r\n \" [string]$arg1,\"\ @@ -1104,7 +1000,7 @@ interactions: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:47:59 GMT + date: Wed, 16 Sep 2020 05:41:17 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -1116,16 +1012,16 @@ interactions: status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/runCommands/RunPowerShellScript?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/runCommands/RunPowerShellScript?api-version=2020-06-01 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/vmSizes?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/vmSizes?api-version=2020-06-01 response: body: string: "{\r\n \"value\": [\r\n {\r\n \"name\": \"Standard_A0\",\r\n\ @@ -1273,8 +1169,38 @@ interactions: \n },\r\n {\r\n \"name\": \"Standard_D32_v3\",\r\n \"numberOfCores\"\ : 32,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ : 819200,\r\n \"memoryInMB\": 131072,\r\n \"maxDataDiskCount\":\ - \ 32\r\n },\r\n {\r\n \"name\": \"Standard_D48_v3\",\r\n \"\ - numberOfCores\": 48,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + \ 32\r\n },\r\n {\r\n \"name\": \"Standard_B1ls\",\r\n \"\ + numberOfCores\": 1,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 4096,\r\n \"memoryInMB\": 512,\r\n \"maxDataDiskCount\": 2\r\n\ + \ },\r\n {\r\n \"name\": \"Standard_B1ms\",\r\n \"numberOfCores\"\ + : 1,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 4096,\r\n \"memoryInMB\": 2048,\r\n \"maxDataDiskCount\": 2\r\n\ + \ },\r\n {\r\n \"name\": \"Standard_B1s\",\r\n \"numberOfCores\"\ + : 1,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 4096,\r\n \"memoryInMB\": 1024,\r\n \"maxDataDiskCount\": 2\r\n\ + \ },\r\n {\r\n \"name\": \"Standard_B2ms\",\r\n \"numberOfCores\"\ + : 2,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 16384,\r\n \"memoryInMB\": 8192,\r\n \"maxDataDiskCount\": 4\r\ + \n },\r\n {\r\n \"name\": \"Standard_B2s\",\r\n \"numberOfCores\"\ + : 2,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 8192,\r\n \"memoryInMB\": 4096,\r\n \"maxDataDiskCount\": 4\r\n\ + \ },\r\n {\r\n \"name\": \"Standard_B4ms\",\r\n \"numberOfCores\"\ + : 4,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 32768,\r\n \"memoryInMB\": 16384,\r\n \"maxDataDiskCount\": 8\r\ + \n },\r\n {\r\n \"name\": \"Standard_B8ms\",\r\n \"numberOfCores\"\ + : 8,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 65536,\r\n \"memoryInMB\": 32768,\r\n \"maxDataDiskCount\": 16\r\ + \n },\r\n {\r\n \"name\": \"Standard_B12ms\",\r\n \"numberOfCores\"\ + : 12,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 98304,\r\n \"memoryInMB\": 49152,\r\n \"maxDataDiskCount\": 16\r\ + \n },\r\n {\r\n \"name\": \"Standard_B16ms\",\r\n \"numberOfCores\"\ + : 16,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 131072,\r\n \"memoryInMB\": 65536,\r\n \"maxDataDiskCount\": 32\r\ + \n },\r\n {\r\n \"name\": \"Standard_B20ms\",\r\n \"numberOfCores\"\ + : 20,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 163840,\r\n \"memoryInMB\": 81920,\r\n \"maxDataDiskCount\": 32\r\ + \n },\r\n {\r\n \"name\": \"Standard_D48_v3\",\r\n \"numberOfCores\"\ + : 48,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ : 1228800,\r\n \"memoryInMB\": 196608,\r\n \"maxDataDiskCount\"\ : 32\r\n },\r\n {\r\n \"name\": \"Standard_D64_v3\",\r\n \"\ numberOfCores\": 64,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ @@ -1307,7 +1233,31 @@ interactions: ,\r\n \"numberOfCores\": 64,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ \ \"resourceDiskSizeInMB\": 1638400,\r\n \"memoryInMB\": 442368,\r\ \n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"\ - Standard_DS1\",\r\n \"numberOfCores\": 1,\r\n \"osDiskSizeInMB\"\ + Standard_D1\",\r\n \"numberOfCores\": 1,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 51200,\r\n \"memoryInMB\"\ + : 3584,\r\n \"maxDataDiskCount\": 4\r\n },\r\n {\r\n \"name\"\ + : \"Standard_D2\",\r\n \"numberOfCores\": 2,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 102400,\r\n \"memoryInMB\"\ + : 7168,\r\n \"maxDataDiskCount\": 8\r\n },\r\n {\r\n \"name\"\ + : \"Standard_D3\",\r\n \"numberOfCores\": 4,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 204800,\r\n \"memoryInMB\"\ + : 14336,\r\n \"maxDataDiskCount\": 16\r\n },\r\n {\r\n \"\ + name\": \"Standard_D4\",\r\n \"numberOfCores\": 8,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 409600,\r\n \"memoryInMB\"\ + : 28672,\r\n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"\ + name\": \"Standard_D11\",\r\n \"numberOfCores\": 2,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 102400,\r\n \"memoryInMB\"\ + : 14336,\r\n \"maxDataDiskCount\": 8\r\n },\r\n {\r\n \"name\"\ + : \"Standard_D12\",\r\n \"numberOfCores\": 4,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 204800,\r\n \"memoryInMB\"\ + : 28672,\r\n \"maxDataDiskCount\": 16\r\n },\r\n {\r\n \"\ + name\": \"Standard_D13\",\r\n \"numberOfCores\": 8,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 409600,\r\n \"memoryInMB\"\ + : 57344,\r\n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"\ + name\": \"Standard_D14\",\r\n \"numberOfCores\": 16,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 819200,\r\n \"memoryInMB\"\ + : 114688,\r\n \"maxDataDiskCount\": 64\r\n },\r\n {\r\n \"\ + name\": \"Standard_DS1\",\r\n \"numberOfCores\": 1,\r\n \"osDiskSizeInMB\"\ : 1047552,\r\n \"resourceDiskSizeInMB\": 7168,\r\n \"memoryInMB\"\ : 3584,\r\n \"maxDataDiskCount\": 4\r\n },\r\n {\r\n \"name\"\ : \"Standard_DS2\",\r\n \"numberOfCores\": 2,\r\n \"osDiskSizeInMB\"\ @@ -1331,36 +1281,6 @@ interactions: name\": \"Standard_DS14\",\r\n \"numberOfCores\": 16,\r\n \"osDiskSizeInMB\"\ : 1047552,\r\n \"resourceDiskSizeInMB\": 229376,\r\n \"memoryInMB\"\ : 114688,\r\n \"maxDataDiskCount\": 64\r\n },\r\n {\r\n \"\ - name\": \"Standard_B1ls\",\r\n \"numberOfCores\": 1,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 4096,\r\n \"memoryInMB\"\ - : 512,\r\n \"maxDataDiskCount\": 2\r\n },\r\n {\r\n \"name\"\ - : \"Standard_B1ms\",\r\n \"numberOfCores\": 1,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 4096,\r\n \"memoryInMB\"\ - : 2048,\r\n \"maxDataDiskCount\": 2\r\n },\r\n {\r\n \"name\"\ - : \"Standard_B1s\",\r\n \"numberOfCores\": 1,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 4096,\r\n \"memoryInMB\"\ - : 1024,\r\n \"maxDataDiskCount\": 2\r\n },\r\n {\r\n \"name\"\ - : \"Standard_B2ms\",\r\n \"numberOfCores\": 2,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 16384,\r\n \"memoryInMB\"\ - : 8192,\r\n \"maxDataDiskCount\": 4\r\n },\r\n {\r\n \"name\"\ - : \"Standard_B2s\",\r\n \"numberOfCores\": 2,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 8192,\r\n \"memoryInMB\"\ - : 4096,\r\n \"maxDataDiskCount\": 4\r\n },\r\n {\r\n \"name\"\ - : \"Standard_B4ms\",\r\n \"numberOfCores\": 4,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 32768,\r\n \"memoryInMB\"\ - : 16384,\r\n \"maxDataDiskCount\": 8\r\n },\r\n {\r\n \"name\"\ - : \"Standard_B8ms\",\r\n \"numberOfCores\": 8,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 65536,\r\n \"memoryInMB\"\ - : 32768,\r\n \"maxDataDiskCount\": 16\r\n },\r\n {\r\n \"\ - name\": \"Standard_B12ms\",\r\n \"numberOfCores\": 12,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 98304,\r\n \"memoryInMB\"\ - : 49152,\r\n \"maxDataDiskCount\": 16\r\n },\r\n {\r\n \"\ - name\": \"Standard_B16ms\",\r\n \"numberOfCores\": 16,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 131072,\r\n \"memoryInMB\"\ - : 65536,\r\n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"\ - name\": \"Standard_B20ms\",\r\n \"numberOfCores\": 20,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 163840,\r\n \"memoryInMB\"\ - : 81920,\r\n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"\ name\": \"Standard_DS1_v2\",\r\n \"numberOfCores\": 1,\r\n \"osDiskSizeInMB\"\ : 1047552,\r\n \"resourceDiskSizeInMB\": 7168,\r\n \"memoryInMB\"\ : 3584,\r\n \"maxDataDiskCount\": 4\r\n },\r\n {\r\n \"name\"\ @@ -1410,35 +1330,7 @@ interactions: ,\r\n \"numberOfCores\": 16,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ \ \"resourceDiskSizeInMB\": 229376,\r\n \"memoryInMB\": 114688,\r\ \n \"maxDataDiskCount\": 64\r\n },\r\n {\r\n \"name\": \"\ - Standard_DS15_v2\",\r\n \"numberOfCores\": 20,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 286720,\r\n \"memoryInMB\"\ - : 143360,\r\n \"maxDataDiskCount\": 64\r\n },\r\n {\r\n \"\ - name\": \"Standard_DS2_v2_Promo\",\r\n \"numberOfCores\": 2,\r\n \ - \ \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\": 14336,\r\ - \n \"memoryInMB\": 7168,\r\n \"maxDataDiskCount\": 8\r\n },\r\ - \n {\r\n \"name\": \"Standard_DS3_v2_Promo\",\r\n \"numberOfCores\"\ - : 4,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ - : 28672,\r\n \"memoryInMB\": 14336,\r\n \"maxDataDiskCount\": 16\r\ - \n },\r\n {\r\n \"name\": \"Standard_DS4_v2_Promo\",\r\n \"\ - numberOfCores\": 8,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ - : 57344,\r\n \"memoryInMB\": 28672,\r\n \"maxDataDiskCount\": 32\r\ - \n },\r\n {\r\n \"name\": \"Standard_DS5_v2_Promo\",\r\n \"\ - numberOfCores\": 16,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ - : 114688,\r\n \"memoryInMB\": 57344,\r\n \"maxDataDiskCount\": 64\r\ - \n },\r\n {\r\n \"name\": \"Standard_DS11_v2_Promo\",\r\n \ - \ \"numberOfCores\": 2,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"\ - resourceDiskSizeInMB\": 28672,\r\n \"memoryInMB\": 14336,\r\n \"\ - maxDataDiskCount\": 8\r\n },\r\n {\r\n \"name\": \"Standard_DS12_v2_Promo\"\ - ,\r\n \"numberOfCores\": 4,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ - \ \"resourceDiskSizeInMB\": 57344,\r\n \"memoryInMB\": 28672,\r\n\ - \ \"maxDataDiskCount\": 16\r\n },\r\n {\r\n \"name\": \"Standard_DS13_v2_Promo\"\ - ,\r\n \"numberOfCores\": 8,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ - \ \"resourceDiskSizeInMB\": 114688,\r\n \"memoryInMB\": 57344,\r\ - \n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"\ - Standard_DS14_v2_Promo\",\r\n \"numberOfCores\": 16,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 229376,\r\n \"memoryInMB\"\ - : 114688,\r\n \"maxDataDiskCount\": 64\r\n },\r\n {\r\n \"\ - name\": \"Standard_F1s\",\r\n \"numberOfCores\": 1,\r\n \"osDiskSizeInMB\"\ + Standard_F1s\",\r\n \"numberOfCores\": 1,\r\n \"osDiskSizeInMB\"\ : 1047552,\r\n \"resourceDiskSizeInMB\": 4096,\r\n \"memoryInMB\"\ : 2048,\r\n \"maxDataDiskCount\": 4\r\n },\r\n {\r\n \"name\"\ : \"Standard_F2s\",\r\n \"numberOfCores\": 2,\r\n \"osDiskSizeInMB\"\ @@ -1468,100 +1360,260 @@ interactions: \n {\r\n \"name\": \"Standard_D32s_v3\",\r\n \"numberOfCores\"\ : 32,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ : 262144,\r\n \"memoryInMB\": 131072,\r\n \"maxDataDiskCount\":\ - \ 32\r\n },\r\n {\r\n \"name\": \"Standard_NC6\",\r\n \"numberOfCores\"\ - : 6,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ - : 389120,\r\n \"memoryInMB\": 57344,\r\n \"maxDataDiskCount\": 24\r\ - \n },\r\n {\r\n \"name\": \"Standard_NC12\",\r\n \"numberOfCores\"\ - : 12,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ - : 696320,\r\n \"memoryInMB\": 114688,\r\n \"maxDataDiskCount\":\ - \ 48\r\n },\r\n {\r\n \"name\": \"Standard_NC24\",\r\n \"\ - numberOfCores\": 24,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ - : 1474560,\r\n \"memoryInMB\": 229376,\r\n \"maxDataDiskCount\"\ - : 64\r\n },\r\n {\r\n \"name\": \"Standard_NC24r\",\r\n \"\ - numberOfCores\": 24,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ - : 1474560,\r\n \"memoryInMB\": 229376,\r\n \"maxDataDiskCount\"\ - : 64\r\n },\r\n {\r\n \"name\": \"Standard_NC6_Promo\",\r\n \ - \ \"numberOfCores\": 6,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"\ - resourceDiskSizeInMB\": 389120,\r\n \"memoryInMB\": 57344,\r\n \"\ - maxDataDiskCount\": 24\r\n },\r\n {\r\n \"name\": \"Standard_NC12_Promo\"\ - ,\r\n \"numberOfCores\": 12,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ - \ \"resourceDiskSizeInMB\": 696320,\r\n \"memoryInMB\": 114688,\r\ - \n \"maxDataDiskCount\": 48\r\n },\r\n {\r\n \"name\": \"\ - Standard_NC24_Promo\",\r\n \"numberOfCores\": 24,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 1474560,\r\n \"memoryInMB\"\ - : 229376,\r\n \"maxDataDiskCount\": 64\r\n },\r\n {\r\n \"\ - name\": \"Standard_NC24r_Promo\",\r\n \"numberOfCores\": 24,\r\n \ - \ \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\": 1474560,\r\ - \n \"memoryInMB\": 229376,\r\n \"maxDataDiskCount\": 64\r\n },\r\ - \n {\r\n \"name\": \"Standard_D48s_v3\",\r\n \"numberOfCores\"\ - : 48,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ - : 393216,\r\n \"memoryInMB\": 196608,\r\n \"maxDataDiskCount\":\ - \ 32\r\n },\r\n {\r\n \"name\": \"Standard_D64s_v3\",\r\n \ - \ \"numberOfCores\": 64,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"\ - resourceDiskSizeInMB\": 524288,\r\n \"memoryInMB\": 262144,\r\n \ - \ \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"Standard_E2s_v3\"\ - ,\r\n \"numberOfCores\": 2,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ - \ \"resourceDiskSizeInMB\": 32768,\r\n \"memoryInMB\": 16384,\r\n\ - \ \"maxDataDiskCount\": 4\r\n },\r\n {\r\n \"name\": \"Standard_E4-2s_v3\"\ - ,\r\n \"numberOfCores\": 4,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ - \ \"resourceDiskSizeInMB\": 65536,\r\n \"memoryInMB\": 32768,\r\n\ - \ \"maxDataDiskCount\": 8\r\n },\r\n {\r\n \"name\": \"Standard_E4s_v3\"\ - ,\r\n \"numberOfCores\": 4,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ - \ \"resourceDiskSizeInMB\": 65536,\r\n \"memoryInMB\": 32768,\r\n\ - \ \"maxDataDiskCount\": 8\r\n },\r\n {\r\n \"name\": \"Standard_E8-2s_v3\"\ - ,\r\n \"numberOfCores\": 8,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ - \ \"resourceDiskSizeInMB\": 131072,\r\n \"memoryInMB\": 65536,\r\ - \n \"maxDataDiskCount\": 16\r\n },\r\n {\r\n \"name\": \"\ - Standard_E8-4s_v3\",\r\n \"numberOfCores\": 8,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 131072,\r\n \"memoryInMB\"\ - : 65536,\r\n \"maxDataDiskCount\": 16\r\n },\r\n {\r\n \"\ - name\": \"Standard_E8s_v3\",\r\n \"numberOfCores\": 8,\r\n \"osDiskSizeInMB\"\ + \ 32\r\n },\r\n {\r\n \"name\": \"Standard_D48s_v3\",\r\n \ + \ \"numberOfCores\": 48,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"\ + resourceDiskSizeInMB\": 393216,\r\n \"memoryInMB\": 196608,\r\n \ + \ \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"Standard_D64s_v3\"\ + ,\r\n \"numberOfCores\": 64,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 524288,\r\n \"memoryInMB\": 262144,\r\ + \n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"\ + Standard_E2s_v3\",\r\n \"numberOfCores\": 2,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 32768,\r\n \"memoryInMB\"\ + : 16384,\r\n \"maxDataDiskCount\": 4\r\n },\r\n {\r\n \"name\"\ + : \"Standard_E4-2s_v3\",\r\n \"numberOfCores\": 4,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 65536,\r\n \"memoryInMB\"\ + : 32768,\r\n \"maxDataDiskCount\": 8\r\n },\r\n {\r\n \"name\"\ + : \"Standard_E4s_v3\",\r\n \"numberOfCores\": 4,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 65536,\r\n \"memoryInMB\"\ + : 32768,\r\n \"maxDataDiskCount\": 8\r\n },\r\n {\r\n \"name\"\ + : \"Standard_E8-2s_v3\",\r\n \"numberOfCores\": 8,\r\n \"osDiskSizeInMB\"\ : 1047552,\r\n \"resourceDiskSizeInMB\": 131072,\r\n \"memoryInMB\"\ : 65536,\r\n \"maxDataDiskCount\": 16\r\n },\r\n {\r\n \"\ - name\": \"Standard_E16-4s_v3\",\r\n \"numberOfCores\": 16,\r\n \"\ - osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\": 262144,\r\n\ - \ \"memoryInMB\": 131072,\r\n \"maxDataDiskCount\": 32\r\n },\r\ - \n {\r\n \"name\": \"Standard_E16-8s_v3\",\r\n \"numberOfCores\"\ + name\": \"Standard_E8-4s_v3\",\r\n \"numberOfCores\": 8,\r\n \"\ + osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\": 131072,\r\n\ + \ \"memoryInMB\": 65536,\r\n \"maxDataDiskCount\": 16\r\n },\r\ + \n {\r\n \"name\": \"Standard_E8s_v3\",\r\n \"numberOfCores\"\ + : 8,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 131072,\r\n \"memoryInMB\": 65536,\r\n \"maxDataDiskCount\": 16\r\ + \n },\r\n {\r\n \"name\": \"Standard_E16-4s_v3\",\r\n \"numberOfCores\"\ : 16,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ : 262144,\r\n \"memoryInMB\": 131072,\r\n \"maxDataDiskCount\":\ - \ 32\r\n },\r\n {\r\n \"name\": \"Standard_E16s_v3\",\r\n \ - \ \"numberOfCores\": 16,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"\ - resourceDiskSizeInMB\": 262144,\r\n \"memoryInMB\": 131072,\r\n \ - \ \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"Standard_E20s_v3\"\ - ,\r\n \"numberOfCores\": 20,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ - \ \"resourceDiskSizeInMB\": 327680,\r\n \"memoryInMB\": 163840,\r\ + \ 32\r\n },\r\n {\r\n \"name\": \"Standard_E16-8s_v3\",\r\n \ + \ \"numberOfCores\": 16,\r\n \"osDiskSizeInMB\": 1047552,\r\n \ + \ \"resourceDiskSizeInMB\": 262144,\r\n \"memoryInMB\": 131072,\r\n \ + \ \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"Standard_E16s_v3\"\ + ,\r\n \"numberOfCores\": 16,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 262144,\r\n \"memoryInMB\": 131072,\r\ \n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"\ - Standard_E32-8s_v3\",\r\n \"numberOfCores\": 32,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 524288,\r\n \"memoryInMB\"\ - : 262144,\r\n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"\ - name\": \"Standard_E32-16s_v3\",\r\n \"numberOfCores\": 32,\r\n \ - \ \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\": 524288,\r\ - \n \"memoryInMB\": 262144,\r\n \"maxDataDiskCount\": 32\r\n },\r\ - \n {\r\n \"name\": \"Standard_E32s_v3\",\r\n \"numberOfCores\"\ + Standard_E20s_v3\",\r\n \"numberOfCores\": 20,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 327680,\r\n \"memoryInMB\"\ + : 163840,\r\n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"\ + name\": \"Standard_E32-8s_v3\",\r\n \"numberOfCores\": 32,\r\n \"\ + osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\": 524288,\r\n\ + \ \"memoryInMB\": 262144,\r\n \"maxDataDiskCount\": 32\r\n },\r\ + \n {\r\n \"name\": \"Standard_E32-16s_v3\",\r\n \"numberOfCores\"\ : 32,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ : 524288,\r\n \"memoryInMB\": 262144,\r\n \"maxDataDiskCount\":\ - \ 32\r\n },\r\n {\r\n \"name\": \"Standard_E48s_v3\",\r\n \ - \ \"numberOfCores\": 48,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"\ - resourceDiskSizeInMB\": 786432,\r\n \"memoryInMB\": 393216,\r\n \ - \ \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"Standard_E64-16s_v3\"\ - ,\r\n \"numberOfCores\": 64,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ - \ \"resourceDiskSizeInMB\": 884736,\r\n \"memoryInMB\": 442368,\r\ + \ 32\r\n },\r\n {\r\n \"name\": \"Standard_E32s_v3\",\r\n \ + \ \"numberOfCores\": 32,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"\ + resourceDiskSizeInMB\": 524288,\r\n \"memoryInMB\": 262144,\r\n \ + \ \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"Standard_E48s_v3\"\ + ,\r\n \"numberOfCores\": 48,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 786432,\r\n \"memoryInMB\": 393216,\r\ \n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"\ - Standard_E64-32s_v3\",\r\n \"numberOfCores\": 64,\r\n \"osDiskSizeInMB\"\ + Standard_E64-16s_v3\",\r\n \"numberOfCores\": 64,\r\n \"osDiskSizeInMB\"\ : 1047552,\r\n \"resourceDiskSizeInMB\": 884736,\r\n \"memoryInMB\"\ : 442368,\r\n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"\ - name\": \"Standard_E64is_v3\",\r\n \"numberOfCores\": 64,\r\n \"\ - osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\": 884736,\r\n\ - \ \"memoryInMB\": 442368,\r\n \"maxDataDiskCount\": 32\r\n },\r\ - \n {\r\n \"name\": \"Standard_E64s_v3\",\r\n \"numberOfCores\"\ + name\": \"Standard_E64-32s_v3\",\r\n \"numberOfCores\": 64,\r\n \ + \ \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\": 884736,\r\ + \n \"memoryInMB\": 442368,\r\n \"maxDataDiskCount\": 32\r\n },\r\ + \n {\r\n \"name\": \"Standard_E64is_v3\",\r\n \"numberOfCores\"\ : 64,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ : 884736,\r\n \"memoryInMB\": 442368,\r\n \"maxDataDiskCount\":\ - \ 32\r\n }\r\n ]\r\n}" + \ 32\r\n },\r\n {\r\n \"name\": \"Standard_E64s_v3\",\r\n \ + \ \"numberOfCores\": 64,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"\ + resourceDiskSizeInMB\": 884736,\r\n \"memoryInMB\": 442368,\r\n \ + \ \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"Standard_DS15_v2\"\ + ,\r\n \"numberOfCores\": 20,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 286720,\r\n \"memoryInMB\": 143360,\r\ + \n \"maxDataDiskCount\": 64\r\n },\r\n {\r\n \"name\": \"\ + Standard_DS2_v2_Promo\",\r\n \"numberOfCores\": 2,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 14336,\r\n \"memoryInMB\"\ + : 7168,\r\n \"maxDataDiskCount\": 8\r\n },\r\n {\r\n \"name\"\ + : \"Standard_DS3_v2_Promo\",\r\n \"numberOfCores\": 4,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 28672,\r\n \"memoryInMB\"\ + : 14336,\r\n \"maxDataDiskCount\": 16\r\n },\r\n {\r\n \"\ + name\": \"Standard_DS4_v2_Promo\",\r\n \"numberOfCores\": 8,\r\n \ + \ \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\": 57344,\r\ + \n \"memoryInMB\": 28672,\r\n \"maxDataDiskCount\": 32\r\n },\r\ + \n {\r\n \"name\": \"Standard_DS5_v2_Promo\",\r\n \"numberOfCores\"\ + : 16,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 114688,\r\n \"memoryInMB\": 57344,\r\n \"maxDataDiskCount\": 64\r\ + \n },\r\n {\r\n \"name\": \"Standard_DS11_v2_Promo\",\r\n \ + \ \"numberOfCores\": 2,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"\ + resourceDiskSizeInMB\": 28672,\r\n \"memoryInMB\": 14336,\r\n \"\ + maxDataDiskCount\": 8\r\n },\r\n {\r\n \"name\": \"Standard_DS12_v2_Promo\"\ + ,\r\n \"numberOfCores\": 4,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 57344,\r\n \"memoryInMB\": 28672,\r\n\ + \ \"maxDataDiskCount\": 16\r\n },\r\n {\r\n \"name\": \"Standard_DS13_v2_Promo\"\ + ,\r\n \"numberOfCores\": 8,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 114688,\r\n \"memoryInMB\": 57344,\r\ + \n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"\ + Standard_DS14_v2_Promo\",\r\n \"numberOfCores\": 16,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 229376,\r\n \"memoryInMB\"\ + : 114688,\r\n \"maxDataDiskCount\": 64\r\n },\r\n {\r\n \"\ + name\": \"Standard_F2s_v2\",\r\n \"numberOfCores\": 2,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 16384,\r\n \"memoryInMB\"\ + : 4096,\r\n \"maxDataDiskCount\": 4\r\n },\r\n {\r\n \"name\"\ + : \"Standard_F4s_v2\",\r\n \"numberOfCores\": 4,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 32768,\r\n \"memoryInMB\"\ + : 8192,\r\n \"maxDataDiskCount\": 8\r\n },\r\n {\r\n \"name\"\ + : \"Standard_F8s_v2\",\r\n \"numberOfCores\": 8,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 65536,\r\n \"memoryInMB\"\ + : 16384,\r\n \"maxDataDiskCount\": 16\r\n },\r\n {\r\n \"\ + name\": \"Standard_F16s_v2\",\r\n \"numberOfCores\": 16,\r\n \"\ + osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\": 131072,\r\n\ + \ \"memoryInMB\": 32768,\r\n \"maxDataDiskCount\": 32\r\n },\r\ + \n {\r\n \"name\": \"Standard_F32s_v2\",\r\n \"numberOfCores\"\ + : 32,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 262144,\r\n \"memoryInMB\": 65536,\r\n \"maxDataDiskCount\": 32\r\ + \n },\r\n {\r\n \"name\": \"Standard_F48s_v2\",\r\n \"numberOfCores\"\ + : 48,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 393216,\r\n \"memoryInMB\": 98304,\r\n \"maxDataDiskCount\": 32\r\ + \n },\r\n {\r\n \"name\": \"Standard_F64s_v2\",\r\n \"numberOfCores\"\ + : 64,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 524288,\r\n \"memoryInMB\": 131072,\r\n \"maxDataDiskCount\":\ + \ 32\r\n },\r\n {\r\n \"name\": \"Standard_F72s_v2\",\r\n \ + \ \"numberOfCores\": 72,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"\ + resourceDiskSizeInMB\": 589824,\r\n \"memoryInMB\": 147456,\r\n \ + \ \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"Standard_D2a_v4\"\ + ,\r\n \"numberOfCores\": 2,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 51200,\r\n \"memoryInMB\": 8192,\r\n\ + \ \"maxDataDiskCount\": 4\r\n },\r\n {\r\n \"name\": \"Standard_D4a_v4\"\ + ,\r\n \"numberOfCores\": 4,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 102400,\r\n \"memoryInMB\": 16384,\r\ + \n \"maxDataDiskCount\": 8\r\n },\r\n {\r\n \"name\": \"Standard_D8a_v4\"\ + ,\r\n \"numberOfCores\": 8,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 204800,\r\n \"memoryInMB\": 32768,\r\ + \n \"maxDataDiskCount\": 16\r\n },\r\n {\r\n \"name\": \"\ + Standard_D16a_v4\",\r\n \"numberOfCores\": 16,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 409600,\r\n \"memoryInMB\"\ + : 65536,\r\n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"\ + name\": \"Standard_D32a_v4\",\r\n \"numberOfCores\": 32,\r\n \"\ + osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\": 819200,\r\n\ + \ \"memoryInMB\": 131072,\r\n \"maxDataDiskCount\": 32\r\n },\r\ + \n {\r\n \"name\": \"Standard_D48a_v4\",\r\n \"numberOfCores\"\ + : 48,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 1228800,\r\n \"memoryInMB\": 196608,\r\n \"maxDataDiskCount\"\ + : 32\r\n },\r\n {\r\n \"name\": \"Standard_D64a_v4\",\r\n \ + \ \"numberOfCores\": 64,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"\ + resourceDiskSizeInMB\": 1638400,\r\n \"memoryInMB\": 262144,\r\n \ + \ \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"Standard_D96a_v4\"\ + ,\r\n \"numberOfCores\": 96,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 2457600,\r\n \"memoryInMB\": 393216,\r\ + \n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"\ + Standard_D2as_v4\",\r\n \"numberOfCores\": 2,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 16384,\r\n \"memoryInMB\"\ + : 8192,\r\n \"maxDataDiskCount\": 4\r\n },\r\n {\r\n \"name\"\ + : \"Standard_D4as_v4\",\r\n \"numberOfCores\": 4,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 32768,\r\n \"memoryInMB\"\ + : 16384,\r\n \"maxDataDiskCount\": 8\r\n },\r\n {\r\n \"name\"\ + : \"Standard_D8as_v4\",\r\n \"numberOfCores\": 8,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 65536,\r\n \"memoryInMB\"\ + : 32768,\r\n \"maxDataDiskCount\": 16\r\n },\r\n {\r\n \"\ + name\": \"Standard_D16as_v4\",\r\n \"numberOfCores\": 16,\r\n \"\ + osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\": 131072,\r\n\ + \ \"memoryInMB\": 65536,\r\n \"maxDataDiskCount\": 32\r\n },\r\ + \n {\r\n \"name\": \"Standard_D32as_v4\",\r\n \"numberOfCores\"\ + : 32,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 262144,\r\n \"memoryInMB\": 131072,\r\n \"maxDataDiskCount\":\ + \ 32\r\n },\r\n {\r\n \"name\": \"Standard_D48as_v4\",\r\n \ + \ \"numberOfCores\": 48,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"\ + resourceDiskSizeInMB\": 393216,\r\n \"memoryInMB\": 196608,\r\n \ + \ \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"Standard_D64as_v4\"\ + ,\r\n \"numberOfCores\": 64,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 524288,\r\n \"memoryInMB\": 262144,\r\ + \n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"\ + Standard_D96as_v4\",\r\n \"numberOfCores\": 96,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 786432,\r\n \"memoryInMB\"\ + : 393216,\r\n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"\ + name\": \"Standard_E2a_v4\",\r\n \"numberOfCores\": 2,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 51200,\r\n \"memoryInMB\"\ + : 16384,\r\n \"maxDataDiskCount\": 4\r\n },\r\n {\r\n \"name\"\ + : \"Standard_E4a_v4\",\r\n \"numberOfCores\": 4,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 102400,\r\n \"memoryInMB\"\ + : 32768,\r\n \"maxDataDiskCount\": 8\r\n },\r\n {\r\n \"name\"\ + : \"Standard_E8a_v4\",\r\n \"numberOfCores\": 8,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 204800,\r\n \"memoryInMB\"\ + : 65536,\r\n \"maxDataDiskCount\": 16\r\n },\r\n {\r\n \"\ + name\": \"Standard_E16a_v4\",\r\n \"numberOfCores\": 16,\r\n \"\ + osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\": 409600,\r\n\ + \ \"memoryInMB\": 131072,\r\n \"maxDataDiskCount\": 32\r\n },\r\ + \n {\r\n \"name\": \"Standard_E20a_v4\",\r\n \"numberOfCores\"\ + : 20,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 512000,\r\n \"memoryInMB\": 163840,\r\n \"maxDataDiskCount\":\ + \ 32\r\n },\r\n {\r\n \"name\": \"Standard_E32a_v4\",\r\n \ + \ \"numberOfCores\": 32,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"\ + resourceDiskSizeInMB\": 819200,\r\n \"memoryInMB\": 262144,\r\n \ + \ \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"Standard_E48a_v4\"\ + ,\r\n \"numberOfCores\": 48,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 1228800,\r\n \"memoryInMB\": 393216,\r\ + \n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"\ + Standard_E64a_v4\",\r\n \"numberOfCores\": 64,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 1638400,\r\n \"memoryInMB\"\ + : 524288,\r\n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"\ + name\": \"Standard_E96a_v4\",\r\n \"numberOfCores\": 96,\r\n \"\ + osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\": 2457600,\r\n\ + \ \"memoryInMB\": 688128,\r\n \"maxDataDiskCount\": 32\r\n },\r\ + \n {\r\n \"name\": \"Standard_E2as_v4\",\r\n \"numberOfCores\"\ + : 2,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 32768,\r\n \"memoryInMB\": 16384,\r\n \"maxDataDiskCount\": 4\r\ + \n },\r\n {\r\n \"name\": \"Standard_E4as_v4\",\r\n \"numberOfCores\"\ + : 4,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 65536,\r\n \"memoryInMB\": 32768,\r\n \"maxDataDiskCount\": 8\r\ + \n },\r\n {\r\n \"name\": \"Standard_E8as_v4\",\r\n \"numberOfCores\"\ + : 8,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 131072,\r\n \"memoryInMB\": 65536,\r\n \"maxDataDiskCount\": 16\r\ + \n },\r\n {\r\n \"name\": \"Standard_E16as_v4\",\r\n \"numberOfCores\"\ + : 16,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 262144,\r\n \"memoryInMB\": 131072,\r\n \"maxDataDiskCount\":\ + \ 32\r\n },\r\n {\r\n \"name\": \"Standard_E20as_v4\",\r\n \ + \ \"numberOfCores\": 20,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"\ + resourceDiskSizeInMB\": 327680,\r\n \"memoryInMB\": 163840,\r\n \ + \ \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"Standard_E32as_v4\"\ + ,\r\n \"numberOfCores\": 32,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 524288,\r\n \"memoryInMB\": 262144,\r\ + \n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"\ + Standard_E48as_v4\",\r\n \"numberOfCores\": 48,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 786432,\r\n \"memoryInMB\"\ + : 393216,\r\n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"\ + name\": \"Standard_E64as_v4\",\r\n \"numberOfCores\": 64,\r\n \"\ + osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\": 884736,\r\n\ + \ \"memoryInMB\": 524288,\r\n \"maxDataDiskCount\": 32\r\n },\r\ + \n {\r\n \"name\": \"Standard_E96as_v4\",\r\n \"numberOfCores\"\ + : 96,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 1376256,\r\n \"memoryInMB\": 688128,\r\n \"maxDataDiskCount\"\ + : 32\r\n },\r\n {\r\n \"name\": \"Standard_NC6\",\r\n \"numberOfCores\"\ + : 6,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 389120,\r\n \"memoryInMB\": 57344,\r\n \"maxDataDiskCount\": 24\r\ + \n },\r\n {\r\n \"name\": \"Standard_NC12\",\r\n \"numberOfCores\"\ + : 12,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 696320,\r\n \"memoryInMB\": 114688,\r\n \"maxDataDiskCount\":\ + \ 48\r\n },\r\n {\r\n \"name\": \"Standard_NC24\",\r\n \"\ + numberOfCores\": 24,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 1474560,\r\n \"memoryInMB\": 229376,\r\n \"maxDataDiskCount\"\ + : 64\r\n },\r\n {\r\n \"name\": \"Standard_NC24r\",\r\n \"\ + numberOfCores\": 24,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 1474560,\r\n \"memoryInMB\": 229376,\r\n \"maxDataDiskCount\"\ + : 64\r\n },\r\n {\r\n \"name\": \"Standard_NC6_Promo\",\r\n \ + \ \"numberOfCores\": 6,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"\ + resourceDiskSizeInMB\": 389120,\r\n \"memoryInMB\": 57344,\r\n \"\ + maxDataDiskCount\": 24\r\n },\r\n {\r\n \"name\": \"Standard_NC12_Promo\"\ + ,\r\n \"numberOfCores\": 12,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 696320,\r\n \"memoryInMB\": 114688,\r\ + \n \"maxDataDiskCount\": 48\r\n },\r\n {\r\n \"name\": \"\ + Standard_NC24_Promo\",\r\n \"numberOfCores\": 24,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 1474560,\r\n \"memoryInMB\"\ + : 229376,\r\n \"maxDataDiskCount\": 64\r\n },\r\n {\r\n \"\ + name\": \"Standard_NC24r_Promo\",\r\n \"numberOfCores\": 24,\r\n \ + \ \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\": 1474560,\r\ + \n \"memoryInMB\": 229376,\r\n \"maxDataDiskCount\": 64\r\n }\r\ + \n ]\r\n}" headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:48:00 GMT + date: Wed, 16 Sep 2020 05:41:18 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -1569,20 +1621,20 @@ interactions: transfer-encoding: chunked vary: Accept-Encoding x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/LowCostGet3Min;3992,Microsoft.Compute/LowCostGet30Min;31992 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/LowCostGet3Min;3992,Microsoft.Compute/LowCostGet30Min;31989 status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/vmSizes?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7ptfb2ikpae54uu36j6dspcsgpshfkdjvcurhjjlqhipqtmxi4y3zoq46gypodis2e42puf3suq/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/vmSizes?api-version=2020-06-01 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/extensions?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/extensions?api-version=2020-06-01 response: body: string: "{\r\n \"value\": [\r\n {\r\n \"name\": \"virtualmachineextensionxxx9a731234\"\ @@ -1597,7 +1649,7 @@ interactions: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:48:00 GMT + date: Wed, 16 Sep 2020 05:41:18 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -1605,20 +1657,20 @@ interactions: transfer-encoding: chunked vary: Accept-Encoding x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/LowCostGet3Min;3991,Microsoft.Compute/LowCostGet30Min;31991 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/LowCostGet3Min;3991,Microsoft.Compute/LowCostGet30Min;31988 status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/extensions?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7ptfb2ikpae54uu36j6dspcsgpshfkdjvcurhjjlqhipqtmxi4y3zoq46gypodis2e42puf3suq/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/extensions?api-version=2020-06-01 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/vmSizes?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/vmSizes?api-version=2020-06-01 response: body: string: "{\r\n \"value\": [\r\n {\r\n \"name\": \"Standard_B1ls\",\r\ @@ -2001,7 +2053,26 @@ interactions: ,\r\n \"numberOfCores\": 64,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ \ \"resourceDiskSizeInMB\": 884736,\r\n \"memoryInMB\": 442368,\r\ \n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"\ - Standard_H8\",\r\n \"numberOfCores\": 8,\r\n \"osDiskSizeInMB\"\ + Standard_M208ms_v2\",\r\n \"numberOfCores\": 208,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 4194304,\r\n \"memoryInMB\"\ + : 5836800,\r\n \"maxDataDiskCount\": 64\r\n },\r\n {\r\n \"\ + name\": \"Standard_M208s_v2\",\r\n \"numberOfCores\": 208,\r\n \"\ + osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\": 4194304,\r\n\ + \ \"memoryInMB\": 2918400,\r\n \"maxDataDiskCount\": 64\r\n },\r\ + \n {\r\n \"name\": \"Standard_M416-208s_v2\",\r\n \"numberOfCores\"\ + : 416,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 8388608,\r\n \"memoryInMB\": 5836800,\r\n \"maxDataDiskCount\"\ + : 64\r\n },\r\n {\r\n \"name\": \"Standard_M416s_v2\",\r\n \ + \ \"numberOfCores\": 416,\r\n \"osDiskSizeInMB\": 1047552,\r\n \ + \ \"resourceDiskSizeInMB\": 8388608,\r\n \"memoryInMB\": 5836800,\r\n\ + \ \"maxDataDiskCount\": 64\r\n },\r\n {\r\n \"name\": \"Standard_M416-208ms_v2\"\ + ,\r\n \"numberOfCores\": 416,\r\n \"osDiskSizeInMB\": 1047552,\r\ + \n \"resourceDiskSizeInMB\": 8388608,\r\n \"memoryInMB\": 11673600,\r\ + \n \"maxDataDiskCount\": 64\r\n },\r\n {\r\n \"name\": \"\ + Standard_M416ms_v2\",\r\n \"numberOfCores\": 416,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 8388608,\r\n \"memoryInMB\"\ + : 11673600,\r\n \"maxDataDiskCount\": 64\r\n },\r\n {\r\n \ + \ \"name\": \"Standard_H8\",\r\n \"numberOfCores\": 8,\r\n \"osDiskSizeInMB\"\ : 1047552,\r\n \"resourceDiskSizeInMB\": 1024000,\r\n \"memoryInMB\"\ : 57344,\r\n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"\ name\": \"Standard_H8_Promo\",\r\n \"numberOfCores\": 8,\r\n \"\ @@ -2057,38 +2128,85 @@ interactions: \ 48\r\n },\r\n {\r\n \"name\": \"Standard_NV24_Promo\",\r\n \ \ \"numberOfCores\": 24,\r\n \"osDiskSizeInMB\": 1047552,\r\n \ \ \"resourceDiskSizeInMB\": 1474560,\r\n \"memoryInMB\": 229376,\r\n\ - \ \"maxDataDiskCount\": 64\r\n },\r\n {\r\n \"name\": \"Standard_NC6s_v2\"\ + \ \"maxDataDiskCount\": 64\r\n },\r\n {\r\n \"name\": \"Standard_NV6s_v2\"\ ,\r\n \"numberOfCores\": 6,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ \ \"resourceDiskSizeInMB\": 344064,\r\n \"memoryInMB\": 114688,\r\ \n \"maxDataDiskCount\": 12\r\n },\r\n {\r\n \"name\": \"\ - Standard_NC12s_v2\",\r\n \"numberOfCores\": 12,\r\n \"osDiskSizeInMB\"\ + Standard_NV12s_v2\",\r\n \"numberOfCores\": 12,\r\n \"osDiskSizeInMB\"\ : 1047552,\r\n \"resourceDiskSizeInMB\": 688128,\r\n \"memoryInMB\"\ : 229376,\r\n \"maxDataDiskCount\": 24\r\n },\r\n {\r\n \"\ - name\": \"Standard_NC24rs_v2\",\r\n \"numberOfCores\": 24,\r\n \"\ + name\": \"Standard_NV24s_v2\",\r\n \"numberOfCores\": 24,\r\n \"\ osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\": 1376256,\r\n\ \ \"memoryInMB\": 458752,\r\n \"maxDataDiskCount\": 32\r\n },\r\ - \n {\r\n \"name\": \"Standard_NC24s_v2\",\r\n \"numberOfCores\"\ + \n {\r\n \"name\": \"Standard_NV12s_v3\",\r\n \"numberOfCores\"\ + : 12,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 344064,\r\n \"memoryInMB\": 114688,\r\n \"maxDataDiskCount\":\ + \ 12\r\n },\r\n {\r\n \"name\": \"Standard_NV24s_v3\",\r\n \ + \ \"numberOfCores\": 24,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"\ + resourceDiskSizeInMB\": 688128,\r\n \"memoryInMB\": 229376,\r\n \ + \ \"maxDataDiskCount\": 24\r\n },\r\n {\r\n \"name\": \"Standard_NV48s_v3\"\ + ,\r\n \"numberOfCores\": 48,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 1376256,\r\n \"memoryInMB\": 458752,\r\ + \n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"\ + Standard_HB120rs_v2\",\r\n \"numberOfCores\": 120,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 960000,\r\n \"memoryInMB\"\ + : 480000,\r\n \"maxDataDiskCount\": 8\r\n },\r\n {\r\n \"\ + name\": \"Standard_D1\",\r\n \"numberOfCores\": 1,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 51200,\r\n \"memoryInMB\"\ + : 3584,\r\n \"maxDataDiskCount\": 4\r\n },\r\n {\r\n \"name\"\ + : \"Standard_D2\",\r\n \"numberOfCores\": 2,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 102400,\r\n \"memoryInMB\"\ + : 7168,\r\n \"maxDataDiskCount\": 8\r\n },\r\n {\r\n \"name\"\ + : \"Standard_D3\",\r\n \"numberOfCores\": 4,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 204800,\r\n \"memoryInMB\"\ + : 14336,\r\n \"maxDataDiskCount\": 16\r\n },\r\n {\r\n \"\ + name\": \"Standard_D4\",\r\n \"numberOfCores\": 8,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 409600,\r\n \"memoryInMB\"\ + : 28672,\r\n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"\ + name\": \"Standard_D11\",\r\n \"numberOfCores\": 2,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 102400,\r\n \"memoryInMB\"\ + : 14336,\r\n \"maxDataDiskCount\": 8\r\n },\r\n {\r\n \"name\"\ + : \"Standard_D12\",\r\n \"numberOfCores\": 4,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 204800,\r\n \"memoryInMB\"\ + : 28672,\r\n \"maxDataDiskCount\": 16\r\n },\r\n {\r\n \"\ + name\": \"Standard_D13\",\r\n \"numberOfCores\": 8,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 409600,\r\n \"memoryInMB\"\ + : 57344,\r\n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"\ + name\": \"Standard_D14\",\r\n \"numberOfCores\": 16,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 819200,\r\n \"memoryInMB\"\ + : 114688,\r\n \"maxDataDiskCount\": 64\r\n },\r\n {\r\n \"\ + name\": \"Standard_NC6s_v2\",\r\n \"numberOfCores\": 6,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 344064,\r\n \"memoryInMB\"\ + : 114688,\r\n \"maxDataDiskCount\": 12\r\n },\r\n {\r\n \"\ + name\": \"Standard_NC12s_v2\",\r\n \"numberOfCores\": 12,\r\n \"\ + osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\": 688128,\r\n\ + \ \"memoryInMB\": 229376,\r\n \"maxDataDiskCount\": 24\r\n },\r\ + \n {\r\n \"name\": \"Standard_NC24rs_v2\",\r\n \"numberOfCores\"\ : 24,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ : 1376256,\r\n \"memoryInMB\": 458752,\r\n \"maxDataDiskCount\"\ - : 32\r\n },\r\n {\r\n \"name\": \"Standard_F2s_v2\",\r\n \"\ - numberOfCores\": 2,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ - : 16384,\r\n \"memoryInMB\": 4096,\r\n \"maxDataDiskCount\": 4\r\ - \n },\r\n {\r\n \"name\": \"Standard_F4s_v2\",\r\n \"numberOfCores\"\ - : 4,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ - : 32768,\r\n \"memoryInMB\": 8192,\r\n \"maxDataDiskCount\": 8\r\ - \n },\r\n {\r\n \"name\": \"Standard_F8s_v2\",\r\n \"numberOfCores\"\ - : 8,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ - : 65536,\r\n \"memoryInMB\": 16384,\r\n \"maxDataDiskCount\": 16\r\ - \n },\r\n {\r\n \"name\": \"Standard_F16s_v2\",\r\n \"numberOfCores\"\ - : 16,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ - : 131072,\r\n \"memoryInMB\": 32768,\r\n \"maxDataDiskCount\": 32\r\ - \n },\r\n {\r\n \"name\": \"Standard_F32s_v2\",\r\n \"numberOfCores\"\ - : 32,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ - : 262144,\r\n \"memoryInMB\": 65536,\r\n \"maxDataDiskCount\": 32\r\ - \n },\r\n {\r\n \"name\": \"Standard_F48s_v2\",\r\n \"numberOfCores\"\ - : 48,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ - : 393216,\r\n \"memoryInMB\": 98304,\r\n \"maxDataDiskCount\": 32\r\ - \n },\r\n {\r\n \"name\": \"Standard_F64s_v2\",\r\n \"numberOfCores\"\ + : 32\r\n },\r\n {\r\n \"name\": \"Standard_NC24s_v2\",\r\n \ + \ \"numberOfCores\": 24,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"\ + resourceDiskSizeInMB\": 1376256,\r\n \"memoryInMB\": 458752,\r\n \ + \ \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"Standard_F2s_v2\"\ + ,\r\n \"numberOfCores\": 2,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 16384,\r\n \"memoryInMB\": 4096,\r\n\ + \ \"maxDataDiskCount\": 4\r\n },\r\n {\r\n \"name\": \"Standard_F4s_v2\"\ + ,\r\n \"numberOfCores\": 4,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 32768,\r\n \"memoryInMB\": 8192,\r\n\ + \ \"maxDataDiskCount\": 8\r\n },\r\n {\r\n \"name\": \"Standard_F8s_v2\"\ + ,\r\n \"numberOfCores\": 8,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 65536,\r\n \"memoryInMB\": 16384,\r\n\ + \ \"maxDataDiskCount\": 16\r\n },\r\n {\r\n \"name\": \"Standard_F16s_v2\"\ + ,\r\n \"numberOfCores\": 16,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 131072,\r\n \"memoryInMB\": 32768,\r\ + \n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"\ + Standard_F32s_v2\",\r\n \"numberOfCores\": 32,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 262144,\r\n \"memoryInMB\"\ + : 65536,\r\n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"\ + name\": \"Standard_F48s_v2\",\r\n \"numberOfCores\": 48,\r\n \"\ + osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\": 393216,\r\n\ + \ \"memoryInMB\": 98304,\r\n \"maxDataDiskCount\": 32\r\n },\r\ + \n {\r\n \"name\": \"Standard_F64s_v2\",\r\n \"numberOfCores\"\ : 64,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ : 524288,\r\n \"memoryInMB\": 131072,\r\n \"maxDataDiskCount\":\ \ 32\r\n },\r\n {\r\n \"name\": \"Standard_F72s_v2\",\r\n \ @@ -2139,25 +2257,36 @@ interactions: Standard_L80s_v2\",\r\n \"numberOfCores\": 80,\r\n \"osDiskSizeInMB\"\ : 1047552,\r\n \"resourceDiskSizeInMB\": 18309120,\r\n \"memoryInMB\"\ : 655360,\r\n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"\ - name\": \"Standard_NV6s_v2\",\r\n \"numberOfCores\": 6,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 344064,\r\n \"memoryInMB\"\ - : 114688,\r\n \"maxDataDiskCount\": 12\r\n },\r\n {\r\n \"\ - name\": \"Standard_NV12s_v2\",\r\n \"numberOfCores\": 12,\r\n \"\ - osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\": 688128,\r\n\ - \ \"memoryInMB\": 229376,\r\n \"maxDataDiskCount\": 24\r\n },\r\ - \n {\r\n \"name\": \"Standard_NV24s_v2\",\r\n \"numberOfCores\"\ - : 24,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ - : 1376256,\r\n \"memoryInMB\": 458752,\r\n \"maxDataDiskCount\"\ - : 32\r\n },\r\n {\r\n \"name\": \"Standard_NV12s_v3\",\r\n \ - \ \"numberOfCores\": 12,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"\ - resourceDiskSizeInMB\": 344064,\r\n \"memoryInMB\": 114688,\r\n \ - \ \"maxDataDiskCount\": 12\r\n },\r\n {\r\n \"name\": \"Standard_NV24s_v3\"\ - ,\r\n \"numberOfCores\": 24,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ - \ \"resourceDiskSizeInMB\": 688128,\r\n \"memoryInMB\": 229376,\r\ - \n \"maxDataDiskCount\": 24\r\n },\r\n {\r\n \"name\": \"\ - Standard_NV48s_v3\",\r\n \"numberOfCores\": 48,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 1376256,\r\n \"memoryInMB\"\ - : 458752,\r\n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"\ + name\": \"Standard_DC8_v2\",\r\n \"numberOfCores\": 8,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 409600,\r\n \"memoryInMB\"\ + : 32768,\r\n \"maxDataDiskCount\": 8\r\n },\r\n {\r\n \"name\"\ + : \"Standard_DC1s_v2\",\r\n \"numberOfCores\": 1,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 51200,\r\n \"memoryInMB\"\ + : 4096,\r\n \"maxDataDiskCount\": 1\r\n },\r\n {\r\n \"name\"\ + : \"Standard_DC2s_v2\",\r\n \"numberOfCores\": 2,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 102400,\r\n \"memoryInMB\"\ + : 8192,\r\n \"maxDataDiskCount\": 2\r\n },\r\n {\r\n \"name\"\ + : \"Standard_DC4s_v2\",\r\n \"numberOfCores\": 4,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 204800,\r\n \"memoryInMB\"\ + : 16384,\r\n \"maxDataDiskCount\": 4\r\n },\r\n {\r\n \"name\"\ + : \"Standard_E2_v4\",\r\n \"numberOfCores\": 2,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 0,\r\n \"memoryInMB\":\ + \ 16384,\r\n \"maxDataDiskCount\": 4\r\n },\r\n {\r\n \"name\"\ + : \"Standard_E4_v4\",\r\n \"numberOfCores\": 4,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 0,\r\n \"memoryInMB\":\ + \ 32768,\r\n \"maxDataDiskCount\": 8\r\n },\r\n {\r\n \"name\"\ + : \"Standard_E8_v4\",\r\n \"numberOfCores\": 8,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 0,\r\n \"memoryInMB\":\ + \ 65536,\r\n \"maxDataDiskCount\": 16\r\n },\r\n {\r\n \"\ + name\": \"Standard_E16_v4\",\r\n \"numberOfCores\": 16,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 0,\r\n \"memoryInMB\":\ + \ 131072,\r\n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"\ + name\": \"Standard_E20_v4\",\r\n \"numberOfCores\": 20,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 0,\r\n \"memoryInMB\":\ + \ 163840,\r\n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"\ + name\": \"Standard_E32_v4\",\r\n \"numberOfCores\": 32,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 0,\r\n \"memoryInMB\":\ + \ 262144,\r\n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"\ name\": \"Standard_E2d_v4\",\r\n \"numberOfCores\": 2,\r\n \"osDiskSizeInMB\"\ : 1047552,\r\n \"resourceDiskSizeInMB\": 76800,\r\n \"memoryInMB\"\ : 16384,\r\n \"maxDataDiskCount\": 4\r\n },\r\n {\r\n \"name\"\ @@ -2176,7 +2305,46 @@ interactions: \ 32\r\n },\r\n {\r\n \"name\": \"Standard_E32d_v4\",\r\n \ \ \"numberOfCores\": 32,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"\ resourceDiskSizeInMB\": 1228800,\r\n \"memoryInMB\": 262144,\r\n \ - \ \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"Standard_E2ds_v4\"\ + \ \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"Standard_E2s_v4\"\ + ,\r\n \"numberOfCores\": 2,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 0,\r\n \"memoryInMB\": 16384,\r\n \ + \ \"maxDataDiskCount\": 4\r\n },\r\n {\r\n \"name\": \"Standard_E4-2s_v4\"\ + ,\r\n \"numberOfCores\": 4,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 0,\r\n \"memoryInMB\": 32768,\r\n \ + \ \"maxDataDiskCount\": 8\r\n },\r\n {\r\n \"name\": \"Standard_E4s_v4\"\ + ,\r\n \"numberOfCores\": 4,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 0,\r\n \"memoryInMB\": 32768,\r\n \ + \ \"maxDataDiskCount\": 8\r\n },\r\n {\r\n \"name\": \"Standard_E8-2s_v4\"\ + ,\r\n \"numberOfCores\": 8,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 0,\r\n \"memoryInMB\": 65536,\r\n \ + \ \"maxDataDiskCount\": 16\r\n },\r\n {\r\n \"name\": \"Standard_E8-4s_v4\"\ + ,\r\n \"numberOfCores\": 8,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 0,\r\n \"memoryInMB\": 65536,\r\n \ + \ \"maxDataDiskCount\": 16\r\n },\r\n {\r\n \"name\": \"Standard_E8s_v4\"\ + ,\r\n \"numberOfCores\": 8,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 0,\r\n \"memoryInMB\": 65536,\r\n \ + \ \"maxDataDiskCount\": 16\r\n },\r\n {\r\n \"name\": \"Standard_E16-4s_v4\"\ + ,\r\n \"numberOfCores\": 16,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 0,\r\n \"memoryInMB\": 131072,\r\n \ + \ \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"Standard_E16-8s_v4\"\ + ,\r\n \"numberOfCores\": 16,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 0,\r\n \"memoryInMB\": 131072,\r\n \ + \ \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"Standard_E16s_v4\"\ + ,\r\n \"numberOfCores\": 16,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 0,\r\n \"memoryInMB\": 131072,\r\n \ + \ \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"Standard_E20s_v4\"\ + ,\r\n \"numberOfCores\": 20,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 0,\r\n \"memoryInMB\": 163840,\r\n \ + \ \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"Standard_E32-8s_v4\"\ + ,\r\n \"numberOfCores\": 32,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 0,\r\n \"memoryInMB\": 262144,\r\n \ + \ \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"Standard_E32-16s_v4\"\ + ,\r\n \"numberOfCores\": 32,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 0,\r\n \"memoryInMB\": 262144,\r\n \ + \ \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"Standard_E32s_v4\"\ + ,\r\n \"numberOfCores\": 32,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 0,\r\n \"memoryInMB\": 262144,\r\n \ + \ \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"Standard_E2ds_v4\"\ ,\r\n \"numberOfCores\": 2,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ \ \"resourceDiskSizeInMB\": 76800,\r\n \"memoryInMB\": 16384,\r\n\ \ \"maxDataDiskCount\": 4\r\n },\r\n {\r\n \"name\": \"Standard_E4-2ds_v4\"\ @@ -2239,7 +2407,28 @@ interactions: ,\r\n \"numberOfCores\": 64,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ \ \"resourceDiskSizeInMB\": 2457600,\r\n \"memoryInMB\": 262144,\r\ \n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"\ - Standard_D2ds_v4\",\r\n \"numberOfCores\": 2,\r\n \"osDiskSizeInMB\"\ + Standard_D2_v4\",\r\n \"numberOfCores\": 2,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 0,\r\n \"memoryInMB\":\ + \ 8192,\r\n \"maxDataDiskCount\": 4\r\n },\r\n {\r\n \"name\"\ + : \"Standard_D4_v4\",\r\n \"numberOfCores\": 4,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 0,\r\n \"memoryInMB\":\ + \ 16384,\r\n \"maxDataDiskCount\": 8\r\n },\r\n {\r\n \"name\"\ + : \"Standard_D8_v4\",\r\n \"numberOfCores\": 8,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 0,\r\n \"memoryInMB\":\ + \ 32768,\r\n \"maxDataDiskCount\": 16\r\n },\r\n {\r\n \"\ + name\": \"Standard_D16_v4\",\r\n \"numberOfCores\": 16,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 0,\r\n \"memoryInMB\":\ + \ 65536,\r\n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"\ + name\": \"Standard_D32_v4\",\r\n \"numberOfCores\": 32,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 0,\r\n \"memoryInMB\":\ + \ 131072,\r\n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"\ + name\": \"Standard_D48_v4\",\r\n \"numberOfCores\": 48,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 0,\r\n \"memoryInMB\":\ + \ 196608,\r\n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"\ + name\": \"Standard_D64_v4\",\r\n \"numberOfCores\": 64,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 0,\r\n \"memoryInMB\":\ + \ 262144,\r\n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"\ + name\": \"Standard_D2ds_v4\",\r\n \"numberOfCores\": 2,\r\n \"osDiskSizeInMB\"\ : 1047552,\r\n \"resourceDiskSizeInMB\": 76800,\r\n \"memoryInMB\"\ : 8192,\r\n \"maxDataDiskCount\": 4\r\n },\r\n {\r\n \"name\"\ : \"Standard_D4ds_v4\",\r\n \"numberOfCores\": 4,\r\n \"osDiskSizeInMB\"\ @@ -2261,67 +2450,73 @@ interactions: ,\r\n \"numberOfCores\": 64,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ \ \"resourceDiskSizeInMB\": 2457600,\r\n \"memoryInMB\": 262144,\r\ \n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"\ - Standard_DC8_v2\",\r\n \"numberOfCores\": 8,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 409600,\r\n \"memoryInMB\"\ - : 32768,\r\n \"maxDataDiskCount\": 8\r\n },\r\n {\r\n \"name\"\ - : \"Standard_DC1s_v2\",\r\n \"numberOfCores\": 1,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 51200,\r\n \"memoryInMB\"\ - : 4096,\r\n \"maxDataDiskCount\": 1\r\n },\r\n {\r\n \"name\"\ - : \"Standard_DC2s_v2\",\r\n \"numberOfCores\": 2,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 102400,\r\n \"memoryInMB\"\ - : 8192,\r\n \"maxDataDiskCount\": 2\r\n },\r\n {\r\n \"name\"\ - : \"Standard_DC4s_v2\",\r\n \"numberOfCores\": 4,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 204800,\r\n \"memoryInMB\"\ - : 16384,\r\n \"maxDataDiskCount\": 4\r\n },\r\n {\r\n \"name\"\ - : \"Standard_NP10s\",\r\n \"numberOfCores\": 10,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 753664,\r\n \"memoryInMB\"\ - : 172032,\r\n \"maxDataDiskCount\": 8\r\n },\r\n {\r\n \"\ - name\": \"Standard_NP20s\",\r\n \"numberOfCores\": 20,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 1509376,\r\n \"memoryInMB\"\ - : 344064,\r\n \"maxDataDiskCount\": 16\r\n },\r\n {\r\n \"\ - name\": \"Standard_NP40s\",\r\n \"numberOfCores\": 40,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 3018752,\r\n \"memoryInMB\"\ - : 688128,\r\n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"\ - name\": \"Standard_DS1\",\r\n \"numberOfCores\": 1,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 7168,\r\n \"memoryInMB\"\ - : 3584,\r\n \"maxDataDiskCount\": 4\r\n },\r\n {\r\n \"name\"\ - : \"Standard_DS2\",\r\n \"numberOfCores\": 2,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 14336,\r\n \"memoryInMB\"\ - : 7168,\r\n \"maxDataDiskCount\": 8\r\n },\r\n {\r\n \"name\"\ - : \"Standard_DS3\",\r\n \"numberOfCores\": 4,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 28672,\r\n \"memoryInMB\"\ - : 14336,\r\n \"maxDataDiskCount\": 16\r\n },\r\n {\r\n \"\ - name\": \"Standard_DS4\",\r\n \"numberOfCores\": 8,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 57344,\r\n \"memoryInMB\"\ - : 28672,\r\n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"\ - name\": \"Standard_DS11\",\r\n \"numberOfCores\": 2,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 28672,\r\n \"memoryInMB\"\ - : 14336,\r\n \"maxDataDiskCount\": 8\r\n },\r\n {\r\n \"name\"\ - : \"Standard_DS12\",\r\n \"numberOfCores\": 4,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 57344,\r\n \"memoryInMB\"\ - : 28672,\r\n \"maxDataDiskCount\": 16\r\n },\r\n {\r\n \"\ - name\": \"Standard_DS13\",\r\n \"numberOfCores\": 8,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 114688,\r\n \"memoryInMB\"\ - : 57344,\r\n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"\ - name\": \"Standard_DS14\",\r\n \"numberOfCores\": 16,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 229376,\r\n \"memoryInMB\"\ - : 114688,\r\n \"maxDataDiskCount\": 64\r\n },\r\n {\r\n \"\ - name\": \"Standard_HC44rs\",\r\n \"numberOfCores\": 44,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 716800,\r\n \"memoryInMB\"\ - : 335693,\r\n \"maxDataDiskCount\": 4\r\n },\r\n {\r\n \"\ - name\": \"Standard_D2a_v4\",\r\n \"numberOfCores\": 2,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 51200,\r\n \"memoryInMB\"\ - : 8192,\r\n \"maxDataDiskCount\": 4\r\n },\r\n {\r\n \"name\"\ - : \"Standard_D4a_v4\",\r\n \"numberOfCores\": 4,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 102400,\r\n \"memoryInMB\"\ - : 16384,\r\n \"maxDataDiskCount\": 8\r\n },\r\n {\r\n \"name\"\ - : \"Standard_D8a_v4\",\r\n \"numberOfCores\": 8,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 204800,\r\n \"memoryInMB\"\ - : 32768,\r\n \"maxDataDiskCount\": 16\r\n },\r\n {\r\n \"\ - name\": \"Standard_D16a_v4\",\r\n \"numberOfCores\": 16,\r\n \"\ - osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\": 409600,\r\n\ - \ \"memoryInMB\": 65536,\r\n \"maxDataDiskCount\": 32\r\n },\r\ - \n {\r\n \"name\": \"Standard_D32a_v4\",\r\n \"numberOfCores\"\ + Standard_D2s_v4\",\r\n \"numberOfCores\": 2,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 0,\r\n \"memoryInMB\":\ + \ 8192,\r\n \"maxDataDiskCount\": 4\r\n },\r\n {\r\n \"name\"\ + : \"Standard_D4s_v4\",\r\n \"numberOfCores\": 4,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 0,\r\n \"memoryInMB\":\ + \ 16384,\r\n \"maxDataDiskCount\": 8\r\n },\r\n {\r\n \"name\"\ + : \"Standard_D8s_v4\",\r\n \"numberOfCores\": 8,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 0,\r\n \"memoryInMB\":\ + \ 32768,\r\n \"maxDataDiskCount\": 16\r\n },\r\n {\r\n \"\ + name\": \"Standard_D16s_v4\",\r\n \"numberOfCores\": 16,\r\n \"\ + osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\": 0,\r\n \ + \ \"memoryInMB\": 65536,\r\n \"maxDataDiskCount\": 32\r\n },\r\n \ + \ {\r\n \"name\": \"Standard_D32s_v4\",\r\n \"numberOfCores\"\ + : 32,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 0,\r\n \"memoryInMB\": 131072,\r\n \"maxDataDiskCount\": 32\r\n\ + \ },\r\n {\r\n \"name\": \"Standard_D48s_v4\",\r\n \"numberOfCores\"\ + : 48,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 0,\r\n \"memoryInMB\": 196608,\r\n \"maxDataDiskCount\": 32\r\n\ + \ },\r\n {\r\n \"name\": \"Standard_D64s_v4\",\r\n \"numberOfCores\"\ + : 64,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 0,\r\n \"memoryInMB\": 262144,\r\n \"maxDataDiskCount\": 32\r\n\ + \ },\r\n {\r\n \"name\": \"Standard_NP10s\",\r\n \"numberOfCores\"\ + : 10,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 753664,\r\n \"memoryInMB\": 172032,\r\n \"maxDataDiskCount\":\ + \ 8\r\n },\r\n {\r\n \"name\": \"Standard_NP20s\",\r\n \"\ + numberOfCores\": 20,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 1509376,\r\n \"memoryInMB\": 344064,\r\n \"maxDataDiskCount\"\ + : 16\r\n },\r\n {\r\n \"name\": \"Standard_NP40s\",\r\n \"\ + numberOfCores\": 40,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 3018752,\r\n \"memoryInMB\": 688128,\r\n \"maxDataDiskCount\"\ + : 32\r\n },\r\n {\r\n \"name\": \"Standard_DS1\",\r\n \"numberOfCores\"\ + : 1,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 7168,\r\n \"memoryInMB\": 3584,\r\n \"maxDataDiskCount\": 4\r\n\ + \ },\r\n {\r\n \"name\": \"Standard_DS2\",\r\n \"numberOfCores\"\ + : 2,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 14336,\r\n \"memoryInMB\": 7168,\r\n \"maxDataDiskCount\": 8\r\ + \n },\r\n {\r\n \"name\": \"Standard_DS3\",\r\n \"numberOfCores\"\ + : 4,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 28672,\r\n \"memoryInMB\": 14336,\r\n \"maxDataDiskCount\": 16\r\ + \n },\r\n {\r\n \"name\": \"Standard_DS4\",\r\n \"numberOfCores\"\ + : 8,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 57344,\r\n \"memoryInMB\": 28672,\r\n \"maxDataDiskCount\": 32\r\ + \n },\r\n {\r\n \"name\": \"Standard_DS11\",\r\n \"numberOfCores\"\ + : 2,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 28672,\r\n \"memoryInMB\": 14336,\r\n \"maxDataDiskCount\": 8\r\ + \n },\r\n {\r\n \"name\": \"Standard_DS12\",\r\n \"numberOfCores\"\ + : 4,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 57344,\r\n \"memoryInMB\": 28672,\r\n \"maxDataDiskCount\": 16\r\ + \n },\r\n {\r\n \"name\": \"Standard_DS13\",\r\n \"numberOfCores\"\ + : 8,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 114688,\r\n \"memoryInMB\": 57344,\r\n \"maxDataDiskCount\": 32\r\ + \n },\r\n {\r\n \"name\": \"Standard_DS14\",\r\n \"numberOfCores\"\ + : 16,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 229376,\r\n \"memoryInMB\": 114688,\r\n \"maxDataDiskCount\":\ + \ 64\r\n },\r\n {\r\n \"name\": \"Standard_D2a_v4\",\r\n \"\ + numberOfCores\": 2,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 51200,\r\n \"memoryInMB\": 8192,\r\n \"maxDataDiskCount\": 4\r\ + \n },\r\n {\r\n \"name\": \"Standard_D4a_v4\",\r\n \"numberOfCores\"\ + : 4,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 102400,\r\n \"memoryInMB\": 16384,\r\n \"maxDataDiskCount\": 8\r\ + \n },\r\n {\r\n \"name\": \"Standard_D8a_v4\",\r\n \"numberOfCores\"\ + : 8,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 204800,\r\n \"memoryInMB\": 32768,\r\n \"maxDataDiskCount\": 16\r\ + \n },\r\n {\r\n \"name\": \"Standard_D16a_v4\",\r\n \"numberOfCores\"\ + : 16,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 409600,\r\n \"memoryInMB\": 65536,\r\n \"maxDataDiskCount\": 32\r\ + \n },\r\n {\r\n \"name\": \"Standard_D32a_v4\",\r\n \"numberOfCores\"\ : 32,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ : 819200,\r\n \"memoryInMB\": 131072,\r\n \"maxDataDiskCount\":\ \ 32\r\n },\r\n {\r\n \"name\": \"Standard_D48a_v4\",\r\n \ @@ -2415,8 +2610,11 @@ interactions: \n {\r\n \"name\": \"Standard_E96as_v4\",\r\n \"numberOfCores\"\ : 96,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ : 1376256,\r\n \"memoryInMB\": 688128,\r\n \"maxDataDiskCount\"\ - : 32\r\n },\r\n {\r\n \"name\": \"Standard_ND6s\",\r\n \"\ - numberOfCores\": 6,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 32\r\n },\r\n {\r\n \"name\": \"Standard_HC44rs\",\r\n \"\ + numberOfCores\": 44,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 716800,\r\n \"memoryInMB\": 335693,\r\n \"maxDataDiskCount\":\ + \ 4\r\n },\r\n {\r\n \"name\": \"Standard_ND6s\",\r\n \"numberOfCores\"\ + : 6,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ : 344064,\r\n \"memoryInMB\": 114688,\r\n \"maxDataDiskCount\":\ \ 12\r\n },\r\n {\r\n \"name\": \"Standard_ND12s\",\r\n \"\ numberOfCores\": 12,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ @@ -2427,78 +2625,28 @@ interactions: : 32\r\n },\r\n {\r\n \"name\": \"Standard_ND24s\",\r\n \"\ numberOfCores\": 24,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ : 1376256,\r\n \"memoryInMB\": 458752,\r\n \"maxDataDiskCount\"\ - : 32\r\n },\r\n {\r\n \"name\": \"Standard_DC2s\",\r\n \"\ - numberOfCores\": 2,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ - : 102400,\r\n \"memoryInMB\": 8192,\r\n \"maxDataDiskCount\": 2\r\ - \n },\r\n {\r\n \"name\": \"Standard_DC4s\",\r\n \"numberOfCores\"\ - : 4,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ - : 204800,\r\n \"memoryInMB\": 16384,\r\n \"maxDataDiskCount\": 4\r\ - \n },\r\n {\r\n \"name\": \"Standard_M208ms_v2\",\r\n \"numberOfCores\"\ - : 208,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ - : 4194304,\r\n \"memoryInMB\": 5836800,\r\n \"maxDataDiskCount\"\ - : 64\r\n },\r\n {\r\n \"name\": \"Standard_M208s_v2\",\r\n \ - \ \"numberOfCores\": 208,\r\n \"osDiskSizeInMB\": 1047552,\r\n \ - \ \"resourceDiskSizeInMB\": 4194304,\r\n \"memoryInMB\": 2918400,\r\n\ - \ \"maxDataDiskCount\": 64\r\n },\r\n {\r\n \"name\": \"Standard_M416-208s_v2\"\ - ,\r\n \"numberOfCores\": 416,\r\n \"osDiskSizeInMB\": 1047552,\r\ - \n \"resourceDiskSizeInMB\": 8388608,\r\n \"memoryInMB\": 5836800,\r\ - \n \"maxDataDiskCount\": 64\r\n },\r\n {\r\n \"name\": \"\ - Standard_M416s_v2\",\r\n \"numberOfCores\": 416,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 8388608,\r\n \"memoryInMB\"\ - : 5836800,\r\n \"maxDataDiskCount\": 64\r\n },\r\n {\r\n \"\ - name\": \"Standard_M416-208ms_v2\",\r\n \"numberOfCores\": 416,\r\n \ - \ \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\": 8388608,\r\ - \n \"memoryInMB\": 11673600,\r\n \"maxDataDiskCount\": 64\r\n \ - \ },\r\n {\r\n \"name\": \"Standard_M416ms_v2\",\r\n \"numberOfCores\"\ - : 416,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ - : 8388608,\r\n \"memoryInMB\": 11673600,\r\n \"maxDataDiskCount\"\ - : 64\r\n },\r\n {\r\n \"name\": \"Standard_NC6s_v3\",\r\n \ - \ \"numberOfCores\": 6,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"\ - resourceDiskSizeInMB\": 344064,\r\n \"memoryInMB\": 114688,\r\n \ - \ \"maxDataDiskCount\": 12\r\n },\r\n {\r\n \"name\": \"Standard_NC12s_v3\"\ - ,\r\n \"numberOfCores\": 12,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ - \ \"resourceDiskSizeInMB\": 688128,\r\n \"memoryInMB\": 229376,\r\ - \n \"maxDataDiskCount\": 24\r\n },\r\n {\r\n \"name\": \"\ - Standard_NC24rs_v3\",\r\n \"numberOfCores\": 24,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 1376256,\r\n \"memoryInMB\"\ - : 458752,\r\n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"\ - name\": \"Standard_NC24s_v3\",\r\n \"numberOfCores\": 24,\r\n \"\ - osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\": 1376256,\r\n\ - \ \"memoryInMB\": 458752,\r\n \"maxDataDiskCount\": 32\r\n },\r\ - \n {\r\n \"name\": \"Standard_PB6s\",\r\n \"numberOfCores\":\ - \ 6,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ - : 344064,\r\n \"memoryInMB\": 114688,\r\n \"maxDataDiskCount\":\ - \ 12\r\n },\r\n {\r\n \"name\": \"Standard_HB60rs\",\r\n \"\ - numberOfCores\": 60,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ - : 716800,\r\n \"memoryInMB\": 228881,\r\n \"maxDataDiskCount\":\ - \ 4\r\n },\r\n {\r\n \"name\": \"Standard_ND40s_v3\",\r\n \ - \ \"numberOfCores\": 40,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"\ - resourceDiskSizeInMB\": 39630000,\r\n \"memoryInMB\": 688128,\r\n \ - \ \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"Standard_D1\"\ - ,\r\n \"numberOfCores\": 1,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ - \ \"resourceDiskSizeInMB\": 51200,\r\n \"memoryInMB\": 3584,\r\n\ - \ \"maxDataDiskCount\": 4\r\n },\r\n {\r\n \"name\": \"Standard_D2\"\ + : 32\r\n },\r\n {\r\n \"name\": \"Standard_ND40rs_v2\",\r\n \ + \ \"numberOfCores\": 40,\r\n \"osDiskSizeInMB\": 1047552,\r\n \ + \ \"resourceDiskSizeInMB\": 2969600,\r\n \"memoryInMB\": 688128,\r\n\ + \ \"maxDataDiskCount\": 8\r\n },\r\n {\r\n \"name\": \"Standard_DC2s\"\ ,\r\n \"numberOfCores\": 2,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ - \ \"resourceDiskSizeInMB\": 102400,\r\n \"memoryInMB\": 7168,\r\n\ - \ \"maxDataDiskCount\": 8\r\n },\r\n {\r\n \"name\": \"Standard_D3\"\ + \ \"resourceDiskSizeInMB\": 102400,\r\n \"memoryInMB\": 8192,\r\n\ + \ \"maxDataDiskCount\": 2\r\n },\r\n {\r\n \"name\": \"Standard_DC4s\"\ ,\r\n \"numberOfCores\": 4,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ - \ \"resourceDiskSizeInMB\": 204800,\r\n \"memoryInMB\": 14336,\r\ - \n \"maxDataDiskCount\": 16\r\n },\r\n {\r\n \"name\": \"\ - Standard_D4\",\r\n \"numberOfCores\": 8,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 409600,\r\n \"memoryInMB\"\ - : 28672,\r\n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"\ - name\": \"Standard_D11\",\r\n \"numberOfCores\": 2,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 102400,\r\n \"memoryInMB\"\ - : 14336,\r\n \"maxDataDiskCount\": 8\r\n },\r\n {\r\n \"name\"\ - : \"Standard_D12\",\r\n \"numberOfCores\": 4,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 204800,\r\n \"memoryInMB\"\ - : 28672,\r\n \"maxDataDiskCount\": 16\r\n },\r\n {\r\n \"\ - name\": \"Standard_D13\",\r\n \"numberOfCores\": 8,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 409600,\r\n \"memoryInMB\"\ - : 57344,\r\n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"\ - name\": \"Standard_D14\",\r\n \"numberOfCores\": 16,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 819200,\r\n \"memoryInMB\"\ - : 114688,\r\n \"maxDataDiskCount\": 64\r\n },\r\n {\r\n \"\ + \ \"resourceDiskSizeInMB\": 204800,\r\n \"memoryInMB\": 16384,\r\ + \n \"maxDataDiskCount\": 4\r\n },\r\n {\r\n \"name\": \"Standard_M64\"\ + ,\r\n \"numberOfCores\": 64,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 8192000,\r\n \"memoryInMB\": 1024000,\r\ + \n \"maxDataDiskCount\": 64\r\n },\r\n {\r\n \"name\": \"\ + Standard_M64m\",\r\n \"numberOfCores\": 64,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 8192000,\r\n \"memoryInMB\"\ + : 1792000,\r\n \"maxDataDiskCount\": 64\r\n },\r\n {\r\n \"\ + name\": \"Standard_M128\",\r\n \"numberOfCores\": 128,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 16384000,\r\n \"memoryInMB\"\ + : 2048000,\r\n \"maxDataDiskCount\": 64\r\n },\r\n {\r\n \"\ + name\": \"Standard_M128m\",\r\n \"numberOfCores\": 128,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 16384000,\r\n \"memoryInMB\"\ + : 3891200,\r\n \"maxDataDiskCount\": 64\r\n },\r\n {\r\n \"\ name\": \"Standard_M8-2ms\",\r\n \"numberOfCores\": 8,\r\n \"osDiskSizeInMB\"\ : 1047552,\r\n \"resourceDiskSizeInMB\": 256000,\r\n \"memoryInMB\"\ : 224000,\r\n \"maxDataDiskCount\": 8\r\n },\r\n {\r\n \"\ @@ -2561,67 +2709,96 @@ interactions: name\": \"Standard_M128s\",\r\n \"numberOfCores\": 128,\r\n \"osDiskSizeInMB\"\ : 1047552,\r\n \"resourceDiskSizeInMB\": 4096000,\r\n \"memoryInMB\"\ : 2048000,\r\n \"maxDataDiskCount\": 64\r\n },\r\n {\r\n \"\ - name\": \"Standard_M64\",\r\n \"numberOfCores\": 64,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 8192000,\r\n \"memoryInMB\"\ - : 1024000,\r\n \"maxDataDiskCount\": 64\r\n },\r\n {\r\n \"\ - name\": \"Standard_M64m\",\r\n \"numberOfCores\": 64,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 8192000,\r\n \"memoryInMB\"\ - : 1792000,\r\n \"maxDataDiskCount\": 64\r\n },\r\n {\r\n \"\ - name\": \"Standard_M128\",\r\n \"numberOfCores\": 128,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 16384000,\r\n \"memoryInMB\"\ - : 2048000,\r\n \"maxDataDiskCount\": 64\r\n },\r\n {\r\n \"\ - name\": \"Standard_M128m\",\r\n \"numberOfCores\": 128,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 16384000,\r\n \"memoryInMB\"\ - : 3891200,\r\n \"maxDataDiskCount\": 64\r\n },\r\n {\r\n \"\ - name\": \"Standard_A8\",\r\n \"numberOfCores\": 8,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 391168,\r\n \"memoryInMB\"\ - : 57344,\r\n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"\ - name\": \"Standard_A9\",\r\n \"numberOfCores\": 16,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 391168,\r\n \"memoryInMB\"\ - : 114688,\r\n \"maxDataDiskCount\": 64\r\n },\r\n {\r\n \"\ - name\": \"Standard_A10\",\r\n \"numberOfCores\": 8,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 391168,\r\n \"memoryInMB\"\ - : 57344,\r\n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"\ - name\": \"Standard_A11\",\r\n \"numberOfCores\": 16,\r\n \"osDiskSizeInMB\"\ - : 1047552,\r\n \"resourceDiskSizeInMB\": 391168,\r\n \"memoryInMB\"\ - : 114688,\r\n \"maxDataDiskCount\": 64\r\n },\r\n {\r\n \"\ - name\": \"Standard_E48d_v4\",\r\n \"numberOfCores\": 48,\r\n \"\ - osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\": 1843200,\r\n\ - \ \"memoryInMB\": 393216,\r\n \"maxDataDiskCount\": 32\r\n },\r\ - \n {\r\n \"name\": \"Standard_E64d_v4\",\r\n \"numberOfCores\"\ + name\": \"Standard_NC6s_v3\",\r\n \"numberOfCores\": 6,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 344064,\r\n \"memoryInMB\"\ + : 114688,\r\n \"maxDataDiskCount\": 12\r\n },\r\n {\r\n \"\ + name\": \"Standard_NC12s_v3\",\r\n \"numberOfCores\": 12,\r\n \"\ + osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\": 688128,\r\n\ + \ \"memoryInMB\": 229376,\r\n \"maxDataDiskCount\": 24\r\n },\r\ + \n {\r\n \"name\": \"Standard_NC24rs_v3\",\r\n \"numberOfCores\"\ + : 24,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 1376256,\r\n \"memoryInMB\": 458752,\r\n \"maxDataDiskCount\"\ + : 32\r\n },\r\n {\r\n \"name\": \"Standard_NC24s_v3\",\r\n \ + \ \"numberOfCores\": 24,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"\ + resourceDiskSizeInMB\": 1376256,\r\n \"memoryInMB\": 458752,\r\n \ + \ \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"Standard_PB6s\"\ + ,\r\n \"numberOfCores\": 6,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 344064,\r\n \"memoryInMB\": 114688,\r\ + \n \"maxDataDiskCount\": 12\r\n },\r\n {\r\n \"name\": \"\ + Standard_HB60rs\",\r\n \"numberOfCores\": 60,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 716800,\r\n \"memoryInMB\"\ + : 228881,\r\n \"maxDataDiskCount\": 4\r\n },\r\n {\r\n \"\ + name\": \"Standard_ND40s_v3\",\r\n \"numberOfCores\": 40,\r\n \"\ + osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\": 39630000,\r\n\ + \ \"memoryInMB\": 688128,\r\n \"maxDataDiskCount\": 32\r\n },\r\ + \n {\r\n \"name\": \"Standard_E48_v4\",\r\n \"numberOfCores\"\ + : 48,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 0,\r\n \"memoryInMB\": 393216,\r\n \"maxDataDiskCount\": 32\r\n\ + \ },\r\n {\r\n \"name\": \"Standard_E64_v4\",\r\n \"numberOfCores\"\ : 64,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ - : 2457600,\r\n \"memoryInMB\": 516096,\r\n \"maxDataDiskCount\"\ - : 32\r\n },\r\n {\r\n \"name\": \"Standard_E48ds_v4\",\r\n \ - \ \"numberOfCores\": 48,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"\ - resourceDiskSizeInMB\": 1843200,\r\n \"memoryInMB\": 393216,\r\n \ - \ \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"Standard_E64-16ds_v4\"\ + : 0,\r\n \"memoryInMB\": 516096,\r\n \"maxDataDiskCount\": 32\r\n\ + \ },\r\n {\r\n \"name\": \"Standard_E48d_v4\",\r\n \"numberOfCores\"\ + : 48,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 1843200,\r\n \"memoryInMB\": 393216,\r\n \"maxDataDiskCount\"\ + : 32\r\n },\r\n {\r\n \"name\": \"Standard_E64d_v4\",\r\n \ + \ \"numberOfCores\": 64,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"\ + resourceDiskSizeInMB\": 2457600,\r\n \"memoryInMB\": 516096,\r\n \ + \ \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"Standard_E48s_v4\"\ + ,\r\n \"numberOfCores\": 48,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 0,\r\n \"memoryInMB\": 393216,\r\n \ + \ \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"Standard_E64-16s_v4\"\ + ,\r\n \"numberOfCores\": 64,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 0,\r\n \"memoryInMB\": 516096,\r\n \ + \ \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"Standard_E64-32s_v4\"\ ,\r\n \"numberOfCores\": 64,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ - \ \"resourceDiskSizeInMB\": 2457600,\r\n \"memoryInMB\": 516096,\r\ + \ \"resourceDiskSizeInMB\": 0,\r\n \"memoryInMB\": 516096,\r\n \ + \ \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"Standard_E64s_v4\"\ + ,\r\n \"numberOfCores\": 64,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 0,\r\n \"memoryInMB\": 516096,\r\n \ + \ \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"Standard_E48ds_v4\"\ + ,\r\n \"numberOfCores\": 48,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 1843200,\r\n \"memoryInMB\": 393216,\r\ \n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"name\": \"\ - Standard_E64ds_v4\",\r\n \"numberOfCores\": 64,\r\n \"osDiskSizeInMB\"\ + Standard_E64-16ds_v4\",\r\n \"numberOfCores\": 64,\r\n \"osDiskSizeInMB\"\ : 1047552,\r\n \"resourceDiskSizeInMB\": 2457600,\r\n \"memoryInMB\"\ : 516096,\r\n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"\ - name\": \"Standard_ND40rs_v2\",\r\n \"numberOfCores\": 40,\r\n \"\ - osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\": 2969600,\r\n\ - \ \"memoryInMB\": 688128,\r\n \"maxDataDiskCount\": 8\r\n },\r\ - \n {\r\n \"name\": \"Standard_NV4as_v4\",\r\n \"numberOfCores\"\ - : 4,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ - : 90112,\r\n \"memoryInMB\": 14336,\r\n \"maxDataDiskCount\": 8\r\ - \n },\r\n {\r\n \"name\": \"Standard_NV8as_v4\",\r\n \"numberOfCores\"\ + name\": \"Standard_E64-32ds_v4\",\r\n \"numberOfCores\": 64,\r\n \ + \ \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\": 2457600,\r\ + \n \"memoryInMB\": 516096,\r\n \"maxDataDiskCount\": 32\r\n },\r\ + \n {\r\n \"name\": \"Standard_E64ds_v4\",\r\n \"numberOfCores\"\ + : 64,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 2457600,\r\n \"memoryInMB\": 516096,\r\n \"maxDataDiskCount\"\ + : 32\r\n },\r\n {\r\n \"name\": \"Standard_A8\",\r\n \"numberOfCores\"\ : 8,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ - : 180224,\r\n \"memoryInMB\": 28672,\r\n \"maxDataDiskCount\": 16\r\ - \n },\r\n {\r\n \"name\": \"Standard_NV16as_v4\",\r\n \"numberOfCores\"\ + : 391168,\r\n \"memoryInMB\": 57344,\r\n \"maxDataDiskCount\": 32\r\ + \n },\r\n {\r\n \"name\": \"Standard_A9\",\r\n \"numberOfCores\"\ : 16,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ - : 360448,\r\n \"memoryInMB\": 57344,\r\n \"maxDataDiskCount\": 32\r\ - \n },\r\n {\r\n \"name\": \"Standard_NV32as_v4\",\r\n \"numberOfCores\"\ - : 32,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ - : 720896,\r\n \"memoryInMB\": 114688,\r\n \"maxDataDiskCount\":\ - \ 32\r\n }\r\n ]\r\n}" + : 391168,\r\n \"memoryInMB\": 114688,\r\n \"maxDataDiskCount\":\ + \ 64\r\n },\r\n {\r\n \"name\": \"Standard_A10\",\r\n \"numberOfCores\"\ + : 8,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 391168,\r\n \"memoryInMB\": 57344,\r\n \"maxDataDiskCount\": 32\r\ + \n },\r\n {\r\n \"name\": \"Standard_A11\",\r\n \"numberOfCores\"\ + : 16,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\"\ + : 391168,\r\n \"memoryInMB\": 114688,\r\n \"maxDataDiskCount\":\ + \ 64\r\n },\r\n {\r\n \"name\": \"Standard_NV4as_v4\",\r\n \ + \ \"numberOfCores\": 4,\r\n \"osDiskSizeInMB\": 1047552,\r\n \"\ + resourceDiskSizeInMB\": 90112,\r\n \"memoryInMB\": 14336,\r\n \"\ + maxDataDiskCount\": 8\r\n },\r\n {\r\n \"name\": \"Standard_NV8as_v4\"\ + ,\r\n \"numberOfCores\": 8,\r\n \"osDiskSizeInMB\": 1047552,\r\n\ + \ \"resourceDiskSizeInMB\": 180224,\r\n \"memoryInMB\": 28672,\r\ + \n \"maxDataDiskCount\": 16\r\n },\r\n {\r\n \"name\": \"\ + Standard_NV16as_v4\",\r\n \"numberOfCores\": 16,\r\n \"osDiskSizeInMB\"\ + : 1047552,\r\n \"resourceDiskSizeInMB\": 360448,\r\n \"memoryInMB\"\ + : 57344,\r\n \"maxDataDiskCount\": 32\r\n },\r\n {\r\n \"\ + name\": \"Standard_NV32as_v4\",\r\n \"numberOfCores\": 32,\r\n \"\ + osDiskSizeInMB\": 1047552,\r\n \"resourceDiskSizeInMB\": 720896,\r\n\ + \ \"memoryInMB\": 114688,\r\n \"maxDataDiskCount\": 32\r\n }\r\ + \n ]\r\n}" headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:48:00 GMT + date: Wed, 16 Sep 2020 05:41:19 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -2633,16 +2810,16 @@ interactions: status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/vmSizes?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/vmSizes?api-version=2020-06-01 - request: body: null headers: Accept: - - application/json + - application/json, text/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/runCommands?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/runCommands?api-version=2020-06-01 response: body: string: "{\r\n \"value\": [\r\n {\r\n \"$schema\": \"http://schema.management.azure.com/schemas/2016-11-17/runcommands.json\"\ @@ -2727,7 +2904,7 @@ interactions: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:48:01 GMT + date: Wed, 16 Sep 2020 05:41:19 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -2739,95 +2916,96 @@ interactions: status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/runCommands?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/runCommands?api-version=2020-06-01 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234?$expand=instanceView&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234?$expand=instanceView&api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"virtualmachinexxx9a731234\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234\"\ ,\r\n \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\"\ - : \"eastus\",\r\n \"properties\": {\r\n \"vmId\": \"883a4b52-0091-48f3-a443-4ca2c729b516\"\ + : \"eastus\",\r\n \"properties\": {\r\n \"vmId\": \"38722ed0-8c2a-41c8-b86a-911c7b41900b\"\ ,\r\n \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_D2_v2\"\r\n\ \ },\r\n \"storageProfile\": {\r\n \"imageReference\": {\r\n \ \ \"publisher\": \"MicrosoftWindowsServer\",\r\n \"offer\": \"\ WindowsServer\",\r\n \"sku\": \"2016-Datacenter\",\r\n \"version\"\ - : \"latest\",\r\n \"exactVersion\": \"14393.3686.2005061700\"\r\n \ + : \"latest\",\r\n \"exactVersion\": \"14393.3930.2009041537\"\r\n \ \ },\r\n \"osDisk\": {\r\n \"osType\": \"Windows\",\r\n \ \ \"name\": \"myVMosdisk\",\r\n \"createOption\": \"FromImage\"\ ,\r\n \"caching\": \"ReadWrite\",\r\n \"managedDisk\": {\r\n\ \ \"storageAccountType\": \"Standard_LRS\",\r\n \"id\":\ - \ \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/myVMosdisk\"\ + \ \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/7PTFB2IKPAE54UU36J6DSPCSGPSHFKDJVCURHJJLQHIPQTMXI4Y3ZOQ46GYPODIS2E42PUF3SUQ/providers/Microsoft.Compute/disks/myVMosdisk\"\ \r\n },\r\n \"diskSizeGB\": 127\r\n },\r\n \"dataDisks\"\ - : [\r\n {\r\n \"lun\": 0,\r\n \"name\": \"virtualmachinexxx9a731234_disk2_85ee171b01894583b0bb14ce0bbbc0a3\"\ + : [\r\n {\r\n \"lun\": 0,\r\n \"name\": \"virtualmachinexxx9a731234_disk2_65a6f784860149d4bdad9d8b9e2a8aa5\"\ ,\r\n \"createOption\": \"Empty\",\r\n \"caching\": \"None\"\ ,\r\n \"managedDisk\": {\r\n \"storageAccountType\": \"\ - Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/virtualmachinexxx9a731234_disk2_85ee171b01894583b0bb14ce0bbbc0a3\"\ + Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/7PTFB2IKPAE54UU36J6DSPCSGPSHFKDJVCURHJJLQHIPQTMXI4Y3ZOQ46GYPODIS2E42PUF3SUQ/providers/Microsoft.Compute/disks/virtualmachinexxx9a731234_disk2_65a6f784860149d4bdad9d8b9e2a8aa5\"\ \r\n },\r\n \"diskSizeGB\": 1023,\r\n \"toBeDetached\"\ : false\r\n },\r\n {\r\n \"lun\": 1,\r\n \"\ - name\": \"virtualmachinexxx9a731234_disk3_9e84ad297eb046bb918518a475f01c5d\"\ + name\": \"virtualmachinexxx9a731234_disk3_3fcecb66e0b74060a3194c7f95df789f\"\ ,\r\n \"createOption\": \"Empty\",\r\n \"caching\": \"None\"\ ,\r\n \"managedDisk\": {\r\n \"storageAccountType\": \"\ - Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/virtualmachinexxx9a731234_disk3_9e84ad297eb046bb918518a475f01c5d\"\ + Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/7PTFB2IKPAE54UU36J6DSPCSGPSHFKDJVCURHJJLQHIPQTMXI4Y3ZOQ46GYPODIS2E42PUF3SUQ/providers/Microsoft.Compute/disks/virtualmachinexxx9a731234_disk3_3fcecb66e0b74060a3194c7f95df789f\"\ \r\n },\r\n \"diskSizeGB\": 1023,\r\n \"toBeDetached\"\ : false\r\n }\r\n ]\r\n },\r\n \"osProfile\": {\r\n \ \ \"computerName\": \"myVM\",\r\n \"adminUsername\": \"testuser\",\r\ \n \"windowsConfiguration\": {\r\n \"provisionVMAgent\": true,\r\ - \n \"enableAutomaticUpdates\": true\r\n },\r\n \"secrets\"\ - : [],\r\n \"allowExtensionOperations\": true,\r\n \"requireGuestProvisionSignal\"\ - : true\r\n },\r\n \"networkProfile\": {\"networkInterfaces\":[{\"id\"\ - :\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexxx9a731234\"\ + \n \"enableAutomaticUpdates\": true,\r\n \"patchSettings\":\ + \ {\r\n \"patchMode\": \"AutomaticByOS\"\r\n }\r\n },\r\ + \n \"secrets\": [],\r\n \"allowExtensionOperations\": true,\r\n\ + \ \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\"\ + : {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexxx9a731234\"\ ,\"properties\":{\"primary\":true}}]},\r\n \"provisioningState\": \"Succeeded\"\ ,\r\n \"instanceView\": {\r\n \"computerName\": \"myVM\",\r\n \ \ \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"osVersion\"\ : \"Microsoft Windows NT 10.0.14393.0\",\r\n \"vmAgent\": {\r\n \ - \ \"vmAgentVersion\": \"2.7.41491.971\",\r\n \"statuses\": [\r\n\ + \ \"vmAgentVersion\": \"2.7.41491.992\",\r\n \"statuses\": [\r\n\ \ {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n\ \ \"level\": \"Info\",\r\n \"displayStatus\": \"Ready\"\ ,\r\n \"message\": \"GuestAgent is running and processing the extensions.\"\ - ,\r\n \"time\": \"2020-06-02T02:47:59+00:00\"\r\n }\r\n\ + ,\r\n \"time\": \"2020-09-16T05:41:20+00:00\"\r\n }\r\n\ \ ],\r\n \"extensionHandlers\": [\r\n {\r\n \ \ \"type\": \"Microsoft.Azure.NetworkWatcher.NetworkWatcherAgentWindows\"\ - ,\r\n \"typeHandlerVersion\": \"1.4.1527.2\",\r\n \"\ + ,\r\n \"typeHandlerVersion\": \"1.4.1587.1\",\r\n \"\ status\": {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n\ \ \"level\": \"Info\",\r\n \"displayStatus\": \"\ Ready\",\r\n \"message\": \"Plugin enabled (handler name: Microsoft.Azure.NetworkWatcher.NetworkWatcherAgentWindows,\ - \ extension name: , version: 1.4.1527.2).\"\r\n }\r\n \ + \ extension name: , version: 1.4.1587.1).\"\r\n }\r\n \ \ }\r\n ]\r\n },\r\n \"disks\": [\r\n {\r\n \ \ \"name\": \"myVMosdisk\",\r\n \"statuses\": [\r\n \ \ {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n \ \ \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning\ - \ succeeded\",\r\n \"time\": \"2020-06-02T02:44:49.9447917+00:00\"\ + \ succeeded\",\r\n \"time\": \"2020-09-16T05:38:03.3026458+00:00\"\ \r\n }\r\n ]\r\n },\r\n {\r\n \"\ - name\": \"virtualmachinexxx9a731234_disk2_85ee171b01894583b0bb14ce0bbbc0a3\"\ + name\": \"virtualmachinexxx9a731234_disk2_65a6f784860149d4bdad9d8b9e2a8aa5\"\ ,\r\n \"statuses\": [\r\n {\r\n \"code\"\ : \"ProvisioningState/succeeded\",\r\n \"level\": \"Info\",\r\ \n \"displayStatus\": \"Provisioning succeeded\",\r\n \ - \ \"time\": \"2020-06-02T02:44:49.9447917+00:00\"\r\n }\r\ - \n ]\r\n },\r\n {\r\n \"name\": \"virtualmachinexxx9a731234_disk3_9e84ad297eb046bb918518a475f01c5d\"\ + \ \"time\": \"2020-09-16T05:38:03.3026458+00:00\"\r\n }\r\ + \n ]\r\n },\r\n {\r\n \"name\": \"virtualmachinexxx9a731234_disk3_3fcecb66e0b74060a3194c7f95df789f\"\ ,\r\n \"statuses\": [\r\n {\r\n \"code\"\ : \"ProvisioningState/succeeded\",\r\n \"level\": \"Info\",\r\ \n \"displayStatus\": \"Provisioning succeeded\",\r\n \ - \ \"time\": \"2020-06-02T02:44:49.9447917+00:00\"\r\n }\r\ + \ \"time\": \"2020-09-16T05:38:03.3026458+00:00\"\r\n }\r\ \n ]\r\n }\r\n ],\r\n \"extensions\": [\r\n \ \ {\r\n \"name\": \"virtualmachineextensionxxx9a731234\",\r\n\ \ \"type\": \"Microsoft.Azure.NetworkWatcher.NetworkWatcherAgentWindows\"\ - ,\r\n \"typeHandlerVersion\": \"1.4.1527.2\",\r\n \"statuses\"\ + ,\r\n \"typeHandlerVersion\": \"1.4.1587.1\",\r\n \"statuses\"\ : [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\"\ ,\r\n \"level\": \"Info\",\r\n \"displayStatus\"\ : \"Provisioning succeeded\",\r\n \"message\": \"Plugin enabled\ \ (handler name: Microsoft.Azure.NetworkWatcher.NetworkWatcherAgentWindows,\ - \ extension name: , version: 1.4.1527.2).\"\r\n }\r\n \ + \ extension name: , version: 1.4.1587.1).\"\r\n }\r\n \ \ ]\r\n }\r\n ],\r\n \"hyperVGeneration\": \"V1\",\r\n \ \ \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\"\ ,\r\n \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning\ - \ succeeded\",\r\n \"time\": \"2020-06-02T02:47:41.3511247+00:00\"\ + \ succeeded\",\r\n \"time\": \"2020-09-16T05:40:54.8194118+00:00\"\ \r\n },\r\n {\r\n \"code\": \"PowerState/running\"\ ,\r\n \"level\": \"Info\",\r\n \"displayStatus\": \"VM running\"\ \r\n }\r\n ]\r\n }\r\n },\r\n \"resources\": [\r\n {\r\ @@ -2843,7 +3021,7 @@ interactions: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:48:01 GMT + date: Wed, 16 Sep 2020 05:41:20 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -2851,56 +3029,58 @@ interactions: transfer-encoding: chunked vary: Accept-Encoding x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/LowCostGet3Min;3990,Microsoft.Compute/LowCostGet30Min;31990 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/LowCostGet3Min;3990,Microsoft.Compute/LowCostGet30Min;31987 status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234?$expand=instanceView&api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7ptfb2ikpae54uu36j6dspcsgpshfkdjvcurhjjlqhipqtmxi4y3zoq46gypodis2e42puf3suq/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234?$expand=instanceView&api-version=2020-06-01 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines?api-version=2020-06-01 response: body: string: "{\r\n \"value\": [\r\n {\r\n \"name\": \"virtualmachinexxx9a731234\"\ ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234\"\ ,\r\n \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\"\ - : \"eastus\",\r\n \"properties\": {\r\n \"vmId\": \"883a4b52-0091-48f3-a443-4ca2c729b516\"\ + : \"eastus\",\r\n \"properties\": {\r\n \"vmId\": \"38722ed0-8c2a-41c8-b86a-911c7b41900b\"\ ,\r\n \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_D2_v2\"\ \r\n },\r\n \"storageProfile\": {\r\n \"imageReference\"\ : {\r\n \"publisher\": \"MicrosoftWindowsServer\",\r\n \ \ \"offer\": \"WindowsServer\",\r\n \"sku\": \"2016-Datacenter\"\ ,\r\n \"version\": \"latest\",\r\n \"exactVersion\"\ - : \"14393.3686.2005061700\"\r\n },\r\n \"osDisk\": {\r\n\ + : \"14393.3930.2009041537\"\r\n },\r\n \"osDisk\": {\r\n\ \ \"osType\": \"Windows\",\r\n \"name\": \"myVMosdisk\"\ ,\r\n \"createOption\": \"FromImage\",\r\n \"caching\"\ : \"ReadWrite\",\r\n \"managedDisk\": {\r\n \"storageAccountType\"\ - : \"Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/myVMosdisk\"\ + : \"Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/7PTFB2IKPAE54UU36J6DSPCSGPSHFKDJVCURHJJLQHIPQTMXI4Y3ZOQ46GYPODIS2E42PUF3SUQ/providers/Microsoft.Compute/disks/myVMosdisk\"\ \r\n },\r\n \"diskSizeGB\": 127\r\n },\r\n\ \ \"dataDisks\": [\r\n {\r\n \"lun\": 0,\r\ - \n \"name\": \"virtualmachinexxx9a731234_disk2_85ee171b01894583b0bb14ce0bbbc0a3\"\ + \n \"name\": \"virtualmachinexxx9a731234_disk2_65a6f784860149d4bdad9d8b9e2a8aa5\"\ ,\r\n \"createOption\": \"Empty\",\r\n \"caching\"\ : \"None\",\r\n \"managedDisk\": {\r\n \"storageAccountType\"\ - : \"Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/virtualmachinexxx9a731234_disk2_85ee171b01894583b0bb14ce0bbbc0a3\"\ + : \"Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/7PTFB2IKPAE54UU36J6DSPCSGPSHFKDJVCURHJJLQHIPQTMXI4Y3ZOQ46GYPODIS2E42PUF3SUQ/providers/Microsoft.Compute/disks/virtualmachinexxx9a731234_disk2_65a6f784860149d4bdad9d8b9e2a8aa5\"\ \r\n },\r\n \"diskSizeGB\": 1023,\r\n \ \ \"toBeDetached\": false\r\n },\r\n {\r\n \ - \ \"lun\": 1,\r\n \"name\": \"virtualmachinexxx9a731234_disk3_9e84ad297eb046bb918518a475f01c5d\"\ + \ \"lun\": 1,\r\n \"name\": \"virtualmachinexxx9a731234_disk3_3fcecb66e0b74060a3194c7f95df789f\"\ ,\r\n \"createOption\": \"Empty\",\r\n \"caching\"\ : \"None\",\r\n \"managedDisk\": {\r\n \"storageAccountType\"\ - : \"Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/virtualmachinexxx9a731234_disk3_9e84ad297eb046bb918518a475f01c5d\"\ + : \"Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/7PTFB2IKPAE54UU36J6DSPCSGPSHFKDJVCURHJJLQHIPQTMXI4Y3ZOQ46GYPODIS2E42PUF3SUQ/providers/Microsoft.Compute/disks/virtualmachinexxx9a731234_disk3_3fcecb66e0b74060a3194c7f95df789f\"\ \r\n },\r\n \"diskSizeGB\": 1023,\r\n \ \ \"toBeDetached\": false\r\n }\r\n ]\r\n },\r\ \n \"osProfile\": {\r\n \"computerName\": \"myVM\",\r\n \ \ \"adminUsername\": \"testuser\",\r\n \"windowsConfiguration\"\ : {\r\n \"provisionVMAgent\": true,\r\n \"enableAutomaticUpdates\"\ - : true\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\"\ - : true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\ - \n \"networkProfile\": {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexxx9a731234\"\ + : true,\r\n \"patchSettings\": {\r\n \"patchMode\"\ + : \"AutomaticByOS\"\r\n }\r\n },\r\n \"secrets\"\ + : [],\r\n \"allowExtensionOperations\": true,\r\n \"requireGuestProvisionSignal\"\ + : true\r\n },\r\n \"networkProfile\": {\"networkInterfaces\"\ + :[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexxx9a731234\"\ ,\"properties\":{\"primary\":true}}]},\r\n \"provisioningState\": \"\ Succeeded\"\r\n },\r\n \"resources\": [\r\n {\r\n \ \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/extensions/virtualmachineextensionxxx9a731234\"\ @@ -2909,7 +3089,7 @@ interactions: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:48:01 GMT + date: Wed, 16 Sep 2020 05:41:20 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -2917,156 +3097,122 @@ interactions: transfer-encoding: chunked vary: Accept-Encoding x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/HighCostGet3Min;139,Microsoft.Compute/HighCostGet30Min;699 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/HighCostGet3Min;139,Microsoft.Compute/HighCostGet30Min;698 status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7ptfb2ikpae54uu36j6dspcsgpshfkdjvcurhjjlqhipqtmxi4y3zoq46gypodis2e42puf3suq/providers/Microsoft.Compute/virtualMachines?api-version=2020-06-01 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/virtualMachines?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/virtualMachines?api-version=2020-06-01 response: body: - string: '{"value":[{"name":"pyvmirvm507d1052","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TEST-CHANGLONG/providers/Microsoft.Compute/virtualMachines/pyvmirvm507d1052","type":"Microsoft.Compute/virtualMachines","location":"eastus","identity":{"type":"SystemAssigned","principalId":"b13295c3-db33-4a18-af8b-69a113d180fa","tenantId":"00000000-0000-0000-0000-000000000000"},"properties":{"vmId":"d1afda73-64fc-4a74-8d4b-ae67558b78a6","hardwareProfile":{"vmSize":"Standard_A0"},"storageProfile":{"imageReference":{"publisher":"Canonical","offer":"UbuntuServer","sku":"16.04.0-LTS","version":"latest","exactVersion":"16.04.202004290"},"osDisk":{"osType":"Linux","name":"pyvmirvm507d1052_OsDisk_1_793c84bb182d4249a638b2827b4631e8","createOption":"FromImage","caching":"ReadWrite","managedDisk":{"storageAccountType":"Standard_LRS","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TEST-CHANGLONG/providers/Microsoft.Compute/disks/pyvmirvm507d1052_OsDisk_1_793c84bb182d4249a638b2827b4631e8"},"diskSizeGB":30},"dataDisks":[]},"osProfile":{"computerName":"test","adminUsername":"Foo12","linuxConfiguration":{"disablePasswordAuthentication":false,"provisionVMAgent":true},"secrets":[],"allowExtensionOperations":true,"requireGuestProvisionSignal":true},"networkProfile":{"networkInterfaces":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-changlong/providers/Microsoft.Network/networkInterfaces/pyvmirnic507d1052"}]},"provisioningState":"Succeeded"}},{"name":"testvm","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TESTVMMULTIAPI/providers/Microsoft.Compute/virtualMachines/testvm","type":"Microsoft.Compute/virtualMachines","location":"eastus","properties":{"vmId":"7d191832-5270-4c7e-8a32-f36c35b5d968","hardwareProfile":{"vmSize":"Standard_D2_v2"},"storageProfile":{"imageReference":{"publisher":"MicrosoftWindowsServer","offer":"WindowsServer","sku":"2016-Datacenter","version":"latest","exactVersion":"14393.3686.2005061700"},"osDisk":{"osType":"Windows","name":"myVMosdisk","createOption":"FromImage","caching":"ReadWrite","managedDisk":{"storageAccountType":"Standard_LRS","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TESTVMMULTIAPI/providers/Microsoft.Compute/disks/myVMosdisk"},"diskSizeGB":127},"dataDisks":[{"lun":0,"name":"testvm_disk2_81ac60155f5d4be0a0941f6a1e07809a","createOption":"Empty","caching":"None","managedDisk":{"storageAccountType":"Standard_LRS","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TESTVMMULTIAPI/providers/Microsoft.Compute/disks/testvm_disk2_81ac60155f5d4be0a0941f6a1e07809a"},"diskSizeGB":1023,"toBeDetached":false},{"lun":1,"name":"testvm_disk3_39fd44e369a94dea9fb929b8fac5efee","createOption":"Empty","caching":"None","managedDisk":{"storageAccountType":"Standard_LRS","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TESTVMMULTIAPI/providers/Microsoft.Compute/disks/testvm_disk3_39fd44e369a94dea9fb929b8fac5efee"},"diskSizeGB":1023,"toBeDetached":false}]},"osProfile":{"computerName":"myVM","adminUsername":"testuser","windowsConfiguration":{"provisionVMAgent":true,"enableAutomaticUpdates":true},"secrets":[],"allowExtensionOperations":true,"requireGuestProvisionSignal":true},"networkProfile":{"networkInterfaces":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testvmmultiapi/providers/Microsoft.Network/networkInterfaces/testinterface","properties":{"primary":true}}]},"provisioningState":"Succeeded"},"resources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TESTVMMULTIAPI/providers/Microsoft.Compute/virtualMachines/testvm/extensions/Microsoft.Azure.Geneva.GenevaMonitoring"}]},{"name":"virtualmachinexxx9a731234","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234","type":"Microsoft.Compute/virtualMachines","location":"eastus","properties":{"vmId":"883a4b52-0091-48f3-a443-4ca2c729b516","hardwareProfile":{"vmSize":"Standard_D2_v2"},"storageProfile":{"imageReference":{"publisher":"MicrosoftWindowsServer","offer":"WindowsServer","sku":"2016-Datacenter","version":"latest","exactVersion":"14393.3686.2005061700"},"osDisk":{"osType":"Windows","name":"myVMosdisk","createOption":"FromImage","caching":"ReadWrite","managedDisk":{"storageAccountType":"Standard_LRS","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/myVMosdisk"},"diskSizeGB":127},"dataDisks":[{"lun":0,"name":"virtualmachinexxx9a731234_disk2_85ee171b01894583b0bb14ce0bbbc0a3","createOption":"Empty","caching":"None","managedDisk":{"storageAccountType":"Standard_LRS","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/virtualmachinexxx9a731234_disk2_85ee171b01894583b0bb14ce0bbbc0a3"},"diskSizeGB":1023,"toBeDetached":false},{"lun":1,"name":"virtualmachinexxx9a731234_disk3_9e84ad297eb046bb918518a475f01c5d","createOption":"Empty","caching":"None","managedDisk":{"storageAccountType":"Standard_LRS","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/virtualmachinexxx9a731234_disk3_9e84ad297eb046bb918518a475f01c5d"},"diskSizeGB":1023,"toBeDetached":false}]},"osProfile":{"computerName":"myVM","adminUsername":"testuser","windowsConfiguration":{"provisionVMAgent":true,"enableAutomaticUpdates":true},"secrets":[],"allowExtensionOperations":true,"requireGuestProvisionSignal":true},"networkProfile":{"networkInterfaces":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexxx9a731234","properties":{"primary":true}}]},"provisioningState":"Succeeded"},"resources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/extensions/virtualmachineextensionxxx9a731234"}]},{"name":"dev-box","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DEV-BOX/providers/Microsoft.Compute/virtualMachines/dev-box","type":"Microsoft.Compute/virtualMachines","location":"westus","properties":{"vmId":"7ef2a73a-fe58-49fd-988a-053b093087a2","hardwareProfile":{"vmSize":"Standard_DS5_v2"},"storageProfile":{"imageReference":{"publisher":"MicrosoftWindowsDesktop","offer":"Windows-10","sku":"rs4-pro","version":"latest","exactVersion":"17134.167.46"},"osDisk":{"osType":"Windows","name":"dev-box_OsDisk_1_8ba56531ddec4304b95f695aafae0df3","createOption":"FromImage","caching":"ReadWrite","managedDisk":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DEV-BOX/providers/Microsoft.Compute/disks/dev-box_OsDisk_1_8ba56531ddec4304b95f695aafae0df3"}},"dataDisks":[]},"osProfile":{"computerName":"dev-box","adminUsername":"billytrend","windowsConfiguration":{"provisionVMAgent":true,"enableAutomaticUpdates":true},"secrets":[]},"networkProfile":{"networkInterfaces":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dev-box/providers/Microsoft.Network/networkInterfaces/dev-box323"}]},"diagnosticsProfile":{"bootDiagnostics":{"enabled":true,"storageUri":"https://devboxdiag862.blob.core.windows.net/"}},"licenseType":"Windows_Client","provisioningState":"Succeeded"},"resources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DEV-BOX/providers/Microsoft.Compute/virtualMachines/dev-box/extensions/enablevmaccess"}]},{"name":"pythonVM","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ARM-PYTHON-RG/providers/Microsoft.Compute/virtualMachines/pythonVM","type":"Microsoft.Compute/virtualMachines","location":"westeurope","properties":{"vmId":"bdd7a492-3764-49b8-bd2c-1f4270423692","hardwareProfile":{"vmSize":"Standard_D4s_v3"},"storageProfile":{"imageReference":{"publisher":"Canonical","offer":"UbuntuServer","sku":"18.04-LTS","version":"latest","exactVersion":"18.04.202004290"},"osDisk":{"osType":"Linux","name":"pythonVM_OsDisk_1_df5c7bb605c041a88fadb7b909d100c4","createOption":"FromImage","caching":"ReadWrite","managedDisk":{"storageAccountType":"Premium_LRS","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ARM-PYTHON-RG/providers/Microsoft.Compute/disks/pythonVM_OsDisk_1_df5c7bb605c041a88fadb7b909d100c4"},"diskSizeGB":30},"dataDisks":[{"lun":0,"name":"pythonVM_DataDisk_0","createOption":"Attach","caching":"None","writeAcceleratorEnabled":false,"managedDisk":{"storageAccountType":"Premium_LRS","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/arm-python-RG/providers/Microsoft.Compute/disks/pythonVM_DataDisk_0"},"diskSizeGB":1024,"toBeDetached":false}]},"osProfile":{"computerName":"pythonVM","adminUsername":"AzurePython","linuxConfiguration":{"disablePasswordAuthentication":false,"provisionVMAgent":true},"secrets":[],"allowExtensionOperations":true,"requireGuestProvisionSignal":true},"networkProfile":{"networkInterfaces":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/arm-python-RG/providers/Microsoft.Network/networkInterfaces/pythonvm887"}]},"diagnosticsProfile":{"bootDiagnostics":{"enabled":true,"storageUri":"https://armpythonrgdiag.blob.core.windows.net/"}},"provisioningState":"Succeeded"}},{"name":"vpn-lon","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/VPN-LON/providers/Microsoft.Compute/virtualMachines/vpn-lon","type":"Microsoft.Compute/virtualMachines","location":"ukwest","tags":{},"properties":{"vmId":"9785a7cc-b6ec-4bfb-b02d-cd61880333b8","hardwareProfile":{"vmSize":"Standard_D2s_v3"},"storageProfile":{"imageReference":{"publisher":"Canonical","offer":"UbuntuServer","sku":"18.04-LTS","version":"latest","exactVersion":"18.04.201810030"},"osDisk":{"osType":"Linux","name":"vpn-lon_OsDisk_1_72c0563cdc194870aa69ffbae71161b8","createOption":"FromImage","caching":"ReadWrite","managedDisk":{"storageAccountType":"Premium_LRS","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/VPN-LON/providers/Microsoft.Compute/disks/vpn-lon_OsDisk_1_72c0563cdc194870aa69ffbae71161b8"},"diskSizeGB":30},"dataDisks":[]},"osProfile":{"computerName":"vpn-lon","adminUsername":"bt","linuxConfiguration":{"disablePasswordAuthentication":true,"ssh":{"publicKeys":[{"path":"/home/bt/.ssh/authorized_keys","keyData":"ssh-rsa - AAAAB3NzaC1yc2EAAAADAQABAAABAQDABvnbH7C1XfWjAvowYViqnjhwOQhdQ+8NleFKx9+oV32AdaQz0iJRKvKlF6M+6vpIsPvo/JxywAP1eHEF39MEYMTaumw2LqTDhXZYIKmyRHQidS3cJazhO2kCQ99noXFP6vrX1vhDPzyd81OWz11svMIdciZykyf9WzCQoEytw1IHlOda/7o3/JVm24sJDyrKZ+vD4mqUK1ZFfP9JjNh6+kKX6BEHjdDe6G7Z2nicGcA5FzD2M/BkBBNMrEbnWSOySJgOdESycaRsyC1LKWODOwzMELpfAkiulsgZcDXBENEtIvUNIz/HVAGEGoWaFFJJ0uHtgc/Jkz8grDf6AR/3"}]}},"secrets":[]},"networkProfile":{"networkInterfaces":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vpn-lon/providers/Microsoft.Network/networkInterfaces/vpn-lon393"}]},"diagnosticsProfile":{"bootDiagnostics":{"enabled":true,"storageUri":"https://vpnlondiag.blob.core.windows.net/"}},"provisioningState":"Succeeded"}}]}' + string: '{"value":[{"name":"virtualmachinexxx9a731234","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/7PTFB2IKPAE54UU36J6DSPCSGPSHFKDJVCURHJJLQHIPQTMXI4Y3ZOQ46GYPODIS2E42PUF3SUQ/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234","type":"Microsoft.Compute/virtualMachines","location":"eastus","properties":{"vmId":"38722ed0-8c2a-41c8-b86a-911c7b41900b","hardwareProfile":{"vmSize":"Standard_D2_v2"},"storageProfile":{"imageReference":{"publisher":"MicrosoftWindowsServer","offer":"WindowsServer","sku":"2016-Datacenter","version":"latest","exactVersion":"14393.3930.2009041537"},"osDisk":{"osType":"Windows","name":"myVMosdisk","createOption":"FromImage","caching":"ReadWrite","managedDisk":{"storageAccountType":"Standard_LRS","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/7PTFB2IKPAE54UU36J6DSPCSGPSHFKDJVCURHJJLQHIPQTMXI4Y3ZOQ46GYPODIS2E42PUF3SUQ/providers/Microsoft.Compute/disks/myVMosdisk"},"diskSizeGB":127},"dataDisks":[{"lun":0,"name":"virtualmachinexxx9a731234_disk2_65a6f784860149d4bdad9d8b9e2a8aa5","createOption":"Empty","caching":"None","managedDisk":{"storageAccountType":"Standard_LRS","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/7PTFB2IKPAE54UU36J6DSPCSGPSHFKDJVCURHJJLQHIPQTMXI4Y3ZOQ46GYPODIS2E42PUF3SUQ/providers/Microsoft.Compute/disks/virtualmachinexxx9a731234_disk2_65a6f784860149d4bdad9d8b9e2a8aa5"},"diskSizeGB":1023,"toBeDetached":false},{"lun":1,"name":"virtualmachinexxx9a731234_disk3_3fcecb66e0b74060a3194c7f95df789f","createOption":"Empty","caching":"None","managedDisk":{"storageAccountType":"Standard_LRS","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/7PTFB2IKPAE54UU36J6DSPCSGPSHFKDJVCURHJJLQHIPQTMXI4Y3ZOQ46GYPODIS2E42PUF3SUQ/providers/Microsoft.Compute/disks/virtualmachinexxx9a731234_disk3_3fcecb66e0b74060a3194c7f95df789f"},"diskSizeGB":1023,"toBeDetached":false}]},"osProfile":{"computerName":"myVM","adminUsername":"testuser","windowsConfiguration":{"provisionVMAgent":true,"enableAutomaticUpdates":true,"patchSettings":{"patchMode":"AutomaticByOS"}},"secrets":[],"allowExtensionOperations":true,"requireGuestProvisionSignal":true},"networkProfile":{"networkInterfaces":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexxx9a731234","properties":{"primary":true}}]},"provisioningState":"Succeeded"},"resources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/7PTFB2IKPAE54UU36J6DSPCSGPSHFKDJVCURHJJLQHIPQTMXI4Y3ZOQ46GYPODIS2E42PUF3SUQ/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/extensions/virtualmachineextensionxxx9a731234"}]},{"name":"test","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/AZURE-SDK-TEST/providers/Microsoft.Compute/virtualMachines/test","type":"Microsoft.Compute/virtualMachines","location":"eastus","properties":{"vmId":"f497cb21-adf5-4caf-83e7-5041df1af906","hardwareProfile":{"vmSize":"Standard_D2s_v3"},"storageProfile":{"imageReference":{"publisher":"Canonical","offer":"UbuntuServer","sku":"18.04-LTS","version":"latest","exactVersion":"18.04.202009080"},"osDisk":{"osType":"Linux","name":"test_OsDisk_1_ccbcc532cb2443f0bd947ace2245cb43","createOption":"FromImage","caching":"ReadWrite","managedDisk":{"storageAccountType":"Premium_LRS","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/AZURE-SDK-TEST/providers/Microsoft.Compute/disks/test_OsDisk_1_ccbcc532cb2443f0bd947ace2245cb43"},"diskSizeGB":30},"dataDisks":[]},"osProfile":{"computerName":"test","adminUsername":"us","linuxConfiguration":{"disablePasswordAuthentication":false,"provisionVMAgent":true,"patchSettings":{"patchMode":"ImageDefault"}},"secrets":[],"allowExtensionOperations":true,"requireGuestProvisionSignal":true},"networkProfile":{"networkInterfaces":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sdk-test/providers/Microsoft.Network/networkInterfaces/test933"}]},"diagnosticsProfile":{"bootDiagnostics":{"enabled":true,"storageUri":"https://azuresdktestdiag.blob.core.windows.net/"}},"provisioningState":"Succeeded"}},{"name":"dev-box","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DEV-BOX/providers/Microsoft.Compute/virtualMachines/dev-box","type":"Microsoft.Compute/virtualMachines","location":"westus","properties":{"vmId":"7ef2a73a-fe58-49fd-988a-053b093087a2","hardwareProfile":{"vmSize":"Standard_DS5_v2"},"storageProfile":{"imageReference":{"publisher":"MicrosoftWindowsDesktop","offer":"Windows-10","sku":"rs4-pro","version":"latest","exactVersion":"17134.167.46"},"osDisk":{"osType":"Windows","name":"dev-box_OsDisk_1_8ba56531ddec4304b95f695aafae0df3","createOption":"FromImage","caching":"ReadWrite","managedDisk":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DEV-BOX/providers/Microsoft.Compute/disks/dev-box_OsDisk_1_8ba56531ddec4304b95f695aafae0df3"}},"dataDisks":[]},"osProfile":{"computerName":"dev-box","adminUsername":"billytrend","windowsConfiguration":{"provisionVMAgent":true,"enableAutomaticUpdates":true,"patchSettings":{"patchMode":"AutomaticByOS"}},"secrets":[]},"networkProfile":{"networkInterfaces":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dev-box/providers/Microsoft.Network/networkInterfaces/dev-box323"}]},"diagnosticsProfile":{"bootDiagnostics":{"enabled":true,"storageUri":"https://devboxdiag862.blob.core.windows.net/"}},"licenseType":"Windows_Client","provisioningState":"Succeeded"},"resources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DEV-BOX/providers/Microsoft.Compute/virtualMachines/dev-box/extensions/enablevmaccess"}]},{"name":"pythonVM","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ARM-PYTHON-RG/providers/Microsoft.Compute/virtualMachines/pythonVM","type":"Microsoft.Compute/virtualMachines","location":"westeurope","properties":{"vmId":"bdd7a492-3764-49b8-bd2c-1f4270423692","hardwareProfile":{"vmSize":"Standard_D4s_v3"},"storageProfile":{"imageReference":{"publisher":"Canonical","offer":"UbuntuServer","sku":"18.04-LTS","version":"latest","exactVersion":"18.04.202004290"},"osDisk":{"osType":"Linux","name":"pythonVM_OsDisk_1_df5c7bb605c041a88fadb7b909d100c4","createOption":"FromImage","caching":"ReadWrite","managedDisk":{"storageAccountType":"Premium_LRS","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ARM-PYTHON-RG/providers/Microsoft.Compute/disks/pythonVM_OsDisk_1_df5c7bb605c041a88fadb7b909d100c4"},"diskSizeGB":30},"dataDisks":[{"lun":0,"name":"pythonVM_DataDisk_0","createOption":"Attach","caching":"None","writeAcceleratorEnabled":false,"managedDisk":{"storageAccountType":"Premium_LRS","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/arm-python-RG/providers/Microsoft.Compute/disks/pythonVM_DataDisk_0"},"diskSizeGB":1024,"toBeDetached":false}]},"osProfile":{"computerName":"pythonVM","adminUsername":"AzurePython","linuxConfiguration":{"disablePasswordAuthentication":false,"provisionVMAgent":true,"patchSettings":{"patchMode":"ImageDefault"}},"secrets":[],"allowExtensionOperations":true,"requireGuestProvisionSignal":true},"networkProfile":{"networkInterfaces":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/arm-python-RG/providers/Microsoft.Network/networkInterfaces/pythonvm887"}]},"diagnosticsProfile":{"bootDiagnostics":{"enabled":true,"storageUri":"https://armpythonrgdiag.blob.core.windows.net/"}},"provisioningState":"Succeeded"}},{"name":"vpn-lon","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/VPN-LON/providers/Microsoft.Compute/virtualMachines/vpn-lon","type":"Microsoft.Compute/virtualMachines","location":"ukwest","tags":{},"properties":{"vmId":"9785a7cc-b6ec-4bfb-b02d-cd61880333b8","hardwareProfile":{"vmSize":"Standard_D2s_v3"},"storageProfile":{"imageReference":{"publisher":"Canonical","offer":"UbuntuServer","sku":"18.04-LTS","version":"latest","exactVersion":"18.04.201810030"},"osDisk":{"osType":"Linux","name":"vpn-lon_OsDisk_1_72c0563cdc194870aa69ffbae71161b8","createOption":"FromImage","caching":"ReadWrite","managedDisk":{"storageAccountType":"Premium_LRS","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/VPN-LON/providers/Microsoft.Compute/disks/vpn-lon_OsDisk_1_72c0563cdc194870aa69ffbae71161b8"},"diskSizeGB":30},"dataDisks":[]},"osProfile":{"computerName":"vpn-lon","adminUsername":"bt","linuxConfiguration":{"disablePasswordAuthentication":true,"ssh":{"publicKeys":[{"path":"/home/bt/.ssh/authorized_keys","keyData":"ssh-rsa + AAAAB3NzaC1yc2EAAAADAQABAAABAQDABvnbH7C1XfWjAvowYViqnjhwOQhdQ+8NleFKx9+oV32AdaQz0iJRKvKlF6M+6vpIsPvo/JxywAP1eHEF39MEYMTaumw2LqTDhXZYIKmyRHQidS3cJazhO2kCQ99noXFP6vrX1vhDPzyd81OWz11svMIdciZykyf9WzCQoEytw1IHlOda/7o3/JVm24sJDyrKZ+vD4mqUK1ZFfP9JjNh6+kKX6BEHjdDe6G7Z2nicGcA5FzD2M/BkBBNMrEbnWSOySJgOdESycaRsyC1LKWODOwzMELpfAkiulsgZcDXBENEtIvUNIz/HVAGEGoWaFFJJ0uHtgc/Jkz8grDf6AR/3"}]},"patchSettings":{"patchMode":"ImageDefault"}},"secrets":[]},"networkProfile":{"networkInterfaces":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vpn-lon/providers/Microsoft.Network/networkInterfaces/vpn-lon393"}]},"diagnosticsProfile":{"bootDiagnostics":{"enabled":true,"storageUri":"https://vpnlondiag.blob.core.windows.net/"}},"provisioningState":"Succeeded"}}]}' headers: cache-control: no-cache content-encoding: gzip - content-length: '3190' + content-length: '2933' content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:48:02 GMT + date: Wed, 16 Sep 2020 05:41:21 GMT expires: '-1' pragma: no-cache strict-transport-security: max-age=31536000; includeSubDomains vary: Accept-Encoding x-content-type-options: nosniff - x-ms-original-request-ids: 136991f2-d9c9-46a5-85e6-87acb70ff892 + x-ms-original-request-ids: 9090e9af-e2fb-4858-859e-b6643a2db3ce status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/virtualMachines?api-version=2019-12-01 -- request: - body: null - headers: - Accept: - - application/json - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/virtualMachines?api-version=2019-12-01 - response: - body: - string: "{\r\n \"value\": [\r\n {\r\n \"name\": \"pyvmirvm507d1052\"\ - ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TEST-CHANGLONG/providers/Microsoft.Compute/virtualMachines/pyvmirvm507d1052\"\ - ,\r\n \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\"\ - : \"eastus\",\r\n \"identity\": {\r\n \"type\": \"SystemAssigned\"\ - ,\r\n \"principalId\": \"b13295c3-db33-4a18-af8b-69a113d180fa\",\r\n\ - \ \"tenantId\": \"00000000-0000-0000-0000-000000000000\"\r\n },\r\ - \n \"properties\": {\r\n \"vmId\": \"d1afda73-64fc-4a74-8d4b-ae67558b78a6\"\ - ,\r\n \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_A0\"\ - \r\n },\r\n \"storageProfile\": {\r\n \"imageReference\"\ - : {\r\n \"publisher\": \"Canonical\",\r\n \"offer\"\ - : \"UbuntuServer\",\r\n \"sku\": \"16.04.0-LTS\",\r\n \ - \ \"version\": \"latest\",\r\n \"exactVersion\": \"16.04.202004290\"\ - \r\n },\r\n \"osDisk\": {\r\n \"osType\": \"\ - Linux\",\r\n \"name\": \"pyvmirvm507d1052_OsDisk_1_793c84bb182d4249a638b2827b4631e8\"\ - ,\r\n \"createOption\": \"FromImage\",\r\n \"caching\"\ - : \"ReadWrite\",\r\n \"managedDisk\": {\r\n \"storageAccountType\"\ - : \"Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TEST-CHANGLONG/providers/Microsoft.Compute/disks/pyvmirvm507d1052_OsDisk_1_793c84bb182d4249a638b2827b4631e8\"\ - \r\n },\r\n \"diskSizeGB\": 30\r\n },\r\n \ - \ \"dataDisks\": []\r\n },\r\n \"osProfile\": {\r\n\ - \ \"computerName\": \"test\",\r\n \"adminUsername\": \"\ - Foo12\",\r\n \"linuxConfiguration\": {\r\n \"disablePasswordAuthentication\"\ - : false,\r\n \"provisionVMAgent\": true\r\n },\r\n \ - \ \"secrets\": [],\r\n \"allowExtensionOperations\": true,\r\ - \n \"requireGuestProvisionSignal\": true\r\n },\r\n \ - \ \"networkProfile\": {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-changlong/providers/Microsoft.Network/networkInterfaces/pyvmirnic507d1052\"\ - }]},\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\ - \n {\r\n \"name\": \"testvm\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TESTVMMULTIAPI/providers/Microsoft.Compute/virtualMachines/testvm\"\ - ,\r\n \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\"\ - : \"eastus\",\r\n \"properties\": {\r\n \"vmId\": \"7d191832-5270-4c7e-8a32-f36c35b5d968\"\ - ,\r\n \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_D2_v2\"\ - \r\n },\r\n \"storageProfile\": {\r\n \"imageReference\"\ - : {\r\n \"publisher\": \"MicrosoftWindowsServer\",\r\n \ - \ \"offer\": \"WindowsServer\",\r\n \"sku\": \"2016-Datacenter\"\ - ,\r\n \"version\": \"latest\",\r\n \"exactVersion\"\ - : \"14393.3686.2005061700\"\r\n },\r\n \"osDisk\": {\r\n\ - \ \"osType\": \"Windows\",\r\n \"name\": \"myVMosdisk\"\ - ,\r\n \"createOption\": \"FromImage\",\r\n \"caching\"\ - : \"ReadWrite\",\r\n \"managedDisk\": {\r\n \"storageAccountType\"\ - : \"Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TESTVMMULTIAPI/providers/Microsoft.Compute/disks/myVMosdisk\"\ - \r\n },\r\n \"diskSizeGB\": 127\r\n },\r\n\ - \ \"dataDisks\": [\r\n {\r\n \"lun\": 0,\r\ - \n \"name\": \"testvm_disk2_81ac60155f5d4be0a0941f6a1e07809a\"\ - ,\r\n \"createOption\": \"Empty\",\r\n \"caching\"\ - : \"None\",\r\n \"managedDisk\": {\r\n \"storageAccountType\"\ - : \"Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TESTVMMULTIAPI/providers/Microsoft.Compute/disks/testvm_disk2_81ac60155f5d4be0a0941f6a1e07809a\"\ - \r\n },\r\n \"diskSizeGB\": 1023,\r\n \ - \ \"toBeDetached\": false\r\n },\r\n {\r\n \ - \ \"lun\": 1,\r\n \"name\": \"testvm_disk3_39fd44e369a94dea9fb929b8fac5efee\"\ - ,\r\n \"createOption\": \"Empty\",\r\n \"caching\"\ - : \"None\",\r\n \"managedDisk\": {\r\n \"storageAccountType\"\ - : \"Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TESTVMMULTIAPI/providers/Microsoft.Compute/disks/testvm_disk3_39fd44e369a94dea9fb929b8fac5efee\"\ - \r\n },\r\n \"diskSizeGB\": 1023,\r\n \ - \ \"toBeDetached\": false\r\n }\r\n ]\r\n },\r\ - \n \"osProfile\": {\r\n \"computerName\": \"myVM\",\r\n \ - \ \"adminUsername\": \"testuser\",\r\n \"windowsConfiguration\"\ - : {\r\n \"provisionVMAgent\": true,\r\n \"enableAutomaticUpdates\"\ - : true\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\"\ - : true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\ - \n \"networkProfile\": {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testvmmultiapi/providers/Microsoft.Network/networkInterfaces/testinterface\"\ - ,\"properties\":{\"primary\":true}}]},\r\n \"provisioningState\": \"\ - Succeeded\"\r\n },\r\n \"resources\": [\r\n {\r\n \ - \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TESTVMMULTIAPI/providers/Microsoft.Compute/virtualMachines/testvm/extensions/Microsoft.Azure.Geneva.GenevaMonitoring\"\ - \r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"virtualmachinexxx9a731234\"\ - ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234\"\ + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/virtualMachines?api-version=2020-06-01 +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/virtualMachines?api-version=2020-06-01 + response: + body: + string: "{\r\n \"value\": [\r\n {\r\n \"name\": \"virtualmachinexxx9a731234\"\ + ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/7PTFB2IKPAE54UU36J6DSPCSGPSHFKDJVCURHJJLQHIPQTMXI4Y3ZOQ46GYPODIS2E42PUF3SUQ/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234\"\ ,\r\n \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\"\ - : \"eastus\",\r\n \"properties\": {\r\n \"vmId\": \"883a4b52-0091-48f3-a443-4ca2c729b516\"\ + : \"eastus\",\r\n \"properties\": {\r\n \"vmId\": \"38722ed0-8c2a-41c8-b86a-911c7b41900b\"\ ,\r\n \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_D2_v2\"\ \r\n },\r\n \"storageProfile\": {\r\n \"imageReference\"\ : {\r\n \"publisher\": \"MicrosoftWindowsServer\",\r\n \ \ \"offer\": \"WindowsServer\",\r\n \"sku\": \"2016-Datacenter\"\ ,\r\n \"version\": \"latest\",\r\n \"exactVersion\"\ - : \"14393.3686.2005061700\"\r\n },\r\n \"osDisk\": {\r\n\ + : \"14393.3930.2009041537\"\r\n },\r\n \"osDisk\": {\r\n\ \ \"osType\": \"Windows\",\r\n \"name\": \"myVMosdisk\"\ ,\r\n \"createOption\": \"FromImage\",\r\n \"caching\"\ : \"ReadWrite\",\r\n \"managedDisk\": {\r\n \"storageAccountType\"\ - : \"Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/myVMosdisk\"\ + : \"Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/7PTFB2IKPAE54UU36J6DSPCSGPSHFKDJVCURHJJLQHIPQTMXI4Y3ZOQ46GYPODIS2E42PUF3SUQ/providers/Microsoft.Compute/disks/myVMosdisk\"\ \r\n },\r\n \"diskSizeGB\": 127\r\n },\r\n\ \ \"dataDisks\": [\r\n {\r\n \"lun\": 0,\r\ - \n \"name\": \"virtualmachinexxx9a731234_disk2_85ee171b01894583b0bb14ce0bbbc0a3\"\ + \n \"name\": \"virtualmachinexxx9a731234_disk2_65a6f784860149d4bdad9d8b9e2a8aa5\"\ ,\r\n \"createOption\": \"Empty\",\r\n \"caching\"\ : \"None\",\r\n \"managedDisk\": {\r\n \"storageAccountType\"\ - : \"Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/virtualmachinexxx9a731234_disk2_85ee171b01894583b0bb14ce0bbbc0a3\"\ + : \"Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/7PTFB2IKPAE54UU36J6DSPCSGPSHFKDJVCURHJJLQHIPQTMXI4Y3ZOQ46GYPODIS2E42PUF3SUQ/providers/Microsoft.Compute/disks/virtualmachinexxx9a731234_disk2_65a6f784860149d4bdad9d8b9e2a8aa5\"\ \r\n },\r\n \"diskSizeGB\": 1023,\r\n \ \ \"toBeDetached\": false\r\n },\r\n {\r\n \ - \ \"lun\": 1,\r\n \"name\": \"virtualmachinexxx9a731234_disk3_9e84ad297eb046bb918518a475f01c5d\"\ + \ \"lun\": 1,\r\n \"name\": \"virtualmachinexxx9a731234_disk3_3fcecb66e0b74060a3194c7f95df789f\"\ ,\r\n \"createOption\": \"Empty\",\r\n \"caching\"\ : \"None\",\r\n \"managedDisk\": {\r\n \"storageAccountType\"\ - : \"Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/virtualmachinexxx9a731234_disk3_9e84ad297eb046bb918518a475f01c5d\"\ + : \"Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/7PTFB2IKPAE54UU36J6DSPCSGPSHFKDJVCURHJJLQHIPQTMXI4Y3ZOQ46GYPODIS2E42PUF3SUQ/providers/Microsoft.Compute/disks/virtualmachinexxx9a731234_disk3_3fcecb66e0b74060a3194c7f95df789f\"\ \r\n },\r\n \"diskSizeGB\": 1023,\r\n \ \ \"toBeDetached\": false\r\n }\r\n ]\r\n },\r\ \n \"osProfile\": {\r\n \"computerName\": \"myVM\",\r\n \ \ \"adminUsername\": \"testuser\",\r\n \"windowsConfiguration\"\ : {\r\n \"provisionVMAgent\": true,\r\n \"enableAutomaticUpdates\"\ - : true\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\"\ - : true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\ - \n \"networkProfile\": {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexxx9a731234\"\ + : true,\r\n \"patchSettings\": {\r\n \"patchMode\"\ + : \"AutomaticByOS\"\r\n }\r\n },\r\n \"secrets\"\ + : [],\r\n \"allowExtensionOperations\": true,\r\n \"requireGuestProvisionSignal\"\ + : true\r\n },\r\n \"networkProfile\": {\"networkInterfaces\"\ + :[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexxx9a731234\"\ ,\"properties\":{\"primary\":true}}]},\r\n \"provisioningState\": \"\ Succeeded\"\r\n },\r\n \"resources\": [\r\n {\r\n \ - \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/extensions/virtualmachineextensionxxx9a731234\"\ - \r\n }\r\n ]\r\n }\r\n ]\r\n}" + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/7PTFB2IKPAE54UU36J6DSPCSGPSHFKDJVCURHJJLQHIPQTMXI4Y3ZOQ46GYPODIS2E42PUF3SUQ/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/extensions/virtualmachineextensionxxx9a731234\"\ + \r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"test\",\r\ + \n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/AZURE-SDK-TEST/providers/Microsoft.Compute/virtualMachines/test\"\ + ,\r\n \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\"\ + : \"eastus\",\r\n \"properties\": {\r\n \"vmId\": \"f497cb21-adf5-4caf-83e7-5041df1af906\"\ + ,\r\n \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_D2s_v3\"\ + \r\n },\r\n \"storageProfile\": {\r\n \"imageReference\"\ + : {\r\n \"publisher\": \"Canonical\",\r\n \"offer\"\ + : \"UbuntuServer\",\r\n \"sku\": \"18.04-LTS\",\r\n \ + \ \"version\": \"latest\",\r\n \"exactVersion\": \"18.04.202009080\"\ + \r\n },\r\n \"osDisk\": {\r\n \"osType\": \"\ + Linux\",\r\n \"name\": \"test_OsDisk_1_ccbcc532cb2443f0bd947ace2245cb43\"\ + ,\r\n \"createOption\": \"FromImage\",\r\n \"caching\"\ + : \"ReadWrite\",\r\n \"managedDisk\": {\r\n \"storageAccountType\"\ + : \"Premium_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/AZURE-SDK-TEST/providers/Microsoft.Compute/disks/test_OsDisk_1_ccbcc532cb2443f0bd947ace2245cb43\"\ + \r\n },\r\n \"diskSizeGB\": 30\r\n },\r\n \ + \ \"dataDisks\": []\r\n },\r\n \"osProfile\": {\r\n\ + \ \"computerName\": \"test\",\r\n \"adminUsername\": \"\ + us\",\r\n \"linuxConfiguration\": {\r\n \"disablePasswordAuthentication\"\ + : false,\r\n \"provisionVMAgent\": true,\r\n \"patchSettings\"\ + : {\r\n \"patchMode\": \"ImageDefault\"\r\n }\r\n\ + \ },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\"\ + : true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\ + \n \"networkProfile\": {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sdk-test/providers/Microsoft.Network/networkInterfaces/test933\"\ + }]},\r\n \"diagnosticsProfile\": {\r\n \"bootDiagnostics\"\ + : {\r\n \"enabled\": true,\r\n \"storageUri\": \"https://azuresdktestdiag.blob.core.windows.net/\"\ + \r\n }\r\n },\r\n \"provisioningState\": \"Succeeded\"\ + \r\n }\r\n }\r\n ]\r\n}" headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:48:03 GMT + date: Wed, 16 Sep 2020 05:41:21 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -3074,34 +3220,34 @@ interactions: transfer-encoding: chunked vary: Accept-Encoding x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/HighCostGet3Min;137,Microsoft.Compute/HighCostGet30Min;697 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/HighCostGet3Min;137,Microsoft.Compute/HighCostGet30Min;696 status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/virtualMachines?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/virtualMachines?api-version=2020-06-01 - request: body: '{"commandId": "RunPowerShellScript"}' headers: Accept: - - application/json + - application/json, text/json Content-Length: - '36' Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/runCommand?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/runCommand?api-version=2020-06-01 response: body: string: '' headers: - azure-asyncoperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f56167fd-ad00-446e-9ae7-db50f14f5cd5?api-version=2019-12-01 + azure-asyncoperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f44a5846-281b-46a8-84cd-42108dbac62e?api-version=2020-06-01 cache-control: no-cache content-length: '0' - date: Tue, 02 Jun 2020 02:48:03 GMT + date: Wed, 16 Sep 2020 05:41:21 GMT expires: '-1' - location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f56167fd-ad00-446e-9ae7-db50f14f5cd5?monitor=true&api-version=2019-12-01 + location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f44a5846-281b-46a8-84cd-42108dbac62e?monitor=true&api-version=2020-06-01 pragma: no-cache server: Microsoft-HTTPAPI/2.0 strict-transport-security: max-age=31536000; includeSubDomains @@ -3111,24 +3257,82 @@ interactions: status: code: 202 message: Accepted - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/runCommand?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7ptfb2ikpae54uu36j6dspcsgpshfkdjvcurhjjlqhipqtmxi4y3zoq46gypodis2e42puf3suq/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/runCommand?api-version=2020-06-01 +- request: + body: null + headers: + User-Agent: + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f44a5846-281b-46a8-84cd-42108dbac62e?api-version=2020-06-01 + response: + body: + string: "{\r\n \"startTime\": \"2020-09-16T05:41:22.4133351+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"f44a5846-281b-46a8-84cd-42108dbac62e\"\ + \r\n}" + headers: + cache-control: no-cache + content-encoding: gzip + content-type: application/json; charset=utf-8 + date: Wed, 16 Sep 2020 05:41:54 GMT + expires: '-1' + pragma: no-cache + server: Microsoft-HTTPAPI/2.0 + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + vary: Accept-Encoding + x-content-type-options: nosniff + x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14990,Microsoft.Compute/GetOperation30Min;29989 + status: + code: 200 + message: OK + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/f44a5846-281b-46a8-84cd-42108dbac62e?api-version=2020-06-01 +- request: + body: null + headers: + User-Agent: + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f44a5846-281b-46a8-84cd-42108dbac62e?api-version=2020-06-01 + response: + body: + string: "{\r\n \"startTime\": \"2020-09-16T05:41:22.4133351+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"f44a5846-281b-46a8-84cd-42108dbac62e\"\ + \r\n}" + headers: + cache-control: no-cache + content-encoding: gzip + content-type: application/json; charset=utf-8 + date: Wed, 16 Sep 2020 05:42:25 GMT + expires: '-1' + pragma: no-cache + server: Microsoft-HTTPAPI/2.0 + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + vary: Accept-Encoding + x-content-type-options: nosniff + x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14990,Microsoft.Compute/GetOperation30Min;29987 + status: + code: 200 + message: OK + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/f44a5846-281b-46a8-84cd-42108dbac62e?api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f56167fd-ad00-446e-9ae7-db50f14f5cd5?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f44a5846-281b-46a8-84cd-42108dbac62e?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-02T02:48:03.7417701+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"f56167fd-ad00-446e-9ae7-db50f14f5cd5\"\ + string: "{\r\n \"startTime\": \"2020-09-16T05:41:22.4133351+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"f44a5846-281b-46a8-84cd-42108dbac62e\"\ \r\n}" headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:48:33 GMT + date: Wed, 16 Sep 2020 05:42:56 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -3136,33 +3340,33 @@ interactions: transfer-encoding: chunked vary: Accept-Encoding x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14992,Microsoft.Compute/GetOperation30Min;29990 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14988,Microsoft.Compute/GetOperation30Min;29984 status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/f56167fd-ad00-446e-9ae7-db50f14f5cd5?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/f44a5846-281b-46a8-84cd-42108dbac62e?api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f56167fd-ad00-446e-9ae7-db50f14f5cd5?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f44a5846-281b-46a8-84cd-42108dbac62e?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-02T02:48:03.7417701+00:00\",\r\n \"\ - endTime\": \"2020-06-02T02:48:36.9917606+00:00\",\r\n \"status\": \"Succeeded\"\ + string: "{\r\n \"startTime\": \"2020-09-16T05:41:22.4133351+00:00\",\r\n \"\ + endTime\": \"2020-09-16T05:43:03.2421575+00:00\",\r\n \"status\": \"Succeeded\"\ ,\r\n \"properties\": {\r\n \"output\": {\"value\":[{\"code\":\"ComponentStatus/StdOut/succeeded\"\ ,\"level\":\"Info\",\"displayStatus\":\"Provisioning succeeded\",\"message\"\ :\"This is a sample script with parameters \"},{\"code\":\"ComponentStatus/StdErr/succeeded\"\ ,\"level\":\"Info\",\"displayStatus\":\"Provisioning succeeded\",\"message\"\ - :\"\"}]}\r\n },\r\n \"name\": \"f56167fd-ad00-446e-9ae7-db50f14f5cd5\"\r\ + :\"\"}]}\r\n },\r\n \"name\": \"f44a5846-281b-46a8-84cd-42108dbac62e\"\r\ \n}" headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:49:05 GMT + date: Wed, 16 Sep 2020 05:43:27 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -3170,18 +3374,18 @@ interactions: transfer-encoding: chunked vary: Accept-Encoding x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14991,Microsoft.Compute/GetOperation30Min;29987 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29981 status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/f56167fd-ad00-446e-9ae7-db50f14f5cd5?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/f44a5846-281b-46a8-84cd-42108dbac62e?api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f56167fd-ad00-446e-9ae7-db50f14f5cd5?monitor=true&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f44a5846-281b-46a8-84cd-42108dbac62e?monitor=true&api-version=2020-06-01 response: body: string: '{"value":[{"code":"ComponentStatus/StdOut/succeeded","level":"Info","displayStatus":"Provisioning @@ -3191,7 +3395,7 @@ interactions: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:49:05 GMT + date: Wed, 16 Sep 2020 05:43:27 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -3199,28 +3403,28 @@ interactions: transfer-encoding: chunked vary: Accept-Encoding x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14990,Microsoft.Compute/GetOperation30Min;29986 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29980 status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/f56167fd-ad00-446e-9ae7-db50f14f5cd5?monitor=true&api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/f44a5846-281b-46a8-84cd-42108dbac62e?monitor=true&api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/restart?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/restart?api-version=2020-06-01 response: body: string: '' headers: - azure-asyncoperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1298fe5f-a10e-427b-a719-9c335a595247?api-version=2019-12-01 + azure-asyncoperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/aeb7757d-57c4-4dea-8892-8e8c7f3b9f6c?api-version=2020-06-01 cache-control: no-cache content-length: '0' - date: Tue, 02 Jun 2020 02:49:05 GMT + date: Wed, 16 Sep 2020 05:43:28 GMT expires: '-1' - location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1298fe5f-a10e-427b-a719-9c335a595247?monitor=true&api-version=2019-12-01 + location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/aeb7757d-57c4-4dea-8892-8e8c7f3b9f6c?monitor=true&api-version=2020-06-01 pragma: no-cache server: Microsoft-HTTPAPI/2.0 strict-transport-security: max-age=31536000; includeSubDomains @@ -3230,24 +3434,24 @@ interactions: status: code: 202 message: Accepted - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/restart?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7ptfb2ikpae54uu36j6dspcsgpshfkdjvcurhjjlqhipqtmxi4y3zoq46gypodis2e42puf3suq/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/restart?api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1298fe5f-a10e-427b-a719-9c335a595247?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/aeb7757d-57c4-4dea-8892-8e8c7f3b9f6c?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-02T02:49:06.1480189+00:00\",\r\n \"\ - endTime\": \"2020-06-02T02:49:06.3355204+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"1298fe5f-a10e-427b-a719-9c335a595247\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T05:43:27.9454381+00:00\",\r\n \"\ + endTime\": \"2020-09-16T05:43:28.2422946+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"aeb7757d-57c4-4dea-8892-8e8c7f3b9f6c\"\r\n}" headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:49:37 GMT + date: Wed, 16 Sep 2020 05:43:58 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -3255,79 +3459,79 @@ interactions: transfer-encoding: chunked vary: Accept-Encoding x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14989,Microsoft.Compute/GetOperation30Min;29984 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29978 status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/1298fe5f-a10e-427b-a719-9c335a595247?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/aeb7757d-57c4-4dea-8892-8e8c7f3b9f6c?api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1298fe5f-a10e-427b-a719-9c335a595247?monitor=true&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/aeb7757d-57c4-4dea-8892-8e8c7f3b9f6c?monitor=true&api-version=2020-06-01 response: body: string: '' headers: cache-control: no-cache content-length: '0' - date: Tue, 02 Jun 2020 02:49:38 GMT + date: Wed, 16 Sep 2020 05:43:59 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 strict-transport-security: max-age=31536000; includeSubDomains x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14988,Microsoft.Compute/GetOperation30Min;29983 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29977 status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/1298fe5f-a10e-427b-a719-9c335a595247?monitor=true&api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/aeb7757d-57c4-4dea-8892-8e8c7f3b9f6c?monitor=true&api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/powerOff?skipShutdown=false&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/powerOff?skipShutdown=false&api-version=2020-06-01 response: body: string: '' headers: - azure-asyncoperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e4aea727-db15-4894-836c-a10f8c480237?api-version=2019-12-01 + azure-asyncoperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/62c9c8d4-a410-44ae-955a-8ec41aab6d7d?api-version=2020-06-01 cache-control: no-cache content-length: '0' - date: Tue, 02 Jun 2020 02:49:38 GMT + date: Wed, 16 Sep 2020 05:43:59 GMT expires: '-1' - location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e4aea727-db15-4894-836c-a10f8c480237?monitor=true&api-version=2019-12-01 + location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/62c9c8d4-a410-44ae-955a-8ec41aab6d7d?monitor=true&api-version=2020-06-01 pragma: no-cache server: Microsoft-HTTPAPI/2.0 strict-transport-security: max-age=31536000; includeSubDomains x-content-type-options: nosniff x-ms-ratelimit-remaining-resource: Microsoft.Compute/UpdateVM3Min;237,Microsoft.Compute/UpdateVM30Min;1196 - x-ms-ratelimit-remaining-subscription-writes: '1196' + x-ms-ratelimit-remaining-subscription-writes: '1199' status: code: 202 message: Accepted - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/powerOff?skipShutdown=false&api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7ptfb2ikpae54uu36j6dspcsgpshfkdjvcurhjjlqhipqtmxi4y3zoq46gypodis2e42puf3suq/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/powerOff?skipShutdown=false&api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e4aea727-db15-4894-836c-a10f8c480237?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/62c9c8d4-a410-44ae-955a-8ec41aab6d7d?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-02T02:49:38.3980706+00:00\",\r\n \"\ - endTime\": \"2020-06-02T02:50:00.663753+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"e4aea727-db15-4894-836c-a10f8c480237\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T05:43:59.6175198+00:00\",\r\n \"\ + endTime\": \"2020-09-16T05:44:16.0238697+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"62c9c8d4-a410-44ae-955a-8ec41aab6d7d\"\r\n}" headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:50:09 GMT + date: Wed, 16 Sep 2020 05:44:30 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -3335,79 +3539,79 @@ interactions: transfer-encoding: chunked vary: Accept-Encoding x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14987,Microsoft.Compute/GetOperation30Min;29981 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29975 status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/e4aea727-db15-4894-836c-a10f8c480237?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/62c9c8d4-a410-44ae-955a-8ec41aab6d7d?api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e4aea727-db15-4894-836c-a10f8c480237?monitor=true&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/62c9c8d4-a410-44ae-955a-8ec41aab6d7d?monitor=true&api-version=2020-06-01 response: body: string: '' headers: cache-control: no-cache content-length: '0' - date: Tue, 02 Jun 2020 02:50:09 GMT + date: Wed, 16 Sep 2020 05:44:30 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 strict-transport-security: max-age=31536000; includeSubDomains x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29980 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29974 status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/e4aea727-db15-4894-836c-a10f8c480237?monitor=true&api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/62c9c8d4-a410-44ae-955a-8ec41aab6d7d?monitor=true&api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/start?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/start?api-version=2020-06-01 response: body: string: '' headers: - azure-asyncoperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/34c18714-438d-4852-8cb0-c275901418b1?api-version=2019-12-01 + azure-asyncoperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/8d0f2636-537d-4d2d-afca-a7038ea86cbf?api-version=2020-06-01 cache-control: no-cache content-length: '0' - date: Tue, 02 Jun 2020 02:50:09 GMT + date: Wed, 16 Sep 2020 05:44:31 GMT expires: '-1' - location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/34c18714-438d-4852-8cb0-c275901418b1?monitor=true&api-version=2019-12-01 + location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/8d0f2636-537d-4d2d-afca-a7038ea86cbf?monitor=true&api-version=2020-06-01 pragma: no-cache server: Microsoft-HTTPAPI/2.0 strict-transport-security: max-age=31536000; includeSubDomains x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/UpdateVM3Min;236,Microsoft.Compute/UpdateVM30Min;1195 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/UpdateVM3Min;237,Microsoft.Compute/UpdateVM30Min;1195 x-ms-ratelimit-remaining-subscription-writes: '1199' status: code: 202 message: Accepted - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/start?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7ptfb2ikpae54uu36j6dspcsgpshfkdjvcurhjjlqhipqtmxi4y3zoq46gypodis2e42puf3suq/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/start?api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/34c18714-438d-4852-8cb0-c275901418b1?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/8d0f2636-537d-4d2d-afca-a7038ea86cbf?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-02T02:50:10.0232421+00:00\",\r\n \"\ - endTime\": \"2020-06-02T02:50:15.867009+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"34c18714-438d-4852-8cb0-c275901418b1\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T05:44:31.1958899+00:00\",\r\n \"\ + endTime\": \"2020-09-16T05:44:36.2740653+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"8d0f2636-537d-4d2d-afca-a7038ea86cbf\"\r\n}" headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:50:20 GMT + date: Wed, 16 Sep 2020 05:44:41 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -3415,35 +3619,35 @@ interactions: transfer-encoding: chunked vary: Accept-Encoding x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29978 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29972 status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/34c18714-438d-4852-8cb0-c275901418b1?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/8d0f2636-537d-4d2d-afca-a7038ea86cbf?api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/34c18714-438d-4852-8cb0-c275901418b1?monitor=true&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/8d0f2636-537d-4d2d-afca-a7038ea86cbf?monitor=true&api-version=2020-06-01 response: body: string: '' headers: cache-control: no-cache content-length: '0' - date: Tue, 02 Jun 2020 02:50:20 GMT + date: Wed, 16 Sep 2020 05:44:41 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 strict-transport-security: max-age=31536000; includeSubDomains x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29977 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29971 status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/34c18714-438d-4852-8cb0-c275901418b1?monitor=true&api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/8d0f2636-537d-4d2d-afca-a7038ea86cbf?monitor=true&api-version=2020-06-01 - request: body: '{"properties": {"autoUpgradeMinorVersion": true}}' headers: @@ -3454,9 +3658,9 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/extensions/virtualmachineextensionxxx9a731234?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/extensions/virtualmachineextensionxxx9a731234?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"virtualmachineextensionxxx9a731234\",\r\n \"id\"\ @@ -3467,11 +3671,11 @@ interactions: \ \"Microsoft.Azure.NetworkWatcher\",\r\n \"type\": \"NetworkWatcherAgentWindows\"\ ,\r\n \"typeHandlerVersion\": \"1.4\"\r\n }\r\n}" headers: - azure-asyncoperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3a57f0b9-c73a-4fa7-a56a-9965f8b0cd65?api-version=2019-12-01 + azure-asyncoperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7e8d7947-129c-4bbe-ac00-86a62e8defa1?api-version=2020-06-01 cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:50:21 GMT + date: Wed, 16 Sep 2020 05:44:42 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -3479,29 +3683,29 @@ interactions: transfer-encoding: chunked vary: Accept-Encoding x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/UpdateVM3Min;235,Microsoft.Compute/UpdateVM30Min;1194 - x-ms-ratelimit-remaining-subscription-writes: '1190' + x-ms-ratelimit-remaining-resource: Microsoft.Compute/UpdateVM3Min;236,Microsoft.Compute/UpdateVM30Min;1194 + x-ms-ratelimit-remaining-subscription-writes: '1197' status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/extensions/virtualmachineextensionxxx9a731234?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7ptfb2ikpae54uu36j6dspcsgpshfkdjvcurhjjlqhipqtmxi4y3zoq46gypodis2e42puf3suq/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/extensions/virtualmachineextensionxxx9a731234?api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3a57f0b9-c73a-4fa7-a56a-9965f8b0cd65?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7e8d7947-129c-4bbe-ac00-86a62e8defa1?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-02T02:50:21.163911+00:00\",\r\n \"\ - endTime\": \"2020-06-02T02:50:21.3201583+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"3a57f0b9-c73a-4fa7-a56a-9965f8b0cd65\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T05:44:42.3053296+00:00\",\r\n \"\ + endTime\": \"2020-09-16T05:44:42.5240794+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"7e8d7947-129c-4bbe-ac00-86a62e8defa1\"\r\n}" headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:50:51 GMT + date: Wed, 16 Sep 2020 05:45:13 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -3509,18 +3713,18 @@ interactions: transfer-encoding: chunked vary: Accept-Encoding x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29975 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29969 status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/3a57f0b9-c73a-4fa7-a56a-9965f8b0cd65?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/7e8d7947-129c-4bbe-ac00-86a62e8defa1?api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/extensions/virtualmachineextensionxxx9a731234?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/extensions/virtualmachineextensionxxx9a731234?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"virtualmachineextensionxxx9a731234\",\r\n \"id\"\ @@ -3534,7 +3738,7 @@ interactions: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:50:51 GMT + date: Wed, 16 Sep 2020 05:45:13 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -3542,56 +3746,85 @@ interactions: transfer-encoding: chunked vary: Accept-Encoding x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/LowCostGet3Min;3996,Microsoft.Compute/LowCostGet30Min;31989 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/LowCostGet3Min;3999,Microsoft.Compute/LowCostGet30Min;31986 status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/extensions/virtualmachineextensionxxx9a731234?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7ptfb2ikpae54uu36j6dspcsgpshfkdjvcurhjjlqhipqtmxi4y3zoq46gypodis2e42puf3suq/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/extensions/virtualmachineextensionxxx9a731234?api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/extensions/virtualmachineextensionxxx9a731234?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/extensions/virtualmachineextensionxxx9a731234?api-version=2020-06-01 response: body: string: '' headers: azure-asyncnotification: Enabled - azure-asyncoperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/8da0ca37-ac6f-49d5-b645-ac2e4e0ecec1?api-version=2019-12-01 + azure-asyncoperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/9facaa8b-00b6-46ed-9d5f-0a45e87e75d9?api-version=2020-06-01 cache-control: no-cache content-length: '0' - date: Tue, 02 Jun 2020 02:50:52 GMT + date: Wed, 16 Sep 2020 05:45:14 GMT expires: '-1' - location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/8da0ca37-ac6f-49d5-b645-ac2e4e0ecec1?monitor=true&api-version=2019-12-01 + location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/9facaa8b-00b6-46ed-9d5f-0a45e87e75d9?monitor=true&api-version=2020-06-01 pragma: no-cache server: Microsoft-HTTPAPI/2.0 strict-transport-security: max-age=31536000; includeSubDomains x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/UpdateVM3Min;234,Microsoft.Compute/UpdateVM30Min;1193 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/UpdateVM3Min;235,Microsoft.Compute/UpdateVM30Min;1193 x-ms-ratelimit-remaining-subscription-deletes: '14998' status: code: 202 message: Accepted - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/extensions/virtualmachineextensionxxx9a731234?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7ptfb2ikpae54uu36j6dspcsgpshfkdjvcurhjjlqhipqtmxi4y3zoq46gypodis2e42puf3suq/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/extensions/virtualmachineextensionxxx9a731234?api-version=2020-06-01 +- request: + body: null + headers: + User-Agent: + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/9facaa8b-00b6-46ed-9d5f-0a45e87e75d9?api-version=2020-06-01 + response: + body: + string: "{\r\n \"startTime\": \"2020-09-16T05:45:15.2898863+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"9facaa8b-00b6-46ed-9d5f-0a45e87e75d9\"\ + \r\n}" + headers: + cache-control: no-cache + content-encoding: gzip + content-type: application/json; charset=utf-8 + date: Wed, 16 Sep 2020 05:45:45 GMT + expires: '-1' + pragma: no-cache + server: Microsoft-HTTPAPI/2.0 + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + vary: Accept-Encoding + x-content-type-options: nosniff + x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29968 + status: + code: 200 + message: OK + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/9facaa8b-00b6-46ed-9d5f-0a45e87e75d9?api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/8da0ca37-ac6f-49d5-b645-ac2e4e0ecec1?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/9facaa8b-00b6-46ed-9d5f-0a45e87e75d9?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-02T02:50:53.2108944+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"8da0ca37-ac6f-49d5-b645-ac2e4e0ecec1\"\ + string: "{\r\n \"startTime\": \"2020-09-16T05:45:15.2898863+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"9facaa8b-00b6-46ed-9d5f-0a45e87e75d9\"\ \r\n}" headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:51:23 GMT + date: Wed, 16 Sep 2020 05:46:16 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -3599,28 +3832,28 @@ interactions: transfer-encoding: chunked vary: Accept-Encoding x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29974 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14987,Microsoft.Compute/GetOperation30Min;29967 status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/8da0ca37-ac6f-49d5-b645-ac2e4e0ecec1?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/9facaa8b-00b6-46ed-9d5f-0a45e87e75d9?api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/8da0ca37-ac6f-49d5-b645-ac2e4e0ecec1?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/9facaa8b-00b6-46ed-9d5f-0a45e87e75d9?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-02T02:50:53.2108944+00:00\",\r\n \"\ - endTime\": \"2020-06-02T02:51:26.6329871+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"8da0ca37-ac6f-49d5-b645-ac2e4e0ecec1\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T05:45:15.2898863+00:00\",\r\n \"\ + endTime\": \"2020-09-16T05:46:45.9311067+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"9facaa8b-00b6-46ed-9d5f-0a45e87e75d9\"\r\n}" headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:51:54 GMT + date: Wed, 16 Sep 2020 05:46:47 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -3628,55 +3861,55 @@ interactions: transfer-encoding: chunked vary: Accept-Encoding x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29972 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14989,Microsoft.Compute/GetOperation30Min;29966 status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/8da0ca37-ac6f-49d5-b645-ac2e4e0ecec1?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/9facaa8b-00b6-46ed-9d5f-0a45e87e75d9?api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/powerOff?skipShutdown=false&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/powerOff?skipShutdown=false&api-version=2020-06-01 response: body: string: '' headers: - azure-asyncoperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4d89f135-0d18-4f3c-b8f7-a5dd9f330a1e?api-version=2019-12-01 + azure-asyncoperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/252d99a1-1df1-4a5d-bc7a-4646a0b6dcfd?api-version=2020-06-01 cache-control: no-cache content-length: '0' - date: Tue, 02 Jun 2020 02:51:55 GMT + date: Wed, 16 Sep 2020 05:46:47 GMT expires: '-1' - location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4d89f135-0d18-4f3c-b8f7-a5dd9f330a1e?monitor=true&api-version=2019-12-01 + location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/252d99a1-1df1-4a5d-bc7a-4646a0b6dcfd?monitor=true&api-version=2020-06-01 pragma: no-cache server: Microsoft-HTTPAPI/2.0 strict-transport-security: max-age=31536000; includeSubDomains x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/UpdateVM3Min;234,Microsoft.Compute/UpdateVM30Min;1192 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/UpdateVM3Min;236,Microsoft.Compute/UpdateVM30Min;1192 x-ms-ratelimit-remaining-subscription-writes: '1199' status: code: 202 message: Accepted - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/powerOff?skipShutdown=false&api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7ptfb2ikpae54uu36j6dspcsgpshfkdjvcurhjjlqhipqtmxi4y3zoq46gypodis2e42puf3suq/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/powerOff?skipShutdown=false&api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4d89f135-0d18-4f3c-b8f7-a5dd9f330a1e?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/252d99a1-1df1-4a5d-bc7a-4646a0b6dcfd?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-02T02:51:55.2737937+00:00\",\r\n \"\ - endTime\": \"2020-06-02T02:52:06.4614416+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"4d89f135-0d18-4f3c-b8f7-a5dd9f330a1e\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T05:46:48.5561839+00:00\",\r\n \"\ + endTime\": \"2020-09-16T05:47:01.0562526+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"252d99a1-1df1-4a5d-bc7a-4646a0b6dcfd\"\r\n}" headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:52:25 GMT + date: Wed, 16 Sep 2020 05:47:19 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -3684,79 +3917,81 @@ interactions: transfer-encoding: chunked vary: Accept-Encoding x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29970 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14987,Microsoft.Compute/GetOperation30Min;29963 status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/4d89f135-0d18-4f3c-b8f7-a5dd9f330a1e?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/252d99a1-1df1-4a5d-bc7a-4646a0b6dcfd?api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4d89f135-0d18-4f3c-b8f7-a5dd9f330a1e?monitor=true&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/252d99a1-1df1-4a5d-bc7a-4646a0b6dcfd?monitor=true&api-version=2020-06-01 response: body: string: '' headers: cache-control: no-cache content-length: '0' - date: Tue, 02 Jun 2020 02:52:26 GMT + date: Wed, 16 Sep 2020 05:47:19 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 strict-transport-security: max-age=31536000; includeSubDomains x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29969 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29962 status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/4d89f135-0d18-4f3c-b8f7-a5dd9f330a1e?monitor=true&api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/252d99a1-1df1-4a5d-bc7a-4646a0b6dcfd?monitor=true&api-version=2020-06-01 - request: body: null headers: + Accept: + - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/reapply?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/reapply?api-version=2020-06-01 response: body: string: '' headers: - azure-asyncoperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/844e3894-4b78-43f0-8321-a64b82cb8a4e?api-version=2019-12-01 + azure-asyncoperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3387831f-127b-487a-a170-e656c4bc9ee4?api-version=2020-06-01 cache-control: no-cache content-length: '0' - date: Tue, 02 Jun 2020 02:52:26 GMT + date: Wed, 16 Sep 2020 05:47:20 GMT expires: '-1' - location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/844e3894-4b78-43f0-8321-a64b82cb8a4e?monitor=true&api-version=2019-12-01 + location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3387831f-127b-487a-a170-e656c4bc9ee4?monitor=true&api-version=2020-06-01 pragma: no-cache server: Microsoft-HTTPAPI/2.0 strict-transport-security: max-age=31536000; includeSubDomains x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/UpdateVM3Min;234,Microsoft.Compute/UpdateVM30Min;1191 - x-ms-ratelimit-remaining-subscription-writes: '1199' + x-ms-ratelimit-remaining-resource: Microsoft.Compute/UpdateVM3Min;235,Microsoft.Compute/UpdateVM30Min;1191 + x-ms-ratelimit-remaining-subscription-writes: '1198' status: code: 202 message: Accepted - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/reapply?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7ptfb2ikpae54uu36j6dspcsgpshfkdjvcurhjjlqhipqtmxi4y3zoq46gypodis2e42puf3suq/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/reapply?api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/844e3894-4b78-43f0-8321-a64b82cb8a4e?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3387831f-127b-487a-a170-e656c4bc9ee4?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-02T02:52:26.9301845+00:00\",\r\n \"\ - endTime\": \"2020-06-02T02:52:28.3833384+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"844e3894-4b78-43f0-8321-a64b82cb8a4e\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T05:47:20.3376379+00:00\",\r\n \"\ + endTime\": \"2020-09-16T05:47:21.9314025+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"3387831f-127b-487a-a170-e656c4bc9ee4\"\r\n}" headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:52:57 GMT + date: Wed, 16 Sep 2020 05:47:51 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -3764,79 +3999,79 @@ interactions: transfer-encoding: chunked vary: Accept-Encoding x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29967 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14990,Microsoft.Compute/GetOperation30Min;29960 status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/844e3894-4b78-43f0-8321-a64b82cb8a4e?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/3387831f-127b-487a-a170-e656c4bc9ee4?api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/844e3894-4b78-43f0-8321-a64b82cb8a4e?monitor=true&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3387831f-127b-487a-a170-e656c4bc9ee4?monitor=true&api-version=2020-06-01 response: body: string: '' headers: cache-control: no-cache content-length: '0' - date: Tue, 02 Jun 2020 02:52:57 GMT + date: Wed, 16 Sep 2020 05:47:51 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 strict-transport-security: max-age=31536000; includeSubDomains x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29966 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14989,Microsoft.Compute/GetOperation30Min;29959 status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/844e3894-4b78-43f0-8321-a64b82cb8a4e?monitor=true&api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/3387831f-127b-487a-a170-e656c4bc9ee4?monitor=true&api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/redeploy?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/redeploy?api-version=2020-06-01 response: body: string: '' headers: - azure-asyncoperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b9470517-4d35-4457-9e6d-dc7cd48f89fd?api-version=2019-12-01 + azure-asyncoperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/88fad652-fcef-4c47-adaa-e58e781fd2b3?api-version=2020-06-01 cache-control: no-cache content-length: '0' - date: Tue, 02 Jun 2020 02:52:58 GMT + date: Wed, 16 Sep 2020 05:47:52 GMT expires: '-1' - location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b9470517-4d35-4457-9e6d-dc7cd48f89fd?monitor=true&api-version=2019-12-01 + location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/88fad652-fcef-4c47-adaa-e58e781fd2b3?monitor=true&api-version=2020-06-01 pragma: no-cache server: Microsoft-HTTPAPI/2.0 strict-transport-security: max-age=31536000; includeSubDomains x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/UpdateVM3Min;234,Microsoft.Compute/UpdateVM30Min;1190 - x-ms-ratelimit-remaining-subscription-writes: '1195' + x-ms-ratelimit-remaining-resource: Microsoft.Compute/UpdateVM3Min;236,Microsoft.Compute/UpdateVM30Min;1190 + x-ms-ratelimit-remaining-subscription-writes: '1199' status: code: 202 message: Accepted - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/redeploy?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7ptfb2ikpae54uu36j6dspcsgpshfkdjvcurhjjlqhipqtmxi4y3zoq46gypodis2e42puf3suq/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/redeploy?api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b9470517-4d35-4457-9e6d-dc7cd48f89fd?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/88fad652-fcef-4c47-adaa-e58e781fd2b3?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-02T02:52:58.5397558+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"b9470517-4d35-4457-9e6d-dc7cd48f89fd\"\ + string: "{\r\n \"startTime\": \"2020-09-16T05:47:52.2284331+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"88fad652-fcef-4c47-adaa-e58e781fd2b3\"\ \r\n}" headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:53:28 GMT + date: Wed, 16 Sep 2020 05:48:23 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -3844,28 +4079,28 @@ interactions: transfer-encoding: chunked vary: Accept-Encoding x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14988,Microsoft.Compute/GetOperation30Min;29964 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14988,Microsoft.Compute/GetOperation30Min;29957 status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/b9470517-4d35-4457-9e6d-dc7cd48f89fd?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/88fad652-fcef-4c47-adaa-e58e781fd2b3?api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b9470517-4d35-4457-9e6d-dc7cd48f89fd?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/88fad652-fcef-4c47-adaa-e58e781fd2b3?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-02T02:52:58.5397558+00:00\",\r\n \"\ - endTime\": \"2020-06-02T02:53:48.1181187+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"b9470517-4d35-4457-9e6d-dc7cd48f89fd\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T05:47:52.2284331+00:00\",\r\n \"\ + endTime\": \"2020-09-16T05:48:27.634921+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"88fad652-fcef-4c47-adaa-e58e781fd2b3\"\r\n}" headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:53:59 GMT + date: Wed, 16 Sep 2020 05:48:54 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -3873,92 +4108,94 @@ interactions: transfer-encoding: chunked vary: Accept-Encoding x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14987,Microsoft.Compute/GetOperation30Min;29961 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29954 status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/b9470517-4d35-4457-9e6d-dc7cd48f89fd?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/88fad652-fcef-4c47-adaa-e58e781fd2b3?api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b9470517-4d35-4457-9e6d-dc7cd48f89fd?monitor=true&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/88fad652-fcef-4c47-adaa-e58e781fd2b3?monitor=true&api-version=2020-06-01 response: body: string: '' headers: cache-control: no-cache content-length: '0' - date: Tue, 02 Jun 2020 02:53:59 GMT + date: Wed, 16 Sep 2020 05:48:55 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 strict-transport-security: max-age=31536000; includeSubDomains x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29960 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29953 status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/b9470517-4d35-4457-9e6d-dc7cd48f89fd?monitor=true&api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/88fad652-fcef-4c47-adaa-e58e781fd2b3?monitor=true&api-version=2020-06-01 - request: - body: 'b''{"properties": {"networkProfile": {"networkInterfaces": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexxx9a731234", - "properties": {"primary": true}}]}}}''' + body: 'b''b\''{"properties": {"networkProfile": {"networkInterfaces": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexxx9a731234", + "properties": {"primary": true}}]}}}\''''' headers: Accept: - application/json Content-Length: - - '290' + - '313' Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"virtualmachinexxx9a731234\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234\"\ ,\r\n \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\"\ - : \"eastus\",\r\n \"properties\": {\r\n \"vmId\": \"883a4b52-0091-48f3-a443-4ca2c729b516\"\ + : \"eastus\",\r\n \"properties\": {\r\n \"vmId\": \"38722ed0-8c2a-41c8-b86a-911c7b41900b\"\ ,\r\n \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_D2_v2\"\r\n\ \ },\r\n \"storageProfile\": {\r\n \"imageReference\": {\r\n \ \ \"publisher\": \"MicrosoftWindowsServer\",\r\n \"offer\": \"\ WindowsServer\",\r\n \"sku\": \"2016-Datacenter\",\r\n \"version\"\ - : \"latest\",\r\n \"exactVersion\": \"14393.3686.2005061700\"\r\n \ + : \"latest\",\r\n \"exactVersion\": \"14393.3930.2009041537\"\r\n \ \ },\r\n \"osDisk\": {\r\n \"osType\": \"Windows\",\r\n \ \ \"name\": \"myVMosdisk\",\r\n \"createOption\": \"FromImage\"\ ,\r\n \"caching\": \"ReadWrite\",\r\n \"managedDisk\": {\r\n\ \ \"storageAccountType\": \"Standard_LRS\",\r\n \"id\":\ - \ \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/myVMosdisk\"\ + \ \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/7PTFB2IKPAE54UU36J6DSPCSGPSHFKDJVCURHJJLQHIPQTMXI4Y3ZOQ46GYPODIS2E42PUF3SUQ/providers/Microsoft.Compute/disks/myVMosdisk\"\ \r\n },\r\n \"diskSizeGB\": 127\r\n },\r\n \"dataDisks\"\ - : [\r\n {\r\n \"lun\": 0,\r\n \"name\": \"virtualmachinexxx9a731234_disk2_85ee171b01894583b0bb14ce0bbbc0a3\"\ + : [\r\n {\r\n \"lun\": 0,\r\n \"name\": \"virtualmachinexxx9a731234_disk2_65a6f784860149d4bdad9d8b9e2a8aa5\"\ ,\r\n \"createOption\": \"Empty\",\r\n \"caching\": \"None\"\ ,\r\n \"managedDisk\": {\r\n \"storageAccountType\": \"\ - Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/virtualmachinexxx9a731234_disk2_85ee171b01894583b0bb14ce0bbbc0a3\"\ + Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/7PTFB2IKPAE54UU36J6DSPCSGPSHFKDJVCURHJJLQHIPQTMXI4Y3ZOQ46GYPODIS2E42PUF3SUQ/providers/Microsoft.Compute/disks/virtualmachinexxx9a731234_disk2_65a6f784860149d4bdad9d8b9e2a8aa5\"\ \r\n },\r\n \"diskSizeGB\": 1023,\r\n \"toBeDetached\"\ : false\r\n },\r\n {\r\n \"lun\": 1,\r\n \"\ - name\": \"virtualmachinexxx9a731234_disk3_9e84ad297eb046bb918518a475f01c5d\"\ + name\": \"virtualmachinexxx9a731234_disk3_3fcecb66e0b74060a3194c7f95df789f\"\ ,\r\n \"createOption\": \"Empty\",\r\n \"caching\": \"None\"\ ,\r\n \"managedDisk\": {\r\n \"storageAccountType\": \"\ - Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/virtualmachinexxx9a731234_disk3_9e84ad297eb046bb918518a475f01c5d\"\ + Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/7PTFB2IKPAE54UU36J6DSPCSGPSHFKDJVCURHJJLQHIPQTMXI4Y3ZOQ46GYPODIS2E42PUF3SUQ/providers/Microsoft.Compute/disks/virtualmachinexxx9a731234_disk3_3fcecb66e0b74060a3194c7f95df789f\"\ \r\n },\r\n \"diskSizeGB\": 1023,\r\n \"toBeDetached\"\ : false\r\n }\r\n ]\r\n },\r\n \"osProfile\": {\r\n \ \ \"computerName\": \"myVM\",\r\n \"adminUsername\": \"testuser\",\r\ \n \"windowsConfiguration\": {\r\n \"provisionVMAgent\": true,\r\ - \n \"enableAutomaticUpdates\": true\r\n },\r\n \"secrets\"\ - : [],\r\n \"allowExtensionOperations\": true,\r\n \"requireGuestProvisionSignal\"\ - : true\r\n },\r\n \"networkProfile\": {\"networkInterfaces\":[{\"id\"\ - :\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexxx9a731234\"\ + \n \"enableAutomaticUpdates\": true,\r\n \"patchSettings\":\ + \ {\r\n \"patchMode\": \"AutomaticByOS\"\r\n }\r\n },\r\ + \n \"secrets\": [],\r\n \"allowExtensionOperations\": true,\r\n\ + \ \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\"\ + : {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexxx9a731234\"\ ,\"properties\":{\"primary\":true}}]},\r\n \"provisioningState\": \"Updating\"\ \r\n }\r\n}" headers: azure-asyncnotification: Enabled - azure-asyncoperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2cea636c-dc56-4fc6-bad3-d1995713f711?api-version=2019-12-01 + azure-asyncoperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/8dc2fd3a-ae45-4608-a0b5-7b0c6957229c?api-version=2020-06-01 cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:54:03 GMT + date: Wed, 16 Sep 2020 05:49:00 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -3966,29 +4203,29 @@ interactions: transfer-encoding: chunked vary: Accept-Encoding x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/PutVM3Min;239,Microsoft.Compute/PutVM30Min;1198 - x-ms-ratelimit-remaining-subscription-writes: '1197' + x-ms-ratelimit-remaining-resource: Microsoft.Compute/PutVM3Min;239,Microsoft.Compute/PutVM30Min;1196 + x-ms-ratelimit-remaining-subscription-writes: '1196' status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7ptfb2ikpae54uu36j6dspcsgpshfkdjvcurhjjlqhipqtmxi4y3zoq46gypodis2e42puf3suq/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234?api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2cea636c-dc56-4fc6-bad3-d1995713f711?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/8dc2fd3a-ae45-4608-a0b5-7b0c6957229c?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-02T02:54:01.5557091+00:00\",\r\n \"\ - endTime\": \"2020-06-02T02:54:01.6963567+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"2cea636c-dc56-4fc6-bad3-d1995713f711\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T05:48:57.4163847+00:00\",\r\n \"\ + endTime\": \"2020-09-16T05:48:57.6038837+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"8dc2fd3a-ae45-4608-a0b5-7b0c6957229c\"\r\n}" headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:54:33 GMT + date: Wed, 16 Sep 2020 05:49:31 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -3996,59 +4233,60 @@ interactions: transfer-encoding: chunked vary: Accept-Encoding x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29957 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29951 status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/2cea636c-dc56-4fc6-bad3-d1995713f711?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/8dc2fd3a-ae45-4608-a0b5-7b0c6957229c?api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"virtualmachinexxx9a731234\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234\"\ ,\r\n \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\"\ - : \"eastus\",\r\n \"properties\": {\r\n \"vmId\": \"883a4b52-0091-48f3-a443-4ca2c729b516\"\ + : \"eastus\",\r\n \"properties\": {\r\n \"vmId\": \"38722ed0-8c2a-41c8-b86a-911c7b41900b\"\ ,\r\n \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_D2_v2\"\r\n\ \ },\r\n \"storageProfile\": {\r\n \"imageReference\": {\r\n \ \ \"publisher\": \"MicrosoftWindowsServer\",\r\n \"offer\": \"\ WindowsServer\",\r\n \"sku\": \"2016-Datacenter\",\r\n \"version\"\ - : \"latest\",\r\n \"exactVersion\": \"14393.3686.2005061700\"\r\n \ + : \"latest\",\r\n \"exactVersion\": \"14393.3930.2009041537\"\r\n \ \ },\r\n \"osDisk\": {\r\n \"osType\": \"Windows\",\r\n \ \ \"name\": \"myVMosdisk\",\r\n \"createOption\": \"FromImage\"\ ,\r\n \"caching\": \"ReadWrite\",\r\n \"managedDisk\": {\r\n\ \ \"storageAccountType\": \"Standard_LRS\",\r\n \"id\":\ - \ \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/myVMosdisk\"\ + \ \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/7PTFB2IKPAE54UU36J6DSPCSGPSHFKDJVCURHJJLQHIPQTMXI4Y3ZOQ46GYPODIS2E42PUF3SUQ/providers/Microsoft.Compute/disks/myVMosdisk\"\ \r\n },\r\n \"diskSizeGB\": 127\r\n },\r\n \"dataDisks\"\ - : [\r\n {\r\n \"lun\": 0,\r\n \"name\": \"virtualmachinexxx9a731234_disk2_85ee171b01894583b0bb14ce0bbbc0a3\"\ + : [\r\n {\r\n \"lun\": 0,\r\n \"name\": \"virtualmachinexxx9a731234_disk2_65a6f784860149d4bdad9d8b9e2a8aa5\"\ ,\r\n \"createOption\": \"Empty\",\r\n \"caching\": \"None\"\ ,\r\n \"managedDisk\": {\r\n \"storageAccountType\": \"\ - Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/virtualmachinexxx9a731234_disk2_85ee171b01894583b0bb14ce0bbbc0a3\"\ + Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/7PTFB2IKPAE54UU36J6DSPCSGPSHFKDJVCURHJJLQHIPQTMXI4Y3ZOQ46GYPODIS2E42PUF3SUQ/providers/Microsoft.Compute/disks/virtualmachinexxx9a731234_disk2_65a6f784860149d4bdad9d8b9e2a8aa5\"\ \r\n },\r\n \"diskSizeGB\": 1023,\r\n \"toBeDetached\"\ : false\r\n },\r\n {\r\n \"lun\": 1,\r\n \"\ - name\": \"virtualmachinexxx9a731234_disk3_9e84ad297eb046bb918518a475f01c5d\"\ + name\": \"virtualmachinexxx9a731234_disk3_3fcecb66e0b74060a3194c7f95df789f\"\ ,\r\n \"createOption\": \"Empty\",\r\n \"caching\": \"None\"\ ,\r\n \"managedDisk\": {\r\n \"storageAccountType\": \"\ - Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/virtualmachinexxx9a731234_disk3_9e84ad297eb046bb918518a475f01c5d\"\ + Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/7PTFB2IKPAE54UU36J6DSPCSGPSHFKDJVCURHJJLQHIPQTMXI4Y3ZOQ46GYPODIS2E42PUF3SUQ/providers/Microsoft.Compute/disks/virtualmachinexxx9a731234_disk3_3fcecb66e0b74060a3194c7f95df789f\"\ \r\n },\r\n \"diskSizeGB\": 1023,\r\n \"toBeDetached\"\ : false\r\n }\r\n ]\r\n },\r\n \"osProfile\": {\r\n \ \ \"computerName\": \"myVM\",\r\n \"adminUsername\": \"testuser\",\r\ \n \"windowsConfiguration\": {\r\n \"provisionVMAgent\": true,\r\ - \n \"enableAutomaticUpdates\": true\r\n },\r\n \"secrets\"\ - : [],\r\n \"allowExtensionOperations\": true,\r\n \"requireGuestProvisionSignal\"\ - : true\r\n },\r\n \"networkProfile\": {\"networkInterfaces\":[{\"id\"\ - :\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexxx9a731234\"\ + \n \"enableAutomaticUpdates\": true,\r\n \"patchSettings\":\ + \ {\r\n \"patchMode\": \"AutomaticByOS\"\r\n }\r\n },\r\ + \n \"secrets\": [],\r\n \"allowExtensionOperations\": true,\r\n\ + \ \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\"\ + : {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexxx9a731234\"\ ,\"properties\":{\"primary\":true}}]},\r\n \"provisioningState\": \"Succeeded\"\ \r\n }\r\n}" headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:54:34 GMT + date: Wed, 16 Sep 2020 05:49:31 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -4056,258 +4294,55 @@ interactions: transfer-encoding: chunked vary: Accept-Encoding x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/LowCostGet3Min;3996,Microsoft.Compute/LowCostGet30Min;31984 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/LowCostGet3Min;3993,Microsoft.Compute/LowCostGet30Min;31977 status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7ptfb2ikpae54uu36j6dspcsgpshfkdjvcurhjjlqhipqtmxi4y3zoq46gypodis2e42puf3suq/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234?api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/deallocate?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/deallocate?api-version=2020-06-01 response: body: string: '' headers: - azure-asyncoperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/8b19f12c-fbc0-4a96-a46c-546fb41d3863?api-version=2019-12-01 + azure-asyncoperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d9ee7c4f-b089-43bf-83e5-3cfc1fe655a1?api-version=2020-06-01 cache-control: no-cache content-length: '0' - date: Tue, 02 Jun 2020 02:54:34 GMT + date: Wed, 16 Sep 2020 05:49:32 GMT expires: '-1' - location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/8b19f12c-fbc0-4a96-a46c-546fb41d3863?monitor=true&api-version=2019-12-01 + location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d9ee7c4f-b089-43bf-83e5-3cfc1fe655a1?monitor=true&api-version=2020-06-01 pragma: no-cache server: Microsoft-HTTPAPI/2.0 strict-transport-security: max-age=31536000; includeSubDomains x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/DeleteVM3Min;239,Microsoft.Compute/DeleteVM30Min;1199 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/DeleteVM3Min;239,Microsoft.Compute/DeleteVM30Min;1198 x-ms-ratelimit-remaining-subscription-writes: '1198' status: code: 202 message: Accepted - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/deallocate?api-version=2019-12-01 -- request: - body: null - headers: - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/8b19f12c-fbc0-4a96-a46c-546fb41d3863?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-06-02T02:54:35.3527424+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"8b19f12c-fbc0-4a96-a46c-546fb41d3863\"\ - \r\n}" - headers: - cache-control: no-cache - content-encoding: gzip - content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:54:45 GMT - expires: '-1' - pragma: no-cache - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000; includeSubDomains - transfer-encoding: chunked - vary: Accept-Encoding - x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29956 - status: - code: 200 - message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/8b19f12c-fbc0-4a96-a46c-546fb41d3863?api-version=2019-12-01 -- request: - body: null - headers: - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/8b19f12c-fbc0-4a96-a46c-546fb41d3863?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-06-02T02:54:35.3527424+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"8b19f12c-fbc0-4a96-a46c-546fb41d3863\"\ - \r\n}" - headers: - cache-control: no-cache - content-encoding: gzip - content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:55:22 GMT - expires: '-1' - pragma: no-cache - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000; includeSubDomains - transfer-encoding: chunked - vary: Accept-Encoding - x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29952 - status: - code: 200 - message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/8b19f12c-fbc0-4a96-a46c-546fb41d3863?api-version=2019-12-01 -- request: - body: null - headers: - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/8b19f12c-fbc0-4a96-a46c-546fb41d3863?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-06-02T02:54:35.3527424+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"8b19f12c-fbc0-4a96-a46c-546fb41d3863\"\ - \r\n}" - headers: - cache-control: no-cache - content-encoding: gzip - content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:55:53 GMT - expires: '-1' - pragma: no-cache - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000; includeSubDomains - transfer-encoding: chunked - vary: Accept-Encoding - x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29949 - status: - code: 200 - message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/8b19f12c-fbc0-4a96-a46c-546fb41d3863?api-version=2019-12-01 -- request: - body: null - headers: - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/8b19f12c-fbc0-4a96-a46c-546fb41d3863?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-06-02T02:54:35.3527424+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"8b19f12c-fbc0-4a96-a46c-546fb41d3863\"\ - \r\n}" - headers: - cache-control: no-cache - content-encoding: gzip - content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:56:23 GMT - expires: '-1' - pragma: no-cache - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000; includeSubDomains - transfer-encoding: chunked - vary: Accept-Encoding - x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29946 - status: - code: 200 - message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/8b19f12c-fbc0-4a96-a46c-546fb41d3863?api-version=2019-12-01 -- request: - body: null - headers: - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/8b19f12c-fbc0-4a96-a46c-546fb41d3863?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-06-02T02:54:35.3527424+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"8b19f12c-fbc0-4a96-a46c-546fb41d3863\"\ - \r\n}" - headers: - cache-control: no-cache - content-encoding: gzip - content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:56:54 GMT - expires: '-1' - pragma: no-cache - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000; includeSubDomains - transfer-encoding: chunked - vary: Accept-Encoding - x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29943 - status: - code: 200 - message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/8b19f12c-fbc0-4a96-a46c-546fb41d3863?api-version=2019-12-01 -- request: - body: null - headers: - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/8b19f12c-fbc0-4a96-a46c-546fb41d3863?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-06-02T02:54:35.3527424+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"8b19f12c-fbc0-4a96-a46c-546fb41d3863\"\ - \r\n}" - headers: - cache-control: no-cache - content-encoding: gzip - content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:57:26 GMT - expires: '-1' - pragma: no-cache - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000; includeSubDomains - transfer-encoding: chunked - vary: Accept-Encoding - x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29940 - status: - code: 200 - message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/8b19f12c-fbc0-4a96-a46c-546fb41d3863?api-version=2019-12-01 -- request: - body: null - headers: - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/8b19f12c-fbc0-4a96-a46c-546fb41d3863?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-06-02T02:54:35.3527424+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"8b19f12c-fbc0-4a96-a46c-546fb41d3863\"\ - \r\n}" - headers: - cache-control: no-cache - content-encoding: gzip - content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:57:56 GMT - expires: '-1' - pragma: no-cache - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000; includeSubDomains - transfer-encoding: chunked - vary: Accept-Encoding - x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29938 - status: - code: 200 - message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/8b19f12c-fbc0-4a96-a46c-546fb41d3863?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7ptfb2ikpae54uu36j6dspcsgpshfkdjvcurhjjlqhipqtmxi4y3zoq46gypodis2e42puf3suq/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234/deallocate?api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/8b19f12c-fbc0-4a96-a46c-546fb41d3863?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d9ee7c4f-b089-43bf-83e5-3cfc1fe655a1?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-02T02:54:35.3527424+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"8b19f12c-fbc0-4a96-a46c-546fb41d3863\"\ + string: "{\r\n \"startTime\": \"2020-09-16T05:49:32.5103842+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"d9ee7c4f-b089-43bf-83e5-3cfc1fe655a1\"\ \r\n}" headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:58:28 GMT + date: Wed, 16 Sep 2020 05:49:42 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -4315,28 +4350,28 @@ interactions: transfer-encoding: chunked vary: Accept-Encoding x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29935 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29950 status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/8b19f12c-fbc0-4a96-a46c-546fb41d3863?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/d9ee7c4f-b089-43bf-83e5-3cfc1fe655a1?api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/8b19f12c-fbc0-4a96-a46c-546fb41d3863?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d9ee7c4f-b089-43bf-83e5-3cfc1fe655a1?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-02T02:54:35.3527424+00:00\",\r\n \"\ - endTime\": \"2020-06-02T02:58:52.6972745+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"8b19f12c-fbc0-4a96-a46c-546fb41d3863\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T05:49:32.5103842+00:00\",\r\n \"\ + endTime\": \"2020-09-16T05:49:56.5730389+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"d9ee7c4f-b089-43bf-83e5-3cfc1fe655a1\"\r\n}" headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:58:59 GMT + date: Wed, 16 Sep 2020 05:50:19 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -4344,80 +4379,80 @@ interactions: transfer-encoding: chunked vary: Accept-Encoding x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29932 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29947 status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/8b19f12c-fbc0-4a96-a46c-546fb41d3863?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/d9ee7c4f-b089-43bf-83e5-3cfc1fe655a1?api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/8b19f12c-fbc0-4a96-a46c-546fb41d3863?monitor=true&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d9ee7c4f-b089-43bf-83e5-3cfc1fe655a1?monitor=true&api-version=2020-06-01 response: body: string: '' headers: cache-control: no-cache content-length: '0' - date: Tue, 02 Jun 2020 02:58:59 GMT + date: Wed, 16 Sep 2020 05:50:19 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 strict-transport-security: max-age=31536000; includeSubDomains x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29931 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29946 status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/8b19f12c-fbc0-4a96-a46c-546fb41d3863?monitor=true&api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/d9ee7c4f-b089-43bf-83e5-3cfc1fe655a1?monitor=true&api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234?api-version=2020-06-01 response: body: string: '' headers: azure-asyncnotification: Enabled - azure-asyncoperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/6a7cbc58-5716-4d74-bcbe-05bf73842904?api-version=2019-12-01 + azure-asyncoperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7bcb942b-1fb2-40bb-8485-af21900e23b7?api-version=2020-06-01 cache-control: no-cache content-length: '0' - date: Tue, 02 Jun 2020 02:59:00 GMT + date: Wed, 16 Sep 2020 05:50:20 GMT expires: '-1' - location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/6a7cbc58-5716-4d74-bcbe-05bf73842904?monitor=true&api-version=2019-12-01 + location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7bcb942b-1fb2-40bb-8485-af21900e23b7?monitor=true&api-version=2020-06-01 pragma: no-cache server: Microsoft-HTTPAPI/2.0 strict-transport-security: max-age=31536000; includeSubDomains x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/DeleteVM3Min;239,Microsoft.Compute/DeleteVM30Min;1198 - x-ms-ratelimit-remaining-subscription-deletes: '14997' + x-ms-ratelimit-remaining-resource: Microsoft.Compute/DeleteVM3Min;238,Microsoft.Compute/DeleteVM30Min;1197 + x-ms-ratelimit-remaining-subscription-deletes: '14999' status: code: 202 message: Accepted - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7ptfb2ikpae54uu36j6dspcsgpshfkdjvcurhjjlqhipqtmxi4y3zoq46gypodis2e42puf3suq/providers/Microsoft.Compute/virtualMachines/virtualmachinexxx9a731234?api-version=2020-06-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/6a7cbc58-5716-4d74-bcbe-05bf73842904?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7bcb942b-1fb2-40bb-8485-af21900e23b7?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-02T02:59:00.2285502+00:00\",\r\n \"\ - endTime\": \"2020-06-02T02:59:00.6972745+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"6a7cbc58-5716-4d74-bcbe-05bf73842904\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T05:50:20.7765274+00:00\",\r\n \"\ + endTime\": \"2020-09-16T05:50:21.2608874+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"7bcb942b-1fb2-40bb-8485-af21900e23b7\"\r\n}" headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 02 Jun 2020 02:59:10 GMT + date: Wed, 16 Sep 2020 05:50:30 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -4425,9 +4460,9 @@ interactions: transfer-encoding: chunked vary: Accept-Encoding x-content-type-options: nosniff - x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29928 + x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29944 status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/6a7cbc58-5716-4d74-bcbe-05bf73842904?api-version=2019-12-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/providers/Microsoft.Compute/locations/eastus/operations/7bcb942b-1fb2-40bb-8485-af21900e23b7?api-version=2020-06-01 version: 1 diff --git a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_dedicated_hosts.test_dedicated_hosts.yaml b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_dedicated_hosts.test_dedicated_hosts.yaml index 0b17b68fa315..4ab32ca67f2e 100644 --- a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_dedicated_hosts.test_dedicated_hosts.yaml +++ b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_dedicated_hosts.test_dedicated_hosts.yaml @@ -14,12 +14,12 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/hostGroups/hostgroup640e162b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/hostGroups/hostgroup640e162b?api-version=2020-06-01 response: body: - string: "{\r\n \"name\": \"hostgroup640e162b\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/hostGroups/hostgroup640e162b\"\ + string: "{\r\n \"name\": \"hostgroup640e162b\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/YSAWDZGM635Y3L6LVH7JHQSHAA7QQ6D3CHNJ7KZ5QN2LJU66DXMZRGXIHZOPIQF42R4M5NBIFMT/providers/Microsoft.Compute/hostGroups/hostgroup640e162b\"\ ,\r\n \"location\": \"eastus\",\r\n \"tags\": {\r\n \"department\": \"\ finance\"\r\n },\r\n \"zones\": [\r\n \"1\"\r\n ],\r\n \"properties\"\ : {\r\n \"platformFaultDomainCount\": 3\r\n }\r\n}" @@ -27,11 +27,11 @@ interactions: cache-control: - no-cache content-length: - - '396' + - '409' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:04:37 GMT + - Wed, 16 Sep 2020 05:50:52 GMT expires: - '-1' pragma: @@ -46,7 +46,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/PutDeleteDedicatedHost3Min;119,Microsoft.Compute/PutDeleteDedicatedHost30Min;599 x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1195' status: code: 201 message: Created @@ -65,30 +65,30 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/hostGroups/hostgroup640e162b/hosts/hostname640e162b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/hostGroups/hostgroup640e162b/hosts/hostname640e162b?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"hostname640e162b\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/hostGroups/hostgroup640e162b/hosts/hostname640e162b\"\ ,\r\n \"location\": \"eastus\",\r\n \"tags\": {\r\n \"department\": \"\ HR\"\r\n },\r\n \"sku\": {\r\n \"name\": \"DSv3-Type1\"\r\n },\r\n \ \ \"properties\": {\r\n \"platformFaultDomain\": 1,\r\n \"autoReplaceOnFailure\"\ - : true,\r\n \"hostId\": \"6506599c-9e55-4339-90b5-6aefb4801133\",\r\n \ + : true,\r\n \"hostId\": \"c55dec91-7562-476c-b639-adadd0c102c5\",\r\n \ \ \"provisioningState\": \"Creating\"\r\n }\r\n}" headers: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/73f599af-fddf-451b-8921-433318109914?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f26589d7-7f8a-4311-8cb2-e4c95071c1fb?api-version=2020-06-01 cache-control: - no-cache content-length: - - '551' + - '564' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:04:40 GMT + - Wed, 16 Sep 2020 05:50:55 GMT expires: - '-1' pragma: @@ -103,7 +103,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/PutDeleteDedicatedHost3Min;118,Microsoft.Compute/PutDeleteDedicatedHost30Min;598 x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1194' status: code: 201 message: Created @@ -117,14 +117,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/73f599af-fddf-451b-8921-433318109914?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f26589d7-7f8a-4311-8cb2-e4c95071c1fb?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:04:40.0962842+00:00\",\r\n \"\ - endTime\": \"2020-05-18T15:04:40.7213244+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"73f599af-fddf-451b-8921-433318109914\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T05:50:54.4798305+00:00\",\r\n \"\ + endTime\": \"2020-09-16T05:50:54.7454404+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"f26589d7-7f8a-4311-8cb2-e4c95071c1fb\"\r\n}" headers: cache-control: - no-cache @@ -133,7 +133,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:05:10 GMT + - Wed, 16 Sep 2020 05:51:25 GMT expires: - '-1' pragma: @@ -150,7 +150,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14996,Microsoft.Compute/GetOperation30Min;29996 + - Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29942 status: code: 200 message: OK @@ -164,27 +164,27 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/hostGroups/hostgroup640e162b/hosts/hostname640e162b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/hostGroups/hostgroup640e162b/hosts/hostname640e162b?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"hostname640e162b\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/hostGroups/hostgroup640e162b/hosts/hostname640e162b\"\ ,\r\n \"location\": \"eastus\",\r\n \"tags\": {\r\n \"department\": \"\ HR\"\r\n },\r\n \"sku\": {\r\n \"name\": \"DSv3-Type1\"\r\n },\r\n \ \ \"properties\": {\r\n \"platformFaultDomain\": 1,\r\n \"autoReplaceOnFailure\"\ - : true,\r\n \"hostId\": \"6506599c-9e55-4339-90b5-6aefb4801133\",\r\n \ - \ \"virtualMachines\": [],\r\n \"provisioningTime\": \"2020-05-18T15:04:40.5494622+00:00\"\ + : true,\r\n \"hostId\": \"c55dec91-7562-476c-b639-adadd0c102c5\",\r\n \ + \ \"virtualMachines\": [],\r\n \"provisioningTime\": \"2020-09-16T05:50:54.7142145+00:00\"\ ,\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '642' + - '655' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:05:10 GMT + - Wed, 16 Sep 2020 05:51:26 GMT expires: - '-1' pragma: @@ -215,26 +215,48 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/hostGroups/hostgroup640e162b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/hostGroups/hostgroup640e162b?$expand=instanceView&api-version=2020-06-01 response: body: - string: "{\r\n \"name\": \"hostgroup640e162b\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/hostGroups/hostgroup640e162b\"\ + string: "{\r\n \"name\": \"hostgroup640e162b\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/YSAWDZGM635Y3L6LVH7JHQSHAA7QQ6D3CHNJ7KZ5QN2LJU66DXMZRGXIHZOPIQF42R4M5NBIFMT/providers/Microsoft.Compute/hostGroups/hostgroup640e162b\"\ ,\r\n \"location\": \"eastus\",\r\n \"tags\": {\r\n \"department\": \"\ finance\"\r\n },\r\n \"zones\": [\r\n \"1\"\r\n ],\r\n \"properties\"\ : {\r\n \"platformFaultDomainCount\": 3,\r\n \"hosts\": [\r\n {\r\ - \n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/hostGroups/HOSTGROUP640E162B/hosts/HOSTNAME640E162B\"\ - \r\n }\r\n ]\r\n }\r\n}" + \n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/YSAWDZGM635Y3L6LVH7JHQSHAA7QQ6D3CHNJ7KZ5QN2LJU66DXMZRGXIHZOPIQF42R4M5NBIFMT/providers/Microsoft.Compute/hostGroups/HOSTGROUP640E162B/hosts/HOSTNAME640E162B\"\ + \r\n }\r\n ],\r\n \"instanceView\": {\r\n \"hosts\": [\r\n\ + \ {\r\n \"name\": \"hostname640e162b\",\r\n \"assetId\"\ + : \"730236e2-3e7e-4d69-9eda-99ec3b9ccf0f\",\r\n \"availableCapacity\"\ + : {\r\n \"allocatableVMs\": [\r\n {\r\n \ + \ \"vmSize\": \"Standard_D2s_v3\",\r\n \"count\": 32\r\ + \n },\r\n {\r\n \"vmSize\": \"Standard_D4s_v3\"\ + ,\r\n \"count\": 17\r\n },\r\n {\r\ + \n \"vmSize\": \"Standard_D8s_v3\",\r\n \"count\"\ + : 8\r\n },\r\n {\r\n \"vmSize\":\ + \ \"Standard_D16s_v3\",\r\n \"count\": 4\r\n },\r\ + \n {\r\n \"vmSize\": \"Standard_D32s_v3\",\r\n\ + \ \"count\": 2\r\n },\r\n {\r\n \ + \ \"vmSize\": \"Standard_D48s_v3\",\r\n \"count\"\ + : 1\r\n },\r\n {\r\n \"vmSize\":\ + \ \"Standard_D64s_v3\",\r\n \"count\": 1\r\n }\r\ + \n ]\r\n },\r\n \"statuses\": [\r\n \ + \ {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n \ + \ \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning\ + \ succeeded\",\r\n \"time\": \"2020-09-16T05:50:54.7142145+00:00\"\ + \r\n },\r\n {\r\n \"code\": \"HealthState/available\"\ + ,\r\n \"level\": \"Info\",\r\n \"displayStatus\"\ + : \"Host available\"\r\n }\r\n ]\r\n }\r\n \ + \ ]\r\n }\r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '665' + - '2167' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:05:10 GMT + - Wed, 16 Sep 2020 05:51:26 GMT expires: - '-1' pragma: @@ -265,56 +287,46 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/hostGroups/hostgroup640e162b/hosts/hostname640e162b?$expand=instanceView&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/hostGroups/hostgroup640e162b/hosts/hostname640e162b?$expand=instanceView&api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"hostname640e162b\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/hostGroups/hostgroup640e162b/hosts/hostname640e162b\"\ ,\r\n \"location\": \"eastus\",\r\n \"tags\": {\r\n \"department\": \"\ HR\"\r\n },\r\n \"sku\": {\r\n \"name\": \"DSv3-Type1\"\r\n },\r\n \ \ \"properties\": {\r\n \"platformFaultDomain\": 1,\r\n \"autoReplaceOnFailure\"\ - : true,\r\n \"hostId\": \"6506599c-9e55-4339-90b5-6aefb4801133\",\r\n \ - \ \"virtualMachines\": [],\r\n \"provisioningTime\": \"2020-05-18T15:04:40.5494622+00:00\"\ + : true,\r\n \"hostId\": \"c55dec91-7562-476c-b639-adadd0c102c5\",\r\n \ + \ \"virtualMachines\": [],\r\n \"provisioningTime\": \"2020-09-16T05:50:54.7142145+00:00\"\ ,\r\n \"provisioningState\": \"Succeeded\",\r\n \"instanceView\": {\r\ - \n \"assetId\": \"3de5f88c-e0e4-406a-ac34-83209ef1568b\",\r\n \"\ + \n \"assetId\": \"730236e2-3e7e-4d69-9eda-99ec3b9ccf0f\",\r\n \"\ availableCapacity\": {\r\n \"allocatableVMs\": [\r\n {\r\n\ - \ \"vmSize\": \"Standard_D2hs_v3\",\r\n \"count\": 32\r\ - \n },\r\n {\r\n \"vmSize\": \"Standard_D2s_v3\"\ - ,\r\n \"count\": 32\r\n },\r\n {\r\n \ - \ \"vmSize\": \"Standard_D4hs_v3\",\r\n \"count\": 16\r\n \ - \ },\r\n {\r\n \"vmSize\": \"Standard_D4s_v3\"\ - ,\r\n \"count\": 16\r\n },\r\n {\r\n \ - \ \"vmSize\": \"Standard_D8hs_v3\",\r\n \"count\": 8\r\n \ - \ },\r\n {\r\n \"vmSize\": \"Standard_D8s_v3\",\r\ - \n \"count\": 8\r\n },\r\n {\r\n \"\ - vmSize\": \"Standard_D16s_v3\",\r\n \"count\": 4\r\n },\r\ - \n {\r\n \"vmSize\": \"Standard_D32-8s_v3\",\r\n \ - \ \"count\": 2\r\n },\r\n {\r\n \"vmSize\"\ - : \"Standard_D32-16s_v3\",\r\n \"count\": 2\r\n },\r\n\ - \ {\r\n \"vmSize\": \"Standard_D32s_v3\",\r\n \ - \ \"count\": 2\r\n },\r\n {\r\n \"vmSize\"\ - : \"Standard_D48s_v3\",\r\n \"count\": 1\r\n },\r\n \ - \ {\r\n \"vmSize\": \"Standard_D64-16s_v3\",\r\n \ + \ \"vmSize\": \"Standard_D2s_v3\",\r\n \"count\": 32\r\ + \n },\r\n {\r\n \"vmSize\": \"Standard_D4s_v3\"\ + ,\r\n \"count\": 17\r\n },\r\n {\r\n \ + \ \"vmSize\": \"Standard_D8s_v3\",\r\n \"count\": 8\r\n \ + \ },\r\n {\r\n \"vmSize\": \"Standard_D16s_v3\",\r\ + \n \"count\": 4\r\n },\r\n {\r\n \"\ + vmSize\": \"Standard_D32s_v3\",\r\n \"count\": 2\r\n },\r\ + \n {\r\n \"vmSize\": \"Standard_D48s_v3\",\r\n \ \ \"count\": 1\r\n },\r\n {\r\n \"vmSize\"\ - : \"Standard_D64-32s_v3\",\r\n \"count\": 1\r\n },\r\n\ - \ {\r\n \"vmSize\": \"Standard_D64s_v3\",\r\n \ - \ \"count\": 1\r\n }\r\n ]\r\n },\r\n \"statuses\"\ - : [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\",\r\ - \n \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning\ - \ succeeded\",\r\n \"time\": \"2020-05-18T15:04:40.5494622+00:00\"\ - \r\n },\r\n {\r\n \"code\": \"HealthState/available\"\ - ,\r\n \"level\": \"Info\",\r\n \"displayStatus\": \"Host\ - \ available\"\r\n }\r\n ]\r\n }\r\n }\r\n}" + : \"Standard_D64s_v3\",\r\n \"count\": 1\r\n }\r\n \ + \ ]\r\n },\r\n \"statuses\": [\r\n {\r\n \"\ + code\": \"ProvisioningState/succeeded\",\r\n \"level\": \"Info\"\ + ,\r\n \"displayStatus\": \"Provisioning succeeded\",\r\n \ + \ \"time\": \"2020-09-16T05:50:54.7142145+00:00\"\r\n },\r\n \ + \ {\r\n \"code\": \"HealthState/available\",\r\n \"level\"\ + : \"Info\",\r\n \"displayStatus\": \"Host available\"\r\n \ + \ }\r\n ]\r\n }\r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '2517' + - '1859' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:05:10 GMT + - Wed, 16 Sep 2020 05:51:26 GMT expires: - '-1' pragma: @@ -350,12 +362,12 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/hostGroups/hostgroup640e162b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/hostGroups/hostgroup640e162b?api-version=2020-06-01 response: body: - string: "{\r\n \"name\": \"hostgroup640e162b\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/hostGroups/hostgroup640e162b\"\ + string: "{\r\n \"name\": \"hostgroup640e162b\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/YSAWDZGM635Y3L6LVH7JHQSHAA7QQ6D3CHNJ7KZ5QN2LJU66DXMZRGXIHZOPIQF42R4M5NBIFMT/providers/Microsoft.Compute/hostGroups/hostgroup640e162b\"\ ,\r\n \"location\": \"eastus\",\r\n \"tags\": {\r\n \"department\": \"\ finance\"\r\n },\r\n \"zones\": [\r\n \"1\"\r\n ],\r\n \"properties\"\ : {\r\n \"platformFaultDomainCount\": 3\r\n }\r\n}" @@ -363,11 +375,11 @@ interactions: cache-control: - no-cache content-length: - - '396' + - '409' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:05:12 GMT + - Wed, 16 Sep 2020 05:51:28 GMT expires: - '-1' pragma: @@ -386,7 +398,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/PutDeleteDedicatedHost3Min;117,Microsoft.Compute/PutDeleteDedicatedHost30Min;597 x-ms-ratelimit-remaining-subscription-writes: - - '1196' + - '1193' status: code: 200 message: OK @@ -404,31 +416,31 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/hostGroups/hostgroup640e162b/hosts/hostname640e162b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/hostGroups/hostgroup640e162b/hosts/hostname640e162b?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"hostname640e162b\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/hostGroups/hostgroup640e162b/hosts/hostname640e162b\"\ ,\r\n \"location\": \"eastus\",\r\n \"tags\": {\r\n \"department\": \"\ HR\"\r\n },\r\n \"sku\": {\r\n \"name\": \"DSv3-Type1\"\r\n },\r\n \ \ \"properties\": {\r\n \"platformFaultDomain\": 1,\r\n \"autoReplaceOnFailure\"\ - : true,\r\n \"hostId\": \"6506599c-9e55-4339-90b5-6aefb4801133\",\r\n \ - \ \"provisioningTime\": \"2020-05-18T15:04:40.5494622+00:00\",\r\n \"\ + : true,\r\n \"hostId\": \"c55dec91-7562-476c-b639-adadd0c102c5\",\r\n \ + \ \"provisioningTime\": \"2020-09-16T05:50:54.7142145+00:00\",\r\n \"\ provisioningState\": \"Updating\"\r\n }\r\n}" headers: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/96edac2c-137a-4400-a478-3b2b90906329?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/062cf369-1c21-4131-915e-d5629506b9a0?api-version=2020-06-01 cache-control: - no-cache content-length: - - '613' + - '626' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:05:14 GMT + - Wed, 16 Sep 2020 05:51:30 GMT expires: - '-1' pragma: @@ -447,7 +459,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/PutDeleteDedicatedHost3Min;116,Microsoft.Compute/PutDeleteDedicatedHost30Min;596 x-ms-ratelimit-remaining-subscription-writes: - - '1195' + - '1192' status: code: 200 message: OK @@ -461,23 +473,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/96edac2c-137a-4400-a478-3b2b90906329?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/062cf369-1c21-4131-915e-d5629506b9a0?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:05:13.8007071+00:00\",\r\n \"\ - endTime\": \"2020-05-18T15:05:13.8163453+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"96edac2c-137a-4400-a478-3b2b90906329\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T05:51:29.8238697+00:00\",\r\n \"\ + endTime\": \"2020-09-16T05:51:29.839473+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"062cf369-1c21-4131-915e-d5629506b9a0\"\r\n}" headers: cache-control: - no-cache content-length: - - '184' + - '183' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:05:44 GMT + - Wed, 16 Sep 2020 05:52:01 GMT expires: - '-1' pragma: @@ -494,7 +506,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14994,Microsoft.Compute/GetOperation30Min;29994 + - Microsoft.Compute/GetOperation3Min;14988,Microsoft.Compute/GetOperation30Min;29940 status: code: 200 message: OK @@ -508,27 +520,27 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/hostGroups/hostgroup640e162b/hosts/hostname640e162b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/hostGroups/hostgroup640e162b/hosts/hostname640e162b?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"hostname640e162b\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/hostGroups/hostgroup640e162b/hosts/hostname640e162b\"\ ,\r\n \"location\": \"eastus\",\r\n \"tags\": {\r\n \"department\": \"\ HR\"\r\n },\r\n \"sku\": {\r\n \"name\": \"DSv3-Type1\"\r\n },\r\n \ \ \"properties\": {\r\n \"platformFaultDomain\": 1,\r\n \"autoReplaceOnFailure\"\ - : true,\r\n \"hostId\": \"6506599c-9e55-4339-90b5-6aefb4801133\",\r\n \ - \ \"virtualMachines\": [],\r\n \"provisioningTime\": \"2020-05-18T15:04:40.5494622+00:00\"\ + : true,\r\n \"hostId\": \"c55dec91-7562-476c-b639-adadd0c102c5\",\r\n \ + \ \"virtualMachines\": [],\r\n \"provisioningTime\": \"2020-09-16T05:50:54.7142145+00:00\"\ ,\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '642' + - '655' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:05:44 GMT + - Wed, 16 Sep 2020 05:52:01 GMT expires: - '-1' pragma: @@ -561,9 +573,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/hostGroups/hostgroup640e162b/hosts/hostname640e162b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/hostGroups/hostgroup640e162b/hosts/hostname640e162b?api-version=2020-06-01 response: body: string: '' @@ -571,17 +583,17 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b60b6b7e-205c-4aa3-8ccb-d86a7c6c0726?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/eecf6317-8126-43dc-8a0e-735d6a7a3ea7?api-version=2020-06-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 18 May 2020 15:05:44 GMT + - Wed, 16 Sep 2020 05:52:02 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b60b6b7e-205c-4aa3-8ccb-d86a7c6c0726?monitor=true&api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/eecf6317-8126-43dc-8a0e-735d6a7a3ea7?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -594,7 +606,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/PutDeleteDedicatedHost3Min;115,Microsoft.Compute/PutDeleteDedicatedHost30Min;595 x-ms-ratelimit-remaining-subscription-deletes: - - '14998' + - '14994' status: code: 202 message: Accepted @@ -608,14 +620,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b60b6b7e-205c-4aa3-8ccb-d86a7c6c0726?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/eecf6317-8126-43dc-8a0e-735d6a7a3ea7?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:05:45.5197967+00:00\",\r\n \"\ - endTime\": \"2020-05-18T15:05:45.6604245+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"b60b6b7e-205c-4aa3-8ccb-d86a7c6c0726\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T05:52:02.7147205+00:00\",\r\n \"\ + endTime\": \"2020-09-16T05:52:02.8554662+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"eecf6317-8126-43dc-8a0e-735d6a7a3ea7\"\r\n}" headers: cache-control: - no-cache @@ -624,7 +636,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:06:15 GMT + - Wed, 16 Sep 2020 05:52:32 GMT expires: - '-1' pragma: @@ -641,7 +653,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14992,Microsoft.Compute/GetOperation30Min;29992 + - Microsoft.Compute/GetOperation3Min;14989,Microsoft.Compute/GetOperation30Min;29938 status: code: 200 message: OK @@ -657,9 +669,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/hostGroups/hostgroup640e162b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/hostGroups/hostgroup640e162b?api-version=2020-06-01 response: body: string: '' @@ -669,7 +681,7 @@ interactions: content-length: - '0' date: - - Mon, 18 May 2020 15:06:18 GMT + - Wed, 16 Sep 2020 05:52:37 GMT expires: - '-1' pragma: @@ -684,7 +696,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/PutDeleteDedicatedHost3Min;114,Microsoft.Compute/PutDeleteDedicatedHost30Min;594 x-ms-ratelimit-remaining-subscription-deletes: - - '14997' + - '14993' status: code: 200 message: OK diff --git a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_disks.test_compute_disk_encryption.yaml b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_disks.test_compute_disk_encryption.yaml index 911bbb74da75..e04b75df74c5 100644 --- a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_disks.test_compute_disk_encryption.yaml +++ b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_disks.test_compute_disk_encryption.yaml @@ -2,7 +2,7 @@ interactions: - request: body: 'b''{"location": "eastus", "properties": {"tenantId": "00000000-0000-0000-0000-000000000000", "sku": {"family": "A", "name": "standard"}, "accessPolicies": [{"tenantId": - "00000000-0000-0000-0000-000000000000", "objectId": "20d81029-94cd-4923-a766-994415ff73bd", + "00000000-0000-0000-0000-000000000000", "objectId": "123743cc-88ef-49ee-920e-13958fe5697d", "permissions": {"keys": ["encrypt", "decrypt", "wrapKey", "unwrapKey", "sign", "verify", "get", "list", "create", "update", "import", "delete", "backup", "restore", "recover", "purge"]}}], "enabledForDiskEncryption": true}}''' @@ -19,23 +19,23 @@ interactions: - application/json; charset=utf-8 User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-keyvault/2.2.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-keyvault/1.1.0 Azure-SDK-For-Python accept-language: - en-US method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.KeyVault/vaults/keyvaultxmm3d1e15ac?api-version=2019-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.KeyVault/vaults/keyvaultxmm3d1e15ac?api-version=2018-02-14 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.KeyVault/vaults/keyvaultxmm3d1e15ac","name":"keyvaultxmm3d1e15ac","type":"Microsoft.KeyVault/vaults","location":"eastus","tags":{},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"00000000-0000-0000-0000-000000000000","accessPolicies":[{"tenantId":"00000000-0000-0000-0000-000000000000","objectId":"20d81029-94cd-4923-a766-994415ff73bd","permissions":{"keys":["encrypt","decrypt","wrapKey","unwrapKey","sign","verify","get","list","create","update","import","delete","backup","restore","recover","purge"]}}],"enabledForDeployment":false,"enabledForDiskEncryption":true,"enableSoftDelete":true,"vaultUri":"https://keyvaultxmm3d1e15ac.vault.azure.net","provisioningState":"RegisteringDns"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.KeyVault/vaults/keyvaultxmm3d1e15ac","name":"keyvaultxmm3d1e15ac","type":"Microsoft.KeyVault/vaults","location":"eastus","tags":{},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"00000000-0000-0000-0000-000000000000","accessPolicies":[{"tenantId":"00000000-0000-0000-0000-000000000000","objectId":"123743cc-88ef-49ee-920e-13958fe5697d","permissions":{"keys":["encrypt","decrypt","wrapKey","unwrapKey","sign","verify","get","list","create","update","import","delete","backup","restore","recover","purge"]}}],"enabledForDeployment":false,"enabledForDiskEncryption":true,"vaultUri":"https://keyvaultxmm3d1e15ac.vault.azure.net","provisioningState":"RegisteringDns"}}' headers: cache-control: - no-cache content-length: - - '859' + - '850' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:11:30 GMT + - Thu, 17 Sep 2020 02:17:36 GMT expires: - '-1' pragma: @@ -53,7 +53,7 @@ interactions: x-content-type-options: - nosniff x-ms-keyvault-service-version: - - 1.1.0.280 + - 1.1.55.0 x-ms-ratelimit-remaining-subscription-writes: - '1199' x-powered-by: @@ -72,21 +72,21 @@ interactions: - keep-alive User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-keyvault/2.2.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-keyvault/1.1.0 Azure-SDK-For-Python method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.KeyVault/vaults/keyvaultxmm3d1e15ac?api-version=2019-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.KeyVault/vaults/keyvaultxmm3d1e15ac?api-version=2018-02-14 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.KeyVault/vaults/keyvaultxmm3d1e15ac","name":"keyvaultxmm3d1e15ac","type":"Microsoft.KeyVault/vaults","location":"eastus","tags":{},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"00000000-0000-0000-0000-000000000000","accessPolicies":[{"tenantId":"00000000-0000-0000-0000-000000000000","objectId":"20d81029-94cd-4923-a766-994415ff73bd","permissions":{"keys":["encrypt","decrypt","wrapKey","unwrapKey","sign","verify","get","list","create","update","import","delete","backup","restore","recover","purge"]}}],"enabledForDeployment":false,"enabledForDiskEncryption":true,"enableSoftDelete":true,"vaultUri":"https://keyvaultxmm3d1e15ac.vault.azure.net/","provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.KeyVault/vaults/keyvaultxmm3d1e15ac","name":"keyvaultxmm3d1e15ac","type":"Microsoft.KeyVault/vaults","location":"eastus","tags":{},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"00000000-0000-0000-0000-000000000000","accessPolicies":[{"tenantId":"00000000-0000-0000-0000-000000000000","objectId":"123743cc-88ef-49ee-920e-13958fe5697d","permissions":{"keys":["encrypt","decrypt","wrapKey","unwrapKey","sign","verify","get","list","create","update","import","delete","backup","restore","recover","purge"]}}],"enabledForDeployment":false,"enabledForDiskEncryption":true,"vaultUri":"https://keyvaultxmm3d1e15ac.vault.azure.net/","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache content-length: - - '855' + - '846' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:12:01 GMT + - Thu, 17 Sep 2020 02:18:08 GMT expires: - '-1' pragma: @@ -104,7 +104,7 @@ interactions: x-content-type-options: - nosniff x-ms-keyvault-service-version: - - 1.1.0.280 + - 1.1.55.0 x-powered-by: - ASP.NET status: @@ -122,11 +122,11 @@ interactions: Content-Length: - '0' Content-Type: - - application/json; charset=utf-8 + - application/json User-Agent: - - azsdk-python-keyvault-keys/4.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-keyvault-keys/4.2.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://keyvaultxmm3d1e15ac.vault.azure.net/keys/testkey/create?api-version=7.0 + uri: https://keyvaultxmm3d1e15ac.vault.azure.net/keys/testkey/create?api-version=7.1 response: body: string: '{"error":{"code":"Unauthorized","message":"Request is missing a Bearer @@ -139,13 +139,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:12:03 GMT + - Thu, 17 Sep 2020 02:18:10 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-IIS/10.0 strict-transport-security: - max-age=31536000;includeSubDomains www-authenticate: @@ -156,11 +154,11 @@ interactions: x-content-type-options: - nosniff x-ms-keyvault-network-info: - - conn_type=Ipv4;addr=212.180.204.1;act_addr_fam=InterNetwork; + - conn_type=Ipv4;addr=167.220.255.19;act_addr_fam=InterNetwork; x-ms-keyvault-region: - eastus x-ms-keyvault-service-version: - - 1.1.3.0 + - 1.1.60.0 x-powered-by: - ASP.NET status: @@ -178,29 +176,27 @@ interactions: Content-Length: - '67' Content-Type: - - application/json; charset=utf-8 + - application/json User-Agent: - - azsdk-python-keyvault-keys/4.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-keyvault-keys/4.2.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://keyvaultxmm3d1e15ac.vault.azure.net/keys/testkey/create?api-version=7.0 + uri: https://keyvaultxmm3d1e15ac.vault.azure.net/keys/testkey/create?api-version=7.1 response: body: - string: '{"key":{"kid":"https://keyvaultxmm3d1e15ac.vault.azure.net/keys/testkey/72c4f4b2d7044269ba0f120e69ed5a7e","kty":"RSA","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"p8yM0lngJZpSbTSoZVt7Vusy2sqJwjkS2kVY_ahvSuk5z_EVyCAn-8m_Nv_jHMygNFatkHgBa8rpwnqbQgJo_DH4qWOQcMDKPGkcxpiYNRW729FsJ5Wma69bTlcqHTqFQgD66vrSmUzInXhQhxgUBlM2M8ILgBZv5WkypKMe7mx7wm6zYSpuSCBEUFTpKVpclGFKafCiEqF8E9u-1a5pR0CbAVERQjNE1gCPP33IFN3Sp-JyPH0zzo3Hl9rj9CwH_xzxe_el6SOFF_XLlhewLLlxYKEo7zbOF77K1E4w4qMDHZzQaS_P9rH1amekVfZzrSBiAZykaMX2PQ1zdiHkRQ","e":"AQAB"},"attributes":{"enabled":true,"exp":2527401600,"created":1589865123,"updated":1589865123,"recoveryLevel":"Recoverable+Purgeable"}}' + string: '{"key":{"kid":"https://keyvaultxmm3d1e15ac.vault.azure.net/keys/testkey/5bcda5af0a164c3799bb3f744f302751","kty":"RSA","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"wlX-8epJOS6u8BLo2igkp5g9fsA-KcpwJmTlNdzRnjGOu8X0FhwPjqcU0aC76YHR7nCSgKghAg3jIimaL3s5wV1AvlfAhmTjZqtMm3MHlqAd_zRaqPIMmTm7v08S0NuuPriFTmyw3iWOEDRyaJq4MzVKVxdblMR3cgr8_npJckrWKSnrzxDVccD4sSBElJVhZQXfvB4AKIWlcS5Wj0ob2OkTqRRpI6ldsd0ZQ7cE7GnGj6d2RxqjxFX1dmVvN0W82PImlZ0VfXdeYXgXDNFeJLfL9canVS-9ui_NQxmWvrMXqBQ4mrm6sPgDURFynUHGYWaBOE3MbmnxzxS3mxb22Q","e":"AQAB"},"attributes":{"enabled":true,"exp":2527401600,"created":1600309092,"updated":1600309092,"recoveryLevel":"Purgeable","recoverableDays":0}}' headers: cache-control: - no-cache content-length: - - '678' + - '686' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:12:03 GMT + - Thu, 17 Sep 2020 02:18:11 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-IIS/10.0 strict-transport-security: - max-age=31536000;includeSubDomains x-aspnet-version: @@ -208,20 +204,20 @@ interactions: x-content-type-options: - nosniff x-ms-keyvault-network-info: - - conn_type=Ipv4;addr=212.180.204.1;act_addr_fam=InterNetwork; + - conn_type=Ipv4;addr=167.220.255.19;act_addr_fam=InterNetwork; x-ms-keyvault-region: - eastus x-ms-keyvault-service-version: - - 1.1.3.0 + - 1.1.60.0 x-powered-by: - ASP.NET status: code: 200 message: OK - request: - body: 'b''{"location": "eastus", "identity": {"type": "SystemAssigned"}, "properties": + body: 'b''b\''{"location": "eastus", "identity": {"type": "SystemAssigned"}, "properties": {"activeKey": {"sourceVault": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.KeyVault/vaults/keyvaultxmm3d1e15ac"}, - "keyUrl": "https://keyvaultxmm3d1e15ac.vault.azure.net/keys/testkey/72c4f4b2d7044269ba0f120e69ed5a7e"}}}''' + "keyUrl": "https://keyvaultxmm3d1e15ac.vault.azure.net/keys/testkey/5bcda5af0a164c3799bb3f744f302751"}}}\''''' headers: Accept: - application/json @@ -230,33 +226,35 @@ interactions: Connection: - keep-alive Content-Length: - - '406' + - '421' Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/diskEncryptionSets/diskencryptionset3d1e15ac?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/diskEncryptionSets/diskencryptionset3d1e15ac?api-version=2020-06-30 response: body: string: "{\r\n \"location\": \"eastus\",\r\n \"identity\": {\r\n \"type\"\ : \"SystemAssigned\"\r\n },\r\n \"properties\": {\r\n \"activeKey\":\ \ {\r\n \"sourceVault\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.KeyVault/vaults/keyvaultxmm3d1e15ac\"\ - \r\n },\r\n \"keyUrl\": \"https://keyvaultxmm3d1e15ac.vault.azure.net/keys/testkey/72c4f4b2d7044269ba0f120e69ed5a7e\"\ + \r\n },\r\n \"keyUrl\": \"https://keyvaultxmm3d1e15ac.vault.azure.net/keys/testkey/5bcda5af0a164c3799bb3f744f302751\"\ \r\n },\r\n \"provisioningState\": \"Updating\"\r\n }\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/aae2a5bf-1357-42aa-bac4-58f6980d1d31?api-version=2019-11-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/379e226e-3033-4bb3-939a-0f1e8415c820?api-version=2020-06-30 cache-control: - no-cache content-length: - - '515' + - '530' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:12:12 GMT + - Thu, 17 Sep 2020 02:18:23 GMT expires: - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/379e226e-3033-4bb3-939a-0f1e8415c820?monitor=true&api-version=2020-06-30 pragma: - no-cache server: @@ -271,8 +269,8 @@ interactions: x-ms-ratelimit-remaining-subscription-writes: - '1199' status: - code: 201 - message: Created + code: 202 + message: Accepted - request: body: null headers: @@ -283,31 +281,32 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/aae2a5bf-1357-42aa-bac4-58f6980d1d31?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/379e226e-3033-4bb3-939a-0f1e8415c820?api-version=2020-06-30 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T05:12:11.6910112+00:00\",\r\n \"\ - endTime\": \"2020-05-19T05:12:11.7691203+00:00\",\r\n \"status\": \"Succeeded\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:18:24.1074653+00:00\",\r\n \"\ + endTime\": \"2020-09-17T02:18:24.3105768+00:00\",\r\n \"status\": \"Succeeded\"\ ,\r\n \"properties\": {\r\n \"output\": {\"name\":\"diskencryptionset3d1e15ac\"\ ,\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/diskEncryptionSets/diskencryptionset3d1e15ac\"\ ,\"type\":\"Microsoft.Compute/diskEncryptionSets\",\"location\":\"eastus\"\ - ,\"identity\":{\"type\":\"SystemAssigned\",\"principalId\":\"1bb4974a-bd32-4f64-8ea6-1ae4de827798\"\ + ,\"identity\":{\"type\":\"SystemAssigned\",\"principalId\":\"41eb15cb-0542-4bcd-aaf1-fcd3bc2f18e2\"\ ,\"tenantId\":\"00000000-0000-0000-0000-000000000000\"},\"properties\":{\"\ activeKey\":{\"sourceVault\":{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.KeyVault/vaults/keyvaultxmm3d1e15ac\"\ - },\"keyUrl\":\"https://keyvaultxmm3d1e15ac.vault.azure.net/keys/testkey/72c4f4b2d7044269ba0f120e69ed5a7e\"\ - },\"provisioningState\":\"Succeeded\"}}\r\n },\r\n \"name\": \"aae2a5bf-1357-42aa-bac4-58f6980d1d31\"\ + },\"keyUrl\":\"https://keyvaultxmm3d1e15ac.vault.azure.net/keys/testkey/5bcda5af0a164c3799bb3f744f302751\"\ + },\"encryptionType\":\"EncryptionAtRestWithCustomerKey\",\"provisioningState\"\ + :\"Succeeded\"}}\r\n },\r\n \"name\": \"379e226e-3033-4bb3-939a-0f1e8415c820\"\ \r\n}" headers: cache-control: - no-cache content-length: - - '1044' + - '1125' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:12:42 GMT + - Thu, 17 Sep 2020 02:18:53 GMT expires: - '-1' pragma: @@ -324,7 +323,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49990,Microsoft.Compute/GetOperation30Min;399964 + - Microsoft.Compute/GetOperation3Min;49998,Microsoft.Compute/GetOperation30Min;399998 status: code: 200 message: OK @@ -338,29 +337,30 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/diskEncryptionSets/diskencryptionset3d1e15ac?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/diskEncryptionSets/diskencryptionset3d1e15ac?api-version=2020-06-30 response: body: string: "{\r\n \"name\": \"diskencryptionset3d1e15ac\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/diskEncryptionSets/diskencryptionset3d1e15ac\"\ ,\r\n \"type\": \"Microsoft.Compute/diskEncryptionSets\",\r\n \"location\"\ : \"eastus\",\r\n \"identity\": {\r\n \"type\": \"SystemAssigned\",\r\n\ - \ \"principalId\": \"1bb4974a-bd32-4f64-8ea6-1ae4de827798\",\r\n \"\ + \ \"principalId\": \"41eb15cb-0542-4bcd-aaf1-fcd3bc2f18e2\",\r\n \"\ tenantId\": \"00000000-0000-0000-0000-000000000000\"\r\n },\r\n \"properties\"\ : {\r\n \"activeKey\": {\r\n \"sourceVault\": {\r\n \"id\"\ : \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.KeyVault/vaults/keyvaultxmm3d1e15ac\"\ - \r\n },\r\n \"keyUrl\": \"https://keyvaultxmm3d1e15ac.vault.azure.net/keys/testkey/72c4f4b2d7044269ba0f120e69ed5a7e\"\ - \r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}" + \r\n },\r\n \"keyUrl\": \"https://keyvaultxmm3d1e15ac.vault.azure.net/keys/testkey/5bcda5af0a164c3799bb3f744f302751\"\ + \r\n },\r\n \"encryptionType\": \"EncryptionAtRestWithCustomerKey\"\ + ,\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '937' + - '1025' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:12:42 GMT + - Thu, 17 Sep 2020 02:18:54 GMT expires: - '-1' pragma: @@ -377,7 +377,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;4993,Microsoft.Compute/LowCostGet30Min;39956 + - Microsoft.Compute/LowCostGet3Min;4997,Microsoft.Compute/LowCostGet30Min;39997 status: code: 200 message: OK @@ -391,29 +391,30 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/diskEncryptionSets/diskencryptionset3d1e15ac?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/diskEncryptionSets/diskencryptionset3d1e15ac?api-version=2020-06-30 response: body: string: "{\r\n \"name\": \"diskencryptionset3d1e15ac\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/diskEncryptionSets/diskencryptionset3d1e15ac\"\ ,\r\n \"type\": \"Microsoft.Compute/diskEncryptionSets\",\r\n \"location\"\ : \"eastus\",\r\n \"identity\": {\r\n \"type\": \"SystemAssigned\",\r\n\ - \ \"principalId\": \"1bb4974a-bd32-4f64-8ea6-1ae4de827798\",\r\n \"\ + \ \"principalId\": \"41eb15cb-0542-4bcd-aaf1-fcd3bc2f18e2\",\r\n \"\ tenantId\": \"00000000-0000-0000-0000-000000000000\"\r\n },\r\n \"properties\"\ : {\r\n \"activeKey\": {\r\n \"sourceVault\": {\r\n \"id\"\ : \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.KeyVault/vaults/keyvaultxmm3d1e15ac\"\ - \r\n },\r\n \"keyUrl\": \"https://keyvaultxmm3d1e15ac.vault.azure.net/keys/testkey/72c4f4b2d7044269ba0f120e69ed5a7e\"\ - \r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}" + \r\n },\r\n \"keyUrl\": \"https://keyvaultxmm3d1e15ac.vault.azure.net/keys/testkey/5bcda5af0a164c3799bb3f744f302751\"\ + \r\n },\r\n \"encryptionType\": \"EncryptionAtRestWithCustomerKey\"\ + ,\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '937' + - '1025' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:12:42 GMT + - Thu, 17 Sep 2020 02:18:54 GMT expires: - '-1' pragma: @@ -430,14 +431,14 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;4992,Microsoft.Compute/LowCostGet30Min;39955 + - Microsoft.Compute/LowCostGet3Min;4996,Microsoft.Compute/LowCostGet30Min;39996 status: code: 200 message: OK - request: - body: 'b''{"tags": {"department": "Development", "project": "Encryption"}, "properties": - {"activeKey": {"sourceVault": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.KeyVault/vaults/keyvaultxmm3d1e15ac"}, - "keyUrl": "https://keyvaultxmm3d1e15ac.vault.azure.net/keys/testkey/72c4f4b2d7044269ba0f120e69ed5a7e"}}}''' + body: 'b''b\''{"tags": {"department": "Development", "project": "Encryption"}, + "properties": {"activeKey": {"sourceVault": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.KeyVault/vaults/keyvaultxmm3d1e15ac"}, + "keyUrl": "https://keyvaultxmm3d1e15ac.vault.azure.net/keys/testkey/5bcda5af0a164c3799bb3f744f302751"}}}\''''' headers: Accept: - application/json @@ -446,39 +447,40 @@ interactions: Connection: - keep-alive Content-Length: - - '408' + - '423' Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/diskEncryptionSets/diskencryptionset3d1e15ac?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/diskEncryptionSets/diskencryptionset3d1e15ac?api-version=2020-06-30 response: body: string: "{\r\n \"name\": \"diskencryptionset3d1e15ac\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/diskEncryptionSets/diskencryptionset3d1e15ac\"\ ,\r\n \"type\": \"Microsoft.Compute/diskEncryptionSets\",\r\n \"location\"\ : \"eastus\",\r\n \"identity\": {\r\n \"type\": \"SystemAssigned\",\r\n\ - \ \"principalId\": \"1bb4974a-bd32-4f64-8ea6-1ae4de827798\",\r\n \"\ + \ \"principalId\": \"41eb15cb-0542-4bcd-aaf1-fcd3bc2f18e2\",\r\n \"\ tenantId\": \"00000000-0000-0000-0000-000000000000\"\r\n },\r\n \"properties\"\ : {\r\n \"activeKey\": {\r\n \"sourceVault\": {\r\n \"id\"\ : \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.KeyVault/vaults/keyvaultxmm3d1e15ac\"\ - \r\n },\r\n \"keyUrl\": \"https://keyvaultxmm3d1e15ac.vault.azure.net/keys/testkey/72c4f4b2d7044269ba0f120e69ed5a7e\"\ - \r\n },\r\n \"provisioningState\": \"Updating\"\r\n }\r\n}" + \r\n },\r\n \"keyUrl\": \"https://keyvaultxmm3d1e15ac.vault.azure.net/keys/testkey/5bcda5af0a164c3799bb3f744f302751\"\ + \r\n },\r\n \"encryptionType\": \"EncryptionAtRestWithCustomerKey\"\ + ,\r\n \"provisioningState\": \"Updating\"\r\n }\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/d8104b85-30b7-4910-8d32-734b959ab2d7?api-version=2019-11-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/e880ea8d-a7ed-47ad-bbcc-da3c3cff7a85?api-version=2020-06-30 cache-control: - no-cache content-length: - - '936' + - '1024' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:12:43 GMT + - Thu, 17 Sep 2020 02:18:57 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/d8104b85-30b7-4910-8d32-734b959ab2d7?monitor=true&api-version=2019-11-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/e880ea8d-a7ed-47ad-bbcc-da3c3cff7a85?monitor=true&api-version=2020-06-30 pragma: - no-cache server: @@ -503,32 +505,33 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/d8104b85-30b7-4910-8d32-734b959ab2d7?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/e880ea8d-a7ed-47ad-bbcc-da3c3cff7a85?api-version=2020-06-30 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T05:12:43.8323333+00:00\",\r\n \"\ - endTime\": \"2020-05-19T05:12:43.894862+00:00\",\r\n \"status\": \"Succeeded\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:18:57.6856998+00:00\",\r\n \"\ + endTime\": \"2020-09-17T02:18:57.7638215+00:00\",\r\n \"status\": \"Succeeded\"\ ,\r\n \"properties\": {\r\n \"output\": {\"name\":\"diskencryptionset3d1e15ac\"\ ,\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/diskEncryptionSets/diskencryptionset3d1e15ac\"\ ,\"type\":\"Microsoft.Compute/diskEncryptionSets\",\"location\":\"eastus\"\ ,\"tags\":{\"department\":\"Development\",\"project\":\"Encryption\"},\"identity\"\ - :{\"type\":\"SystemAssigned\",\"principalId\":\"1bb4974a-bd32-4f64-8ea6-1ae4de827798\"\ + :{\"type\":\"SystemAssigned\",\"principalId\":\"41eb15cb-0542-4bcd-aaf1-fcd3bc2f18e2\"\ ,\"tenantId\":\"00000000-0000-0000-0000-000000000000\"},\"properties\":{\"\ activeKey\":{\"sourceVault\":{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.KeyVault/vaults/keyvaultxmm3d1e15ac\"\ - },\"keyUrl\":\"https://keyvaultxmm3d1e15ac.vault.azure.net/keys/testkey/72c4f4b2d7044269ba0f120e69ed5a7e\"\ - },\"provisioningState\":\"Succeeded\"}}\r\n },\r\n \"name\": \"d8104b85-30b7-4910-8d32-734b959ab2d7\"\ + },\"keyUrl\":\"https://keyvaultxmm3d1e15ac.vault.azure.net/keys/testkey/5bcda5af0a164c3799bb3f744f302751\"\ + },\"encryptionType\":\"EncryptionAtRestWithCustomerKey\",\"provisioningState\"\ + :\"Succeeded\"}}\r\n },\r\n \"name\": \"e880ea8d-a7ed-47ad-bbcc-da3c3cff7a85\"\ \r\n}" headers: cache-control: - no-cache content-length: - - '1102' + - '1184' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:13:13 GMT + - Thu, 17 Sep 2020 02:19:28 GMT expires: - '-1' pragma: @@ -545,7 +548,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49991,Microsoft.Compute/GetOperation30Min;399962 + - Microsoft.Compute/GetOperation3Min;49996,Microsoft.Compute/GetOperation30Min;399996 status: code: 200 message: OK @@ -559,30 +562,31 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/diskEncryptionSets/diskencryptionset3d1e15ac?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/diskEncryptionSets/diskencryptionset3d1e15ac?api-version=2020-06-30 response: body: string: "{\r\n \"name\": \"diskencryptionset3d1e15ac\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/diskEncryptionSets/diskencryptionset3d1e15ac\"\ ,\r\n \"type\": \"Microsoft.Compute/diskEncryptionSets\",\r\n \"location\"\ : \"eastus\",\r\n \"tags\": {\r\n \"department\": \"Development\",\r\n\ \ \"project\": \"Encryption\"\r\n },\r\n \"identity\": {\r\n \"type\"\ - : \"SystemAssigned\",\r\n \"principalId\": \"1bb4974a-bd32-4f64-8ea6-1ae4de827798\"\ + : \"SystemAssigned\",\r\n \"principalId\": \"41eb15cb-0542-4bcd-aaf1-fcd3bc2f18e2\"\ ,\r\n \"tenantId\": \"00000000-0000-0000-0000-000000000000\"\r\n },\r\n\ \ \"properties\": {\r\n \"activeKey\": {\r\n \"sourceVault\": {\r\ \n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.KeyVault/vaults/keyvaultxmm3d1e15ac\"\ - \r\n },\r\n \"keyUrl\": \"https://keyvaultxmm3d1e15ac.vault.azure.net/keys/testkey/72c4f4b2d7044269ba0f120e69ed5a7e\"\ - \r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}" + \r\n },\r\n \"keyUrl\": \"https://keyvaultxmm3d1e15ac.vault.azure.net/keys/testkey/5bcda5af0a164c3799bb3f744f302751\"\ + \r\n },\r\n \"encryptionType\": \"EncryptionAtRestWithCustomerKey\"\ + ,\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '1019' + - '1107' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:13:13 GMT + - Thu, 17 Sep 2020 02:19:28 GMT expires: - '-1' pragma: @@ -599,7 +603,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;4989,Microsoft.Compute/LowCostGet30Min;39952 + - Microsoft.Compute/LowCostGet3Min;4993,Microsoft.Compute/LowCostGet30Min;39993 status: code: 200 message: OK @@ -607,7 +611,7 @@ interactions: body: null headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate Connection: @@ -615,25 +619,25 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/diskEncryptionSets/diskencryptionset3d1e15ac?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/diskEncryptionSets/diskencryptionset3d1e15ac?api-version=2020-06-30 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/34684464-03ef-4708-86eb-47d2b4cb80b6?api-version=2019-11-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/389bc998-5261-4a1e-b29f-2b2c628e8d6e?api-version=2020-06-30 cache-control: - no-cache content-length: - '0' date: - - Tue, 19 May 2020 05:13:15 GMT + - Thu, 17 Sep 2020 02:19:29 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/34684464-03ef-4708-86eb-47d2b4cb80b6?monitor=true&api-version=2019-11-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/389bc998-5261-4a1e-b29f-2b2c628e8d6e?monitor=true&api-version=2020-06-30 pragma: - no-cache server: @@ -660,14 +664,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/34684464-03ef-4708-86eb-47d2b4cb80b6?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/389bc998-5261-4a1e-b29f-2b2c628e8d6e?api-version=2020-06-30 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T05:13:14.9764033+00:00\",\r\n \"\ - endTime\": \"2020-05-19T05:13:15.0232815+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"34684464-03ef-4708-86eb-47d2b4cb80b6\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-17T02:19:29.2795104+00:00\",\r\n \"\ + endTime\": \"2020-09-17T02:19:29.3888967+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"389bc998-5261-4a1e-b29f-2b2c628e8d6e\"\r\n}" headers: cache-control: - no-cache @@ -676,7 +680,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:13:44 GMT + - Thu, 17 Sep 2020 02:19:59 GMT expires: - '-1' pragma: @@ -693,7 +697,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49992,Microsoft.Compute/GetOperation30Min;399960 + - Microsoft.Compute/GetOperation3Min;49994,Microsoft.Compute/GetOperation30Min;399994 status: code: 200 message: OK diff --git a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_disks.test_compute_disks.yaml b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_disks.test_compute_disks.yaml index 3b99f2d749b6..59692e6ce484 100644 --- a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_disks.test_compute_disks.yaml +++ b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_disks.test_compute_disks.yaml @@ -14,9 +14,9 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex77f61175?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex77f61175?api-version=2020-06-30 response: body: string: "{\r\n \"name\": \"disknamex77f61175\",\r\n \"location\": \"eastus\"\ @@ -25,7 +25,7 @@ interactions: : \"Updating\",\r\n \"isArmResource\": true\r\n }\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/3da83a12-2367-432c-b5db-ed8090969ea5?api-version=2019-11-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/f39d796a-3841-44cd-91fb-a32fe45c9561?api-version=2020-06-30 cache-control: - no-cache content-length: @@ -33,11 +33,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:13:55 GMT + - Wed, 16 Sep 2020 05:56:00 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/3da83a12-2367-432c-b5db-ed8090969ea5?monitor=true&api-version=2019-11-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/f39d796a-3841-44cd-91fb-a32fe45c9561?monitor=true&api-version=2020-06-30 pragma: - no-cache server: @@ -48,9 +48,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/CreateUpdateDisks3Min;999,Microsoft.Compute/CreateUpdateDisks30Min;7995 + - Microsoft.Compute/CreateUpdateDisks3Min;999,Microsoft.Compute/CreateUpdateDisks30Min;7997 x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1196' status: code: 202 message: Accepted @@ -64,13 +64,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/3da83a12-2367-432c-b5db-ed8090969ea5?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/f39d796a-3841-44cd-91fb-a32fe45c9561?api-version=2020-06-30 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T05:13:55.6356211+00:00\",\r\n \"\ - endTime\": \"2020-05-19T05:13:55.7449958+00:00\",\r\n \"status\": \"Succeeded\"\ + string: "{\r\n \"startTime\": \"2020-09-16T05:56:01.093005+00:00\",\r\n \"\ + endTime\": \"2020-09-16T05:56:01.2805511+00:00\",\r\n \"status\": \"Succeeded\"\ ,\r\n \"properties\": {\r\n \"output\": {\r\n \"name\": \"disknamex77f61175\"\ ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex77f61175\"\ ,\r\n \"type\": \"Microsoft.Compute/disks\",\r\n \"location\": \"eastus\"\ @@ -79,20 +79,20 @@ interactions: : \"Empty\"\r\n },\r\n \"diskSizeGB\": 200,\r\n \"diskIOPSReadWrite\"\ : 500,\r\n \"diskMBpsReadWrite\": 60,\r\n \"encryption\": {\r\n \ \ \"type\": \"EncryptionAtRestWithPlatformKey\"\r\n },\r\n \"timeCreated\"\ - : \"2020-05-19T05:13:55.6512278+00:00\",\r\n \"provisioningState\": \"\ - Succeeded\",\r\n \"diskState\": \"Unattached\",\r\n \"diskSizeBytes\"\ - : 214748364800,\r\n \"uniqueId\": \"2f985a14-b173-46ee-9109-85bc174b480f\"\ - \r\n }\r\n}\r\n },\r\n \"name\": \"3da83a12-2367-432c-b5db-ed8090969ea5\"\ + : \"2020-09-16T05:56:01.093005+00:00\",\r\n \"provisioningState\": \"Succeeded\"\ + ,\r\n \"diskState\": \"Unattached\",\r\n \"diskSizeBytes\": 214748364800,\r\ + \n \"uniqueId\": \"b1ee7e2d-ee1a-470b-bc1f-1eea3e25cd57\",\r\n \"networkAccessPolicy\"\ + : \"AllowAll\"\r\n }\r\n}\r\n },\r\n \"name\": \"f39d796a-3841-44cd-91fb-a32fe45c9561\"\ \r\n}" headers: cache-control: - no-cache content-length: - - '1046' + - '1109' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:13:57 GMT + - Wed, 16 Sep 2020 05:56:03 GMT expires: - '-1' pragma: @@ -109,7 +109,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49991,Microsoft.Compute/GetOperation30Min;399959 + - Microsoft.Compute/GetOperation3Min;49992,Microsoft.Compute/GetOperation30Min;399982 status: code: 200 message: OK @@ -123,9 +123,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex77f61175?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex77f61175?api-version=2020-06-30 response: body: string: "{\r\n \"name\": \"disknamex77f61175\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex77f61175\"\ @@ -135,19 +135,19 @@ interactions: : \"Empty\"\r\n },\r\n \"diskSizeGB\": 200,\r\n \"diskIOPSReadWrite\"\ : 500,\r\n \"diskMBpsReadWrite\": 60,\r\n \"encryption\": {\r\n \ \ \"type\": \"EncryptionAtRestWithPlatformKey\"\r\n },\r\n \"timeCreated\"\ - : \"2020-05-19T05:13:55.6512278+00:00\",\r\n \"provisioningState\": \"\ - Succeeded\",\r\n \"diskState\": \"Unattached\",\r\n \"diskSizeBytes\"\ - : 214748364800,\r\n \"uniqueId\": \"2f985a14-b173-46ee-9109-85bc174b480f\"\ - \r\n }\r\n}" + : \"2020-09-16T05:56:01.093005+00:00\",\r\n \"provisioningState\": \"Succeeded\"\ + ,\r\n \"diskState\": \"Unattached\",\r\n \"diskSizeBytes\": 214748364800,\r\ + \n \"uniqueId\": \"b1ee7e2d-ee1a-470b-bc1f-1eea3e25cd57\",\r\n \"networkAccessPolicy\"\ + : \"AllowAll\"\r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '821' + - '885' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:13:57 GMT + - Wed, 16 Sep 2020 05:56:03 GMT expires: - '-1' pragma: @@ -164,7 +164,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;4985,Microsoft.Compute/LowCostGet30Min;39947 + - Microsoft.Compute/LowCostGet3Min;4996,Microsoft.Compute/LowCostGet30Min;39975 status: code: 200 message: OK @@ -178,9 +178,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex77f61175?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex77f61175?api-version=2020-06-30 response: body: string: "{\r\n \"name\": \"disknamex77f61175\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex77f61175\"\ @@ -190,19 +190,19 @@ interactions: : \"Empty\"\r\n },\r\n \"diskSizeGB\": 200,\r\n \"diskIOPSReadWrite\"\ : 500,\r\n \"diskMBpsReadWrite\": 60,\r\n \"encryption\": {\r\n \ \ \"type\": \"EncryptionAtRestWithPlatformKey\"\r\n },\r\n \"timeCreated\"\ - : \"2020-05-19T05:13:55.6512278+00:00\",\r\n \"provisioningState\": \"\ - Succeeded\",\r\n \"diskState\": \"Unattached\",\r\n \"diskSizeBytes\"\ - : 214748364800,\r\n \"uniqueId\": \"2f985a14-b173-46ee-9109-85bc174b480f\"\ - \r\n }\r\n}" + : \"2020-09-16T05:56:01.093005+00:00\",\r\n \"provisioningState\": \"Succeeded\"\ + ,\r\n \"diskState\": \"Unattached\",\r\n \"diskSizeBytes\": 214748364800,\r\ + \n \"uniqueId\": \"b1ee7e2d-ee1a-470b-bc1f-1eea3e25cd57\",\r\n \"networkAccessPolicy\"\ + : \"AllowAll\"\r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '821' + - '885' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:13:57 GMT + - Wed, 16 Sep 2020 05:56:03 GMT expires: - '-1' pragma: @@ -219,7 +219,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;4984,Microsoft.Compute/LowCostGet30Min;39946 + - Microsoft.Compute/LowCostGet3Min;4995,Microsoft.Compute/LowCostGet30Min;39974 status: code: 200 message: OK @@ -237,9 +237,9 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex77f61175?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex77f61175?api-version=2020-06-30 response: body: string: "{\r\n \"name\": \"disknamex77f61175\",\r\n \"location\": \"eastus\"\ @@ -249,7 +249,7 @@ interactions: : \"Updating\",\r\n \"isArmResource\": true\r\n }\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/827bcb0d-6423-4c5b-bff7-0e5dfa5651ad?api-version=2019-11-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/f3b28e6a-8f7c-42bf-ab9a-260456035cc3?api-version=2020-06-30 cache-control: - no-cache content-length: @@ -257,11 +257,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:13:58 GMT + - Wed, 16 Sep 2020 05:56:04 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/827bcb0d-6423-4c5b-bff7-0e5dfa5651ad?monitor=true&api-version=2019-11-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/f3b28e6a-8f7c-42bf-ab9a-260456035cc3?monitor=true&api-version=2020-06-30 pragma: - no-cache server: @@ -272,9 +272,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/CreateUpdateDisks3Min;998,Microsoft.Compute/CreateUpdateDisks30Min;7994 + - Microsoft.Compute/CreateUpdateDisks3Min;998,Microsoft.Compute/CreateUpdateDisks30Min;7996 x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1195' status: code: 202 message: Accepted @@ -288,13 +288,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/827bcb0d-6423-4c5b-bff7-0e5dfa5651ad?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/f3b28e6a-8f7c-42bf-ab9a-260456035cc3?api-version=2020-06-30 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T05:13:58.7138566+00:00\",\r\n \"\ - endTime\": \"2020-05-19T05:13:58.8231922+00:00\",\r\n \"status\": \"Succeeded\"\ + string: "{\r\n \"startTime\": \"2020-09-16T05:56:04.7336899+00:00\",\r\n \"\ + endTime\": \"2020-09-16T05:56:04.9055643+00:00\",\r\n \"status\": \"Succeeded\"\ ,\r\n \"properties\": {\r\n \"output\": {\r\n \"name\": \"disknamex77f61175\"\ ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex77f61175\"\ ,\r\n \"type\": \"Microsoft.Compute/disks\",\r\n \"location\": \"eastus\"\ @@ -303,20 +303,20 @@ interactions: : \"Empty\"\r\n },\r\n \"diskSizeGB\": 200,\r\n \"diskIOPSReadWrite\"\ : 500,\r\n \"diskMBpsReadWrite\": 60,\r\n \"encryption\": {\r\n \ \ \"type\": \"EncryptionAtRestWithPlatformKey\"\r\n },\r\n \"timeCreated\"\ - : \"2020-05-19T05:13:55.6512278+00:00\",\r\n \"provisioningState\": \"\ - Succeeded\",\r\n \"diskState\": \"Unattached\",\r\n \"diskSizeBytes\"\ - : 214748364800,\r\n \"uniqueId\": \"2f985a14-b173-46ee-9109-85bc174b480f\"\ - \r\n }\r\n}\r\n },\r\n \"name\": \"827bcb0d-6423-4c5b-bff7-0e5dfa5651ad\"\ + : \"2020-09-16T05:56:01.093005+00:00\",\r\n \"provisioningState\": \"Succeeded\"\ + ,\r\n \"diskState\": \"Unattached\",\r\n \"diskSizeBytes\": 214748364800,\r\ + \n \"uniqueId\": \"b1ee7e2d-ee1a-470b-bc1f-1eea3e25cd57\",\r\n \"networkAccessPolicy\"\ + : \"AllowAll\"\r\n }\r\n}\r\n },\r\n \"name\": \"f3b28e6a-8f7c-42bf-ab9a-260456035cc3\"\ \r\n}" headers: cache-control: - no-cache content-length: - - '1046' + - '1110' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:14:00 GMT + - Wed, 16 Sep 2020 05:56:06 GMT expires: - '-1' pragma: @@ -333,7 +333,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49992,Microsoft.Compute/GetOperation30Min;399958 + - Microsoft.Compute/GetOperation3Min;49991,Microsoft.Compute/GetOperation30Min;399981 status: code: 200 message: OK @@ -347,9 +347,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex77f61175?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex77f61175?api-version=2020-06-30 response: body: string: "{\r\n \"name\": \"disknamex77f61175\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex77f61175\"\ @@ -359,19 +359,19 @@ interactions: : \"Empty\"\r\n },\r\n \"diskSizeGB\": 200,\r\n \"diskIOPSReadWrite\"\ : 500,\r\n \"diskMBpsReadWrite\": 60,\r\n \"encryption\": {\r\n \ \ \"type\": \"EncryptionAtRestWithPlatformKey\"\r\n },\r\n \"timeCreated\"\ - : \"2020-05-19T05:13:55.6512278+00:00\",\r\n \"provisioningState\": \"\ - Succeeded\",\r\n \"diskState\": \"Unattached\",\r\n \"diskSizeBytes\"\ - : 214748364800,\r\n \"uniqueId\": \"2f985a14-b173-46ee-9109-85bc174b480f\"\ - \r\n }\r\n}" + : \"2020-09-16T05:56:01.093005+00:00\",\r\n \"provisioningState\": \"Succeeded\"\ + ,\r\n \"diskState\": \"Unattached\",\r\n \"diskSizeBytes\": 214748364800,\r\ + \n \"uniqueId\": \"b1ee7e2d-ee1a-470b-bc1f-1eea3e25cd57\",\r\n \"networkAccessPolicy\"\ + : \"AllowAll\"\r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '821' + - '885' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:14:01 GMT + - Wed, 16 Sep 2020 05:56:07 GMT expires: - '-1' pragma: @@ -388,7 +388,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;4985,Microsoft.Compute/LowCostGet30Min;39945 + - Microsoft.Compute/LowCostGet3Min;4993,Microsoft.Compute/LowCostGet30Min;39972 status: code: 200 message: OK @@ -406,25 +406,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex77f61175/beginGetAccess?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex77f61175/beginGetAccess?api-version=2020-06-30 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/e3f51067-5be8-4690-ac7a-e5e49bb72c6c?api-version=2019-11-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/aaccce72-49ea-4d6f-ad28-ff5bfcc84a4a?api-version=2020-06-30 cache-control: - no-cache content-length: - '0' date: - - Tue, 19 May 2020 05:14:01 GMT + - Wed, 16 Sep 2020 05:56:07 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/e3f51067-5be8-4690-ac7a-e5e49bb72c6c?monitor=true&api-version=2019-11-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/aaccce72-49ea-4d6f-ad28-ff5bfcc84a4a?monitor=true&api-version=2020-06-30 pragma: - no-cache server: @@ -435,7 +435,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/HighCostDiskHydrate3Min;999,Microsoft.Compute/HighCostDiskHydrate30Min;7997 + - Microsoft.Compute/HighCostDiskHydrate3Min;998,Microsoft.Compute/HighCostDiskHydrate30Min;7997 x-ms-ratelimit-remaining-subscription-writes: - '1199' status: @@ -451,24 +451,24 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/e3f51067-5be8-4690-ac7a-e5e49bb72c6c?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/aaccce72-49ea-4d6f-ad28-ff5bfcc84a4a?api-version=2020-06-30 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T05:14:01.588864+00:00\",\r\n \"\ - endTime\": \"2020-05-19T05:14:01.8075816+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"properties\": {\r\n \"output\": {\r\n \"accessSAS\": \"https://md-hqnnqftxbnwp.blob.core.windows.net/jm1lwffgbjjt/abcd?sv=2017-04-17&sr=b&si=d9ecdc6e-9355-4dcf-8d19-fdf1166e3616&sig=n2sLU9nhulTUcuHf9G26QH28Ji68uP%2FKxtNZqTnIV1o%3D\"\ - \r\n}\r\n },\r\n \"name\": \"e3f51067-5be8-4690-ac7a-e5e49bb72c6c\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T05:56:07.8430804+00:00\",\r\n \"\ + endTime\": \"2020-09-16T05:56:08.2649178+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"properties\": {\r\n \"output\": {\r\n \"accessSAS\": \"https://md-nd23jr3mthmg.blob.core.windows.net/shrzfdcfwgvj/abcd?sv=2017-04-17&sr=b&si=e176b6d6-0845-4a2b-a902-e514cc10f490&sig=pgG24GHcZS0weh7CO6W%2B1ZVU3TgnbfsFHTNHNWzluFo%3D\"\ + \r\n}\r\n },\r\n \"name\": \"aaccce72-49ea-4d6f-ad28-ff5bfcc84a4a\"\r\n}" headers: cache-control: - no-cache content-length: - - '422' + - '423' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:14:30 GMT + - Wed, 16 Sep 2020 05:56:37 GMT expires: - '-1' pragma: @@ -485,7 +485,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49989,Microsoft.Compute/GetOperation30Min;399955 + - Microsoft.Compute/GetOperation3Min;49991,Microsoft.Compute/GetOperation30Min;399978 status: code: 200 message: OK @@ -499,12 +499,12 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/e3f51067-5be8-4690-ac7a-e5e49bb72c6c?monitor=true&api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/aaccce72-49ea-4d6f-ad28-ff5bfcc84a4a?monitor=true&api-version=2020-06-30 response: body: - string: "{\r\n \"accessSAS\": \"https://md-hqnnqftxbnwp.blob.core.windows.net/jm1lwffgbjjt/abcd?sv=2017-04-17&sr=b&si=d9ecdc6e-9355-4dcf-8d19-fdf1166e3616&sig=n2sLU9nhulTUcuHf9G26QH28Ji68uP%2FKxtNZqTnIV1o%3D\"\ + string: "{\r\n \"accessSAS\": \"https://md-nd23jr3mthmg.blob.core.windows.net/shrzfdcfwgvj/abcd?sv=2017-04-17&sr=b&si=e176b6d6-0845-4a2b-a902-e514cc10f490&sig=pgG24GHcZS0weh7CO6W%2B1ZVU3TgnbfsFHTNHNWzluFo%3D\"\ \r\n}" headers: cache-control: @@ -514,7 +514,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:14:31 GMT + - Wed, 16 Sep 2020 05:56:38 GMT expires: - '-1' pragma: @@ -531,7 +531,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49988,Microsoft.Compute/GetOperation30Min;399954 + - Microsoft.Compute/GetOperation3Min;49990,Microsoft.Compute/GetOperation30Min;399977 status: code: 200 message: OK @@ -547,25 +547,25 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex77f61175/endGetAccess?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex77f61175/endGetAccess?api-version=2020-06-30 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/58a1280f-234f-4774-93e2-4d37126432ad?api-version=2019-11-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/8f3d0309-1016-4031-80e7-289f2da54d22?api-version=2020-06-30 cache-control: - no-cache content-length: - '0' date: - - Tue, 19 May 2020 05:14:31 GMT + - Wed, 16 Sep 2020 05:56:39 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/58a1280f-234f-4774-93e2-4d37126432ad?monitor=true&api-version=2019-11-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/8f3d0309-1016-4031-80e7-289f2da54d22?monitor=true&api-version=2020-06-30 pragma: - no-cache server: @@ -592,14 +592,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/58a1280f-234f-4774-93e2-4d37126432ad?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/8f3d0309-1016-4031-80e7-289f2da54d22?api-version=2020-06-30 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T05:14:32.4338831+00:00\",\r\n \"\ - endTime\": \"2020-05-19T05:14:32.6838721+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"58a1280f-234f-4774-93e2-4d37126432ad\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T05:56:39.7165019+00:00\",\r\n \"\ + endTime\": \"2020-09-16T05:56:39.9195112+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"8f3d0309-1016-4031-80e7-289f2da54d22\"\r\n}" headers: cache-control: - no-cache @@ -608,7 +608,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:15:02 GMT + - Wed, 16 Sep 2020 05:57:09 GMT expires: - '-1' pragma: @@ -625,7 +625,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49986,Microsoft.Compute/GetOperation30Min;399974 + - Microsoft.Compute/GetOperation3Min;49991,Microsoft.Compute/GetOperation30Min;399975 status: code: 200 message: OK @@ -639,9 +639,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/58a1280f-234f-4774-93e2-4d37126432ad?monitor=true&api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/8f3d0309-1016-4031-80e7-289f2da54d22?monitor=true&api-version=2020-06-30 response: body: string: '' @@ -651,7 +651,7 @@ interactions: content-length: - '0' date: - - Tue, 19 May 2020 05:15:02 GMT + - Wed, 16 Sep 2020 05:57:09 GMT expires: - '-1' pragma: @@ -664,7 +664,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49985,Microsoft.Compute/GetOperation30Min;399973 + - Microsoft.Compute/GetOperation3Min;49990,Microsoft.Compute/GetOperation30Min;399974 status: code: 200 message: OK @@ -680,25 +680,25 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex77f61175?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex77f61175?api-version=2020-06-30 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/ea3707cc-9a64-41ec-b58f-20f8aee24a89?api-version=2019-11-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/b0a968af-0926-42d7-80f0-8d498125faf4?api-version=2020-06-30 cache-control: - no-cache content-length: - '0' date: - - Tue, 19 May 2020 05:15:03 GMT + - Wed, 16 Sep 2020 05:57:10 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/ea3707cc-9a64-41ec-b58f-20f8aee24a89?monitor=true&api-version=2019-11-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/b0a968af-0926-42d7-80f0-8d498125faf4?monitor=true&api-version=2020-06-30 pragma: - no-cache server: @@ -709,9 +709,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/DeleteDisks3Min;999,Microsoft.Compute/DeleteDisks30Min;7998 + - Microsoft.Compute/DeleteDisks3Min;999,Microsoft.Compute/DeleteDisks30Min;7995 x-ms-ratelimit-remaining-subscription-deletes: - - '14999' + - '14996' status: code: 202 message: Accepted @@ -725,14 +725,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/ea3707cc-9a64-41ec-b58f-20f8aee24a89?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/b0a968af-0926-42d7-80f0-8d498125faf4?api-version=2020-06-30 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T05:15:03.8098582+00:00\",\r\n \"\ - endTime\": \"2020-05-19T05:15:03.9973789+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"ea3707cc-9a64-41ec-b58f-20f8aee24a89\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T05:57:11.6224991+00:00\",\r\n \"\ + endTime\": \"2020-09-16T05:57:11.8725398+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"b0a968af-0926-42d7-80f0-8d498125faf4\"\r\n}" headers: cache-control: - no-cache @@ -741,7 +741,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:15:34 GMT + - Wed, 16 Sep 2020 05:57:42 GMT expires: - '-1' pragma: @@ -758,7 +758,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49985,Microsoft.Compute/GetOperation30Min;399971 + - Microsoft.Compute/GetOperation3Min;49989,Microsoft.Compute/GetOperation30Min;399972 status: code: 200 message: OK diff --git a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_disks.test_compute_disks_multi.yaml b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_disks.test_compute_disks_multi.yaml index e58f9040392c..1b82ccfb17e0 100644 --- a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_disks.test_compute_disks_multi.yaml +++ b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_disks.test_compute_disks_multi.yaml @@ -14,7 +14,7 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamexe97813ff?api-version=2019-03-01 response: @@ -25,7 +25,7 @@ interactions: : \"Updating\",\r\n \"isArmResource\": true\r\n }\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/aa4a5063-da15-4d40-9a85-73046dc8c966?api-version=2019-03-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/283243d1-2712-43d5-86f4-7dfec9fd3646?api-version=2019-03-01 cache-control: - no-cache content-length: @@ -33,11 +33,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:09:39 GMT + - Wed, 16 Sep 2020 05:52:54 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/aa4a5063-da15-4d40-9a85-73046dc8c966?monitor=true&api-version=2019-03-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/283243d1-2712-43d5-86f4-7dfec9fd3646?monitor=true&api-version=2019-03-01 pragma: - no-cache server: @@ -48,9 +48,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/CreateUpdateDisks3Min;999,Microsoft.Compute/CreateUpdateDisks30Min;7993 + - Microsoft.Compute/CreateUpdateDisks3Min;999,Microsoft.Compute/CreateUpdateDisks30Min;7999 x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1194' status: code: 202 message: Accepted @@ -64,33 +64,33 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/aa4a5063-da15-4d40-9a85-73046dc8c966?api-version=2019-03-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/283243d1-2712-43d5-86f4-7dfec9fd3646?api-version=2019-03-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T05:09:40.123148+00:00\",\r\n \"\ - endTime\": \"2020-05-19T05:09:40.2481494+00:00\",\r\n \"status\": \"Succeeded\"\ + string: "{\r\n \"startTime\": \"2020-09-16T05:52:55.4050202+00:00\",\r\n \"\ + endTime\": \"2020-09-16T05:52:55.5456423+00:00\",\r\n \"status\": \"Succeeded\"\ ,\r\n \"properties\": {\r\n \"output\": {\r\n \"name\": \"disknamexe97813ff\"\ ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamexe97813ff\"\ ,\r\n \"type\": \"Microsoft.Compute/disks\",\r\n \"location\": \"eastus\"\ ,\r\n \"sku\": {\r\n \"name\": \"Standard_LRS\",\r\n \"tier\": \"Standard\"\ \r\n },\r\n \"properties\": {\r\n \"creationData\": {\r\n \"createOption\"\ : \"Empty\"\r\n },\r\n \"diskSizeGB\": 200,\r\n \"diskIOPSReadWrite\"\ - : 500,\r\n \"diskMBpsReadWrite\": 60,\r\n \"timeCreated\": \"2020-05-19T05:09:40.123148+00:00\"\ + : 500,\r\n \"diskMBpsReadWrite\": 60,\r\n \"timeCreated\": \"2020-09-16T05:52:55.4050202+00:00\"\ ,\r\n \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\"\ - ,\r\n \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"1ff125df-157a-43f2-8ea0-4fedb0d5e331\"\ - \r\n }\r\n}\r\n },\r\n \"name\": \"aa4a5063-da15-4d40-9a85-73046dc8c966\"\ + ,\r\n \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"47fe52ef-0dd8-4fe1-a9e9-8858895b5603\"\ + \r\n }\r\n}\r\n },\r\n \"name\": \"283243d1-2712-43d5-86f4-7dfec9fd3646\"\ \r\n}" headers: cache-control: - no-cache content-length: - - '972' + - '993' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:09:41 GMT + - Wed, 16 Sep 2020 05:52:57 GMT expires: - '-1' pragma: @@ -107,7 +107,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49999,Microsoft.Compute/GetOperation30Min;399956 + - Microsoft.Compute/GetOperation3Min;49993,Microsoft.Compute/GetOperation30Min;399993 status: code: 200 message: OK @@ -121,7 +121,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamexe97813ff?api-version=2019-03-01 response: @@ -131,19 +131,19 @@ interactions: ,\r\n \"sku\": {\r\n \"name\": \"Standard_LRS\",\r\n \"tier\": \"Standard\"\ \r\n },\r\n \"properties\": {\r\n \"creationData\": {\r\n \"createOption\"\ : \"Empty\"\r\n },\r\n \"diskSizeGB\": 200,\r\n \"diskIOPSReadWrite\"\ - : 500,\r\n \"diskMBpsReadWrite\": 60,\r\n \"timeCreated\": \"2020-05-19T05:09:40.123148+00:00\"\ + : 500,\r\n \"diskMBpsReadWrite\": 60,\r\n \"timeCreated\": \"2020-09-16T05:52:55.4050202+00:00\"\ ,\r\n \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\"\ - ,\r\n \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"1ff125df-157a-43f2-8ea0-4fedb0d5e331\"\ + ,\r\n \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"47fe52ef-0dd8-4fe1-a9e9-8858895b5603\"\ \r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '748' + - '768' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:09:42 GMT + - Wed, 16 Sep 2020 05:52:57 GMT expires: - '-1' pragma: @@ -160,7 +160,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;4999,Microsoft.Compute/LowCostGet30Min;39952 + - Microsoft.Compute/LowCostGet3Min;4996,Microsoft.Compute/LowCostGet30Min;39984 status: code: 200 message: OK @@ -174,7 +174,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamexe97813ff?api-version=2019-03-01 response: @@ -184,19 +184,19 @@ interactions: ,\r\n \"sku\": {\r\n \"name\": \"Standard_LRS\",\r\n \"tier\": \"Standard\"\ \r\n },\r\n \"properties\": {\r\n \"creationData\": {\r\n \"createOption\"\ : \"Empty\"\r\n },\r\n \"diskSizeGB\": 200,\r\n \"diskIOPSReadWrite\"\ - : 500,\r\n \"diskMBpsReadWrite\": 60,\r\n \"timeCreated\": \"2020-05-19T05:09:40.123148+00:00\"\ + : 500,\r\n \"diskMBpsReadWrite\": 60,\r\n \"timeCreated\": \"2020-09-16T05:52:55.4050202+00:00\"\ ,\r\n \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\"\ - ,\r\n \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"1ff125df-157a-43f2-8ea0-4fedb0d5e331\"\ + ,\r\n \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"47fe52ef-0dd8-4fe1-a9e9-8858895b5603\"\ \r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '748' + - '768' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:09:42 GMT + - Wed, 16 Sep 2020 05:52:57 GMT expires: - '-1' pragma: @@ -213,7 +213,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;4998,Microsoft.Compute/LowCostGet30Min;39951 + - Microsoft.Compute/LowCostGet3Min;4995,Microsoft.Compute/LowCostGet30Min;39983 status: code: 200 message: OK @@ -231,7 +231,7 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PATCH uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamexe97813ff?api-version=2019-03-01 response: @@ -243,7 +243,7 @@ interactions: : \"Updating\",\r\n \"isArmResource\": true\r\n }\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/d943f224-25c2-46eb-b40c-b0c029747813?api-version=2019-03-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/68f0cacc-0ee8-447c-86c4-114d6ff76be9?api-version=2019-03-01 cache-control: - no-cache content-length: @@ -251,11 +251,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:09:42 GMT + - Wed, 16 Sep 2020 05:52:58 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/d943f224-25c2-46eb-b40c-b0c029747813?monitor=true&api-version=2019-03-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/68f0cacc-0ee8-447c-86c4-114d6ff76be9?monitor=true&api-version=2019-03-01 pragma: - no-cache server: @@ -266,9 +266,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/CreateUpdateDisks3Min;998,Microsoft.Compute/CreateUpdateDisks30Min;7992 + - Microsoft.Compute/CreateUpdateDisks3Min;998,Microsoft.Compute/CreateUpdateDisks30Min;7998 x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1193' status: code: 202 message: Accepted @@ -282,33 +282,33 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/d943f224-25c2-46eb-b40c-b0c029747813?api-version=2019-03-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/68f0cacc-0ee8-447c-86c4-114d6ff76be9?api-version=2019-03-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T05:09:43.2325219+00:00\",\r\n \"\ - endTime\": \"2020-05-19T05:09:43.3419069+00:00\",\r\n \"status\": \"Succeeded\"\ + string: "{\r\n \"startTime\": \"2020-09-16T05:52:59.0143495+00:00\",\r\n \"\ + endTime\": \"2020-09-16T05:52:59.1393793+00:00\",\r\n \"status\": \"Succeeded\"\ ,\r\n \"properties\": {\r\n \"output\": {\r\n \"name\": \"disknamexe97813ff\"\ ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamexe97813ff\"\ ,\r\n \"type\": \"Microsoft.Compute/disks\",\r\n \"location\": \"eastus\"\ ,\r\n \"sku\": {\r\n \"name\": \"Standard_LRS\",\r\n \"tier\": \"Standard\"\ \r\n },\r\n \"properties\": {\r\n \"creationData\": {\r\n \"createOption\"\ : \"Empty\"\r\n },\r\n \"diskSizeGB\": 200,\r\n \"diskIOPSReadWrite\"\ - : 500,\r\n \"diskMBpsReadWrite\": 60,\r\n \"timeCreated\": \"2020-05-19T05:09:40.123148+00:00\"\ + : 500,\r\n \"diskMBpsReadWrite\": 60,\r\n \"timeCreated\": \"2020-09-16T05:52:55.4050202+00:00\"\ ,\r\n \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\"\ - ,\r\n \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"1ff125df-157a-43f2-8ea0-4fedb0d5e331\"\ - \r\n }\r\n}\r\n },\r\n \"name\": \"d943f224-25c2-46eb-b40c-b0c029747813\"\ + ,\r\n \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"47fe52ef-0dd8-4fe1-a9e9-8858895b5603\"\ + \r\n }\r\n}\r\n },\r\n \"name\": \"68f0cacc-0ee8-447c-86c4-114d6ff76be9\"\ \r\n}" headers: cache-control: - no-cache content-length: - - '973' + - '993' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:09:44 GMT + - Wed, 16 Sep 2020 05:53:00 GMT expires: - '-1' pragma: @@ -325,7 +325,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49998,Microsoft.Compute/GetOperation30Min;399955 + - Microsoft.Compute/GetOperation3Min;49992,Microsoft.Compute/GetOperation30Min;399992 status: code: 200 message: OK @@ -339,7 +339,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamexe97813ff?api-version=2019-03-01 response: @@ -349,19 +349,19 @@ interactions: ,\r\n \"sku\": {\r\n \"name\": \"Standard_LRS\",\r\n \"tier\": \"Standard\"\ \r\n },\r\n \"properties\": {\r\n \"creationData\": {\r\n \"createOption\"\ : \"Empty\"\r\n },\r\n \"diskSizeGB\": 200,\r\n \"diskIOPSReadWrite\"\ - : 500,\r\n \"diskMBpsReadWrite\": 60,\r\n \"timeCreated\": \"2020-05-19T05:09:40.123148+00:00\"\ + : 500,\r\n \"diskMBpsReadWrite\": 60,\r\n \"timeCreated\": \"2020-09-16T05:52:55.4050202+00:00\"\ ,\r\n \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\"\ - ,\r\n \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"1ff125df-157a-43f2-8ea0-4fedb0d5e331\"\ + ,\r\n \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"47fe52ef-0dd8-4fe1-a9e9-8858895b5603\"\ \r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '748' + - '768' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:09:44 GMT + - Wed, 16 Sep 2020 05:53:00 GMT expires: - '-1' pragma: @@ -378,7 +378,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;4997,Microsoft.Compute/LowCostGet30Min;39950 + - Microsoft.Compute/LowCostGet3Min;4994,Microsoft.Compute/LowCostGet30Min;39982 status: code: 200 message: OK @@ -396,7 +396,7 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamexe97813ff/beginGetAccess?api-version=2019-03-01 response: @@ -404,17 +404,17 @@ interactions: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/5aa596ac-9a24-4c0f-8dde-81ec777f1334?api-version=2019-03-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/b6faff42-ef7c-4f20-bd27-304988032eeb?api-version=2019-03-01 cache-control: - no-cache content-length: - '0' date: - - Tue, 19 May 2020 05:09:45 GMT + - Wed, 16 Sep 2020 05:53:01 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/5aa596ac-9a24-4c0f-8dde-81ec777f1334?monitor=true&api-version=2019-03-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/b6faff42-ef7c-4f20-bd27-304988032eeb?monitor=true&api-version=2019-03-01 pragma: - no-cache server: @@ -425,9 +425,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/HighCostDiskHydrate3Min;999,Microsoft.Compute/HighCostDiskHydrate30Min;7995 + - Microsoft.Compute/HighCostDiskHydrate3Min;999,Microsoft.Compute/HighCostDiskHydrate30Min;7999 x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' status: code: 202 message: Accepted @@ -441,24 +441,24 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/5aa596ac-9a24-4c0f-8dde-81ec777f1334?api-version=2019-03-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/b6faff42-ef7c-4f20-bd27-304988032eeb?api-version=2019-03-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T05:09:46.0919453+00:00\",\r\n \"\ - endTime\": \"2020-05-19T05:09:46.3262965+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"properties\": {\r\n \"output\": {\r\n \"accessSAS\": \"https://md-hqnnqftxbnwp.blob.core.windows.net/r5rtrnjg3gzl/abcd?sv=2017-04-17&sr=b&si=9b42e2c0-182a-421e-b094-750244d60707&sig=UkboEfrPexnFaROcFxHsT3AqXviGIE7xV4vWXETRsbo%3D\"\ - \r\n}\r\n },\r\n \"name\": \"5aa596ac-9a24-4c0f-8dde-81ec777f1334\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T05:53:02.2643943+00:00\",\r\n \"\ + endTime\": \"2020-09-16T05:53:02.6081388+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"properties\": {\r\n \"output\": {\r\n \"accessSAS\": \"https://md-wpqq3wt43rfw.blob.core.windows.net/f4bmmlqkjhpf/abcd?sv=2017-04-17&sr=b&si=8a38c8a5-c866-4289-9294-13021691d603&sig=5XR1W8jjWjA5L9%2B4JQHutJew0o0cVDx0oE0mFyMFdI8%3D\"\ + \r\n}\r\n },\r\n \"name\": \"b6faff42-ef7c-4f20-bd27-304988032eeb\"\r\n}" headers: cache-control: - no-cache content-length: - - '421' + - '423' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:10:15 GMT + - Wed, 16 Sep 2020 05:53:32 GMT expires: - '-1' pragma: @@ -475,7 +475,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49995,Microsoft.Compute/GetOperation30Min;399972 + - Microsoft.Compute/GetOperation3Min;49989,Microsoft.Compute/GetOperation30Min;399989 status: code: 200 message: OK @@ -489,22 +489,22 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/5aa596ac-9a24-4c0f-8dde-81ec777f1334?monitor=true&api-version=2019-03-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/b6faff42-ef7c-4f20-bd27-304988032eeb?monitor=true&api-version=2019-03-01 response: body: - string: "{\r\n \"accessSAS\": \"https://md-hqnnqftxbnwp.blob.core.windows.net/r5rtrnjg3gzl/abcd?sv=2017-04-17&sr=b&si=9b42e2c0-182a-421e-b094-750244d60707&sig=UkboEfrPexnFaROcFxHsT3AqXviGIE7xV4vWXETRsbo%3D\"\ + string: "{\r\n \"accessSAS\": \"https://md-wpqq3wt43rfw.blob.core.windows.net/f4bmmlqkjhpf/abcd?sv=2017-04-17&sr=b&si=8a38c8a5-c866-4289-9294-13021691d603&sig=5XR1W8jjWjA5L9%2B4JQHutJew0o0cVDx0oE0mFyMFdI8%3D\"\ \r\n}" headers: cache-control: - no-cache content-length: - - '196' + - '198' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:10:15 GMT + - Wed, 16 Sep 2020 05:53:32 GMT expires: - '-1' pragma: @@ -521,7 +521,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49994,Microsoft.Compute/GetOperation30Min;399971 + - Microsoft.Compute/GetOperation3Min;49988,Microsoft.Compute/GetOperation30Min;399988 status: code: 200 message: OK @@ -537,7 +537,7 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamexe97813ff/endGetAccess?api-version=2019-03-01 response: @@ -545,17 +545,17 @@ interactions: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/73dc1a8f-062f-49f5-8548-7b2363120bc2?api-version=2019-03-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/cfabe7b4-9f7c-4b88-955f-d8b3bce95402?api-version=2019-03-01 cache-control: - no-cache content-length: - '0' date: - - Tue, 19 May 2020 05:10:16 GMT + - Wed, 16 Sep 2020 05:53:33 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/73dc1a8f-062f-49f5-8548-7b2363120bc2?monitor=true&api-version=2019-03-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/cfabe7b4-9f7c-4b88-955f-d8b3bce95402?monitor=true&api-version=2019-03-01 pragma: - no-cache server: @@ -568,7 +568,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/HighCostDiskHydrate3Min;998,Microsoft.Compute/HighCostDiskHydrate30Min;7998 x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1197' status: code: 202 message: Accepted @@ -582,23 +582,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/73dc1a8f-062f-49f5-8548-7b2363120bc2?api-version=2019-03-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/cfabe7b4-9f7c-4b88-955f-d8b3bce95402?api-version=2019-03-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T05:10:16.9827208+00:00\",\r\n \"\ - endTime\": \"2020-05-19T05:10:17.107716+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"73dc1a8f-062f-49f5-8548-7b2363120bc2\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T05:53:33.4207391+00:00\",\r\n \"\ + endTime\": \"2020-09-16T05:53:33.6238416+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"cfabe7b4-9f7c-4b88-955f-d8b3bce95402\"\r\n}" headers: cache-control: - no-cache content-length: - - '183' + - '184' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:10:47 GMT + - Wed, 16 Sep 2020 05:54:03 GMT expires: - '-1' pragma: @@ -615,7 +615,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49992,Microsoft.Compute/GetOperation30Min;399969 + - Microsoft.Compute/GetOperation3Min;49986,Microsoft.Compute/GetOperation30Min;399986 status: code: 200 message: OK @@ -629,9 +629,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/73dc1a8f-062f-49f5-8548-7b2363120bc2?monitor=true&api-version=2019-03-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/cfabe7b4-9f7c-4b88-955f-d8b3bce95402?monitor=true&api-version=2019-03-01 response: body: string: '' @@ -641,7 +641,7 @@ interactions: content-length: - '0' date: - - Tue, 19 May 2020 05:10:47 GMT + - Wed, 16 Sep 2020 05:54:04 GMT expires: - '-1' pragma: @@ -654,7 +654,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49991,Microsoft.Compute/GetOperation30Min;399968 + - Microsoft.Compute/GetOperation3Min;49985,Microsoft.Compute/GetOperation30Min;399985 status: code: 200 message: OK @@ -670,7 +670,7 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamexe97813ff?api-version=2019-03-01 response: @@ -678,17 +678,17 @@ interactions: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/36e3e3da-30da-41dc-9664-9231776a0ddf?api-version=2019-03-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/ba82a9c6-e2ed-4183-9d0d-292b147790c6?api-version=2019-03-01 cache-control: - no-cache content-length: - '0' date: - - Tue, 19 May 2020 05:10:48 GMT + - Wed, 16 Sep 2020 05:54:05 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/36e3e3da-30da-41dc-9664-9231776a0ddf?monitor=true&api-version=2019-03-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/ba82a9c6-e2ed-4183-9d0d-292b147790c6?monitor=true&api-version=2019-03-01 pragma: - no-cache server: @@ -699,9 +699,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/DeleteDisks3Min;999,Microsoft.Compute/DeleteDisks30Min;7997 + - Microsoft.Compute/DeleteDisks3Min;999,Microsoft.Compute/DeleteDisks30Min;7996 x-ms-ratelimit-remaining-subscription-deletes: - - '14999' + - '14997' status: code: 202 message: Accepted @@ -715,14 +715,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/36e3e3da-30da-41dc-9664-9231776a0ddf?api-version=2019-03-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/ba82a9c6-e2ed-4183-9d0d-292b147790c6?api-version=2019-03-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T05:10:48.3891471+00:00\",\r\n \"\ - endTime\": \"2020-05-19T05:10:48.5610208+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"36e3e3da-30da-41dc-9664-9231776a0ddf\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T05:54:05.3739412+00:00\",\r\n \"\ + endTime\": \"2020-09-16T05:54:05.6239389+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"ba82a9c6-e2ed-4183-9d0d-292b147790c6\"\r\n}" headers: cache-control: - no-cache @@ -731,7 +731,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:11:18 GMT + - Wed, 16 Sep 2020 05:54:35 GMT expires: - '-1' pragma: @@ -748,7 +748,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49989,Microsoft.Compute/GetOperation30Min;399966 + - Microsoft.Compute/GetOperation3Min;49986,Microsoft.Compute/GetOperation30Min;399983 status: code: 200 message: OK diff --git a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_disks.test_compute_shot.yaml b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_disks.test_compute_shot.yaml index 9bad2e0c5c51..fbd0779f3279 100644 --- a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_disks.test_compute_shot.yaml +++ b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_disks.test_compute_shot.yaml @@ -14,9 +14,9 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex66bb1115?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex66bb1115?api-version=2020-06-30 response: body: string: "{\r\n \"name\": \"disknamex66bb1115\",\r\n \"location\": \"eastus\"\ @@ -25,7 +25,7 @@ interactions: : \"Updating\",\r\n \"isArmResource\": true\r\n }\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/ad155083-a402-4407-8bcd-951c2bbf006f?api-version=2019-11-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/c2492636-4ddb-4190-91e0-dc99314c0edb?api-version=2020-06-30 cache-control: - no-cache content-length: @@ -33,11 +33,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:15:45 GMT + - Wed, 16 Sep 2020 05:57:57 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/ad155083-a402-4407-8bcd-951c2bbf006f?monitor=true&api-version=2019-11-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/c2492636-4ddb-4190-91e0-dc99314c0edb?monitor=true&api-version=2020-06-30 pragma: - no-cache server: @@ -50,7 +50,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/CreateUpdateDisks3Min;997,Microsoft.Compute/CreateUpdateDisks30Min;7995 x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1190' status: code: 202 message: Accepted @@ -64,13 +64,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/ad155083-a402-4407-8bcd-951c2bbf006f?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/c2492636-4ddb-4190-91e0-dc99314c0edb?api-version=2020-06-30 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T05:15:45.7498474+00:00\",\r\n \"\ - endTime\": \"2020-05-19T05:15:45.9217294+00:00\",\r\n \"status\": \"Succeeded\"\ + string: "{\r\n \"startTime\": \"2020-09-16T05:57:57.8120733+00:00\",\r\n \"\ + endTime\": \"2020-09-16T05:57:58.0152003+00:00\",\r\n \"status\": \"Succeeded\"\ ,\r\n \"properties\": {\r\n \"output\": {\r\n \"name\": \"disknamex66bb1115\"\ ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex66bb1115\"\ ,\r\n \"type\": \"Microsoft.Compute/disks\",\r\n \"location\": \"eastus\"\ @@ -79,20 +79,20 @@ interactions: : \"Empty\"\r\n },\r\n \"diskSizeGB\": 200,\r\n \"diskIOPSReadWrite\"\ : 500,\r\n \"diskMBpsReadWrite\": 60,\r\n \"encryption\": {\r\n \ \ \"type\": \"EncryptionAtRestWithPlatformKey\"\r\n },\r\n \"timeCreated\"\ - : \"2020-05-19T05:15:45.7498474+00:00\",\r\n \"provisioningState\": \"\ + : \"2020-09-16T05:57:57.8120733+00:00\",\r\n \"provisioningState\": \"\ Succeeded\",\r\n \"diskState\": \"Unattached\",\r\n \"diskSizeBytes\"\ - : 214748364800,\r\n \"uniqueId\": \"ab12f51d-9cdd-4d30-b672-a11698d33fc8\"\ - \r\n }\r\n}\r\n },\r\n \"name\": \"ad155083-a402-4407-8bcd-951c2bbf006f\"\ - \r\n}" + : 214748364800,\r\n \"uniqueId\": \"dba8c9f9-cfaa-4ebb-b839-9fbb606b66c6\"\ + ,\r\n \"networkAccessPolicy\": \"AllowAll\"\r\n }\r\n}\r\n },\r\n \"\ + name\": \"c2492636-4ddb-4190-91e0-dc99314c0edb\"\r\n}" headers: cache-control: - no-cache content-length: - - '1045' + - '1111' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:15:47 GMT + - Wed, 16 Sep 2020 05:58:00 GMT expires: - '-1' pragma: @@ -109,7 +109,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49984,Microsoft.Compute/GetOperation30Min;399970 + - Microsoft.Compute/GetOperation3Min;49988,Microsoft.Compute/GetOperation30Min;399971 status: code: 200 message: OK @@ -123,9 +123,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex66bb1115?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex66bb1115?api-version=2020-06-30 response: body: string: "{\r\n \"name\": \"disknamex66bb1115\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex66bb1115\"\ @@ -135,19 +135,19 @@ interactions: : \"Empty\"\r\n },\r\n \"diskSizeGB\": 200,\r\n \"diskIOPSReadWrite\"\ : 500,\r\n \"diskMBpsReadWrite\": 60,\r\n \"encryption\": {\r\n \ \ \"type\": \"EncryptionAtRestWithPlatformKey\"\r\n },\r\n \"timeCreated\"\ - : \"2020-05-19T05:15:45.7498474+00:00\",\r\n \"provisioningState\": \"\ + : \"2020-09-16T05:57:57.8120733+00:00\",\r\n \"provisioningState\": \"\ Succeeded\",\r\n \"diskState\": \"Unattached\",\r\n \"diskSizeBytes\"\ - : 214748364800,\r\n \"uniqueId\": \"ab12f51d-9cdd-4d30-b672-a11698d33fc8\"\ - \r\n }\r\n}" + : 214748364800,\r\n \"uniqueId\": \"dba8c9f9-cfaa-4ebb-b839-9fbb606b66c6\"\ + ,\r\n \"networkAccessPolicy\": \"AllowAll\"\r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '820' + - '886' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:15:47 GMT + - Wed, 16 Sep 2020 05:58:00 GMT expires: - '-1' pragma: @@ -164,13 +164,13 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;4983,Microsoft.Compute/LowCostGet30Min;39955 + - Microsoft.Compute/LowCostGet3Min;4989,Microsoft.Compute/LowCostGet30Min;39965 status: code: 200 message: OK - request: - body: 'b''{"location": "eastus", "properties": {"creationData": {"createOption": - "Copy", "sourceUri": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex66bb1115"}}}''' + body: 'b''b\''{"location": "eastus", "properties": {"creationData": {"createOption": + "Copy", "sourceUri": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex66bb1115"}}}\''''' headers: Accept: - application/json @@ -179,35 +179,35 @@ interactions: Connection: - keep-alive Content-Length: - - '265' + - '291' Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotx66bb1115?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotx66bb1115?api-version=2020-06-30 response: body: string: "{\r\n \"location\": \"eastus\",\r\n \"properties\": {\r\n \"creationData\"\ : {\r\n \"createOption\": \"Copy\",\r\n \"sourceUri\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex66bb1115\"\ - ,\r\n \"sourceUniqueId\": \"ab12f51d-9cdd-4d30-b672-a11698d33fc8\"\r\n\ + ,\r\n \"sourceUniqueId\": \"dba8c9f9-cfaa-4ebb-b839-9fbb606b66c6\"\r\n\ \ },\r\n \"provisioningState\": \"Updating\",\r\n \"isArmResource\"\ : true\r\n }\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/fb8a2917-0d9d-40ed-b4b1-0ee39b8a5032?api-version=2019-11-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/bb462486-90f3-4ee4-a324-5445396a67c3?api-version=2020-06-30 cache-control: - no-cache content-length: - - '436' + - '462' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:15:49 GMT + - Wed, 16 Sep 2020 05:58:05 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/fb8a2917-0d9d-40ed-b4b1-0ee39b8a5032?monitor=true&api-version=2019-11-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/bb462486-90f3-4ee4-a324-5445396a67c3?monitor=true&api-version=2020-06-30 pragma: - no-cache server: @@ -220,7 +220,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/HighCostSnapshotCreateHydrate3Min;999,Microsoft.Compute/HighCostSnapshotCreateHydrate30Min;7999 x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1189' status: code: 202 message: Accepted @@ -234,36 +234,36 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/fb8a2917-0d9d-40ed-b4b1-0ee39b8a5032?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/bb462486-90f3-4ee4-a324-5445396a67c3?api-version=2020-06-30 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T05:15:50.0311507+00:00\",\r\n \"\ - endTime\": \"2020-05-19T05:15:50.6561269+00:00\",\r\n \"status\": \"Succeeded\"\ + string: "{\r\n \"startTime\": \"2020-09-16T05:58:05.3277699+00:00\",\r\n \"\ + endTime\": \"2020-09-16T05:58:06.140247+00:00\",\r\n \"status\": \"Succeeded\"\ ,\r\n \"properties\": {\r\n \"output\": {\r\n \"name\": \"snapshotx66bb1115\"\ ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotx66bb1115\"\ ,\r\n \"type\": \"Microsoft.Compute/snapshots\",\r\n \"location\": \"eastus\"\ ,\r\n \"sku\": {\r\n \"name\": \"Standard_LRS\",\r\n \"tier\": \"Standard\"\ \r\n },\r\n \"properties\": {\r\n \"creationData\": {\r\n \"createOption\"\ : \"Copy\",\r\n \"sourceResourceId\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex66bb1115\"\ - ,\r\n \"sourceUniqueId\": \"ab12f51d-9cdd-4d30-b672-a11698d33fc8\"\r\n\ + ,\r\n \"sourceUniqueId\": \"dba8c9f9-cfaa-4ebb-b839-9fbb606b66c6\"\r\n\ \ },\r\n \"diskSizeGB\": 200,\r\n \"encryption\": {\r\n \"type\"\ : \"EncryptionAtRestWithPlatformKey\"\r\n },\r\n \"incremental\": false,\r\ - \n \"timeCreated\": \"2020-05-19T05:15:50.0311507+00:00\",\r\n \"provisioningState\"\ + \n \"timeCreated\": \"2020-09-16T05:58:05.3277699+00:00\",\r\n \"provisioningState\"\ : \"Succeeded\",\r\n \"diskState\": \"Unattached\",\r\n \"diskSizeBytes\"\ - : 214748364800,\r\n \"uniqueId\": \"3a900aca-0991-4e0b-a82b-24efcd5ff19e\"\ - \r\n }\r\n}\r\n },\r\n \"name\": \"fb8a2917-0d9d-40ed-b4b1-0ee39b8a5032\"\ - \r\n}" + : 214748364800,\r\n \"uniqueId\": \"b96e4720-d41b-4234-add5-dda3cd090896\"\ + ,\r\n \"networkAccessPolicy\": \"AllowAll\"\r\n }\r\n}\r\n },\r\n \"\ + name\": \"bb462486-90f3-4ee4-a324-5445396a67c3\"\r\n}" headers: cache-control: - no-cache content-length: - - '1282' + - '1373' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:15:51 GMT + - Wed, 16 Sep 2020 05:58:07 GMT expires: - '-1' pragma: @@ -280,7 +280,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49982,Microsoft.Compute/GetOperation30Min;399968 + - Microsoft.Compute/GetOperation3Min;49986,Microsoft.Compute/GetOperation30Min;399969 status: code: 200 message: OK @@ -294,9 +294,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotx66bb1115?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotx66bb1115?api-version=2020-06-30 response: body: string: "{\r\n \"name\": \"snapshotx66bb1115\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotx66bb1115\"\ @@ -304,22 +304,22 @@ interactions: ,\r\n \"sku\": {\r\n \"name\": \"Standard_LRS\",\r\n \"tier\": \"Standard\"\ \r\n },\r\n \"properties\": {\r\n \"creationData\": {\r\n \"createOption\"\ : \"Copy\",\r\n \"sourceResourceId\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex66bb1115\"\ - ,\r\n \"sourceUniqueId\": \"ab12f51d-9cdd-4d30-b672-a11698d33fc8\"\r\n\ + ,\r\n \"sourceUniqueId\": \"dba8c9f9-cfaa-4ebb-b839-9fbb606b66c6\"\r\n\ \ },\r\n \"diskSizeGB\": 200,\r\n \"encryption\": {\r\n \"type\"\ : \"EncryptionAtRestWithPlatformKey\"\r\n },\r\n \"incremental\": false,\r\ - \n \"timeCreated\": \"2020-05-19T05:15:50.0311507+00:00\",\r\n \"provisioningState\"\ + \n \"timeCreated\": \"2020-09-16T05:58:05.3277699+00:00\",\r\n \"provisioningState\"\ : \"Succeeded\",\r\n \"diskState\": \"Unattached\",\r\n \"diskSizeBytes\"\ - : 214748364800,\r\n \"uniqueId\": \"3a900aca-0991-4e0b-a82b-24efcd5ff19e\"\ - \r\n }\r\n}" + : 214748364800,\r\n \"uniqueId\": \"b96e4720-d41b-4234-add5-dda3cd090896\"\ + ,\r\n \"networkAccessPolicy\": \"AllowAll\"\r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '1057' + - '1149' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:15:51 GMT + - Wed, 16 Sep 2020 05:58:07 GMT expires: - '-1' pragma: @@ -336,15 +336,15 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;4981,Microsoft.Compute/LowCostGet30Min;39953 + - Microsoft.Compute/LowCostGet3Min;4987,Microsoft.Compute/LowCostGet30Min;39963 status: code: 200 message: OK - request: - body: 'b''{"location": "eastus", "properties": {"storageProfile": {"osDisk": {"snapshot": - {"id": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotx66bb1115"}, + body: 'b''b\''{"location": "eastus", "properties": {"storageProfile": {"osDisk": + {"snapshot": {"id": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotx66bb1115"}, "osType": "Linux", "osState": "Generalized"}, "zoneResilient": false}, "hyperVGeneration": - "V1"}}''' + "V1"}}\''''' headers: Accept: - application/json @@ -353,13 +353,13 @@ interactions: Connection: - keep-alive Content-Length: - - '360' + - '386' Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/images/imagex66bb1115?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/images/imagex66bb1115?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"imagex66bb1115\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/images/imagex66bb1115\"\ @@ -375,15 +375,15 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/ee8c9b05-c079-4708-9f30-9328dae45b31?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/81d84896-d439-47e8-a4be-daead0f6c139?api-version=2020-06-01 cache-control: - no-cache content-length: - - '848' + - '900' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:15:53 GMT + - Wed, 16 Sep 2020 05:58:11 GMT expires: - '-1' pragma: @@ -398,7 +398,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/CreateImages3Min;39,Microsoft.Compute/CreateImages30Min;199 x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1188' status: code: 201 message: Created @@ -412,23 +412,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/ee8c9b05-c079-4708-9f30-9328dae45b31?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/81d84896-d439-47e8-a4be-daead0f6c139?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T05:15:54.10673+00:00\",\r\n \"\ - endTime\": \"2020-05-19T05:15:59.2473825+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"ee8c9b05-c079-4708-9f30-9328dae45b31\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T05:58:10.2794719+00:00\",\r\n \"\ + endTime\": \"2020-09-16T05:58:15.4357507+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"81d84896-d439-47e8-a4be-daead0f6c139\"\r\n}" headers: cache-control: - no-cache content-length: - - '182' + - '184' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:16:24 GMT + - Wed, 16 Sep 2020 05:58:41 GMT expires: - '-1' pragma: @@ -445,7 +445,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14998,Microsoft.Compute/GetOperation30Min;29984 + - Microsoft.Compute/GetOperation3Min;14998,Microsoft.Compute/GetOperation30Min;29936 status: code: 200 message: OK @@ -459,9 +459,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/images/imagex66bb1115?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/images/imagex66bb1115?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"imagex66bb1115\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/images/imagex66bb1115\"\ @@ -478,11 +478,11 @@ interactions: cache-control: - no-cache content-length: - - '877' + - '929' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:16:24 GMT + - Wed, 16 Sep 2020 05:58:41 GMT expires: - '-1' pragma: @@ -499,7 +499,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetImages3Min;358,Microsoft.Compute/GetImages30Min;1796 + - Microsoft.Compute/GetImages3Min;358,Microsoft.Compute/GetImages30Min;1798 status: code: 200 message: OK @@ -513,9 +513,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotx66bb1115?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotx66bb1115?api-version=2020-06-30 response: body: string: "{\r\n \"name\": \"snapshotx66bb1115\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotx66bb1115\"\ @@ -523,22 +523,22 @@ interactions: ,\r\n \"sku\": {\r\n \"name\": \"Standard_LRS\",\r\n \"tier\": \"Standard\"\ \r\n },\r\n \"properties\": {\r\n \"creationData\": {\r\n \"createOption\"\ : \"Copy\",\r\n \"sourceResourceId\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex66bb1115\"\ - ,\r\n \"sourceUniqueId\": \"ab12f51d-9cdd-4d30-b672-a11698d33fc8\"\r\n\ + ,\r\n \"sourceUniqueId\": \"dba8c9f9-cfaa-4ebb-b839-9fbb606b66c6\"\r\n\ \ },\r\n \"diskSizeGB\": 200,\r\n \"encryption\": {\r\n \"type\"\ : \"EncryptionAtRestWithPlatformKey\"\r\n },\r\n \"incremental\": false,\r\ - \n \"timeCreated\": \"2020-05-19T05:15:50.0311507+00:00\",\r\n \"provisioningState\"\ + \n \"timeCreated\": \"2020-09-16T05:58:05.3277699+00:00\",\r\n \"provisioningState\"\ : \"Succeeded\",\r\n \"diskState\": \"Unattached\",\r\n \"diskSizeBytes\"\ - : 214748364800,\r\n \"uniqueId\": \"3a900aca-0991-4e0b-a82b-24efcd5ff19e\"\ - \r\n }\r\n}" + : 214748364800,\r\n \"uniqueId\": \"b96e4720-d41b-4234-add5-dda3cd090896\"\ + ,\r\n \"networkAccessPolicy\": \"AllowAll\"\r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '1057' + - '1149' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:16:25 GMT + - Wed, 16 Sep 2020 05:58:42 GMT expires: - '-1' pragma: @@ -555,7 +555,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;4980,Microsoft.Compute/LowCostGet30Min;39948 + - Microsoft.Compute/LowCostGet3Min;4982,Microsoft.Compute/LowCostGet30Min;39958 status: code: 200 message: OK @@ -569,9 +569,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/images/imagex66bb1115?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/images/imagex66bb1115?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"imagex66bb1115\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/images/imagex66bb1115\"\ @@ -588,11 +588,11 @@ interactions: cache-control: - no-cache content-length: - - '877' + - '929' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:16:25 GMT + - Wed, 16 Sep 2020 05:58:42 GMT expires: - '-1' pragma: @@ -609,7 +609,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetImages3Min;357,Microsoft.Compute/GetImages30Min;1795 + - Microsoft.Compute/GetImages3Min;357,Microsoft.Compute/GetImages30Min;1797 status: code: 200 message: OK @@ -627,9 +627,9 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/images/imagex66bb1115?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/images/imagex66bb1115?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"imagex66bb1115\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/images/imagex66bb1115\"\ @@ -646,15 +646,15 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/fc14d771-4363-4535-9d8a-5d4adcef6364?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/bf94164f-b4ef-4e66-8b9f-9b39e866a1d6?api-version=2020-06-01 cache-control: - no-cache content-length: - - '919' + - '971' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:16:31 GMT + - Wed, 16 Sep 2020 05:58:45 GMT expires: - '-1' pragma: @@ -673,7 +673,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/CreateImages3Min;38,Microsoft.Compute/CreateImages30Min;198 x-ms-ratelimit-remaining-subscription-writes: - - '1196' + - '1187' status: code: 200 message: OK @@ -687,23 +687,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/fc14d771-4363-4535-9d8a-5d4adcef6364?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/bf94164f-b4ef-4e66-8b9f-9b39e866a1d6?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T05:16:31.044427+00:00\",\r\n \"\ - endTime\": \"2020-05-19T05:16:36.2007516+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"fc14d771-4363-4535-9d8a-5d4adcef6364\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T05:58:44.7641679+00:00\",\r\n \"\ + endTime\": \"2020-09-16T05:58:49.9362192+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"bf94164f-b4ef-4e66-8b9f-9b39e866a1d6\"\r\n}" headers: cache-control: - no-cache content-length: - - '183' + - '184' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:17:01 GMT + - Wed, 16 Sep 2020 05:59:16 GMT expires: - '-1' pragma: @@ -720,7 +720,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14996,Microsoft.Compute/GetOperation30Min;29982 + - Microsoft.Compute/GetOperation3Min;14996,Microsoft.Compute/GetOperation30Min;29934 status: code: 200 message: OK @@ -734,9 +734,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/images/imagex66bb1115?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/images/imagex66bb1115?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"imagex66bb1115\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/images/imagex66bb1115\"\ @@ -753,11 +753,11 @@ interactions: cache-control: - no-cache content-length: - - '920' + - '972' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:17:01 GMT + - Wed, 16 Sep 2020 05:59:17 GMT expires: - '-1' pragma: @@ -774,7 +774,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetImages3Min;355,Microsoft.Compute/GetImages30Min;1793 + - Microsoft.Compute/GetImages3Min;355,Microsoft.Compute/GetImages30Min;1795 status: code: 200 message: OK @@ -792,33 +792,33 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotx66bb1115?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotx66bb1115?api-version=2020-06-30 response: body: string: "{\r\n \"location\": \"eastus\",\r\n \"sku\": {\r\n \"name\": \"\ Standard_LRS\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"properties\"\ : {\r\n \"creationData\": {\r\n \"createOption\": \"Copy\",\r\n \ \ \"sourceResourceId\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex66bb1115\"\ - ,\r\n \"sourceUniqueId\": \"ab12f51d-9cdd-4d30-b672-a11698d33fc8\"\r\n\ + ,\r\n \"sourceUniqueId\": \"dba8c9f9-cfaa-4ebb-b839-9fbb606b66c6\"\r\n\ \ },\r\n \"diskSizeGB\": 200,\r\n \"provisioningState\": \"Updating\"\ ,\r\n \"isArmResource\": true,\r\n \"faultDomain\": 0\r\n }\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/556ec505-e315-4e5a-98e9-adfe50f62768?api-version=2019-11-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/8f7fd731-5992-46cf-a385-586ebe418fc9?api-version=2020-06-30 cache-control: - no-cache content-length: - - '561' + - '587' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:17:02 GMT + - Wed, 16 Sep 2020 05:59:18 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/556ec505-e315-4e5a-98e9-adfe50f62768?monitor=true&api-version=2019-11-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/8f7fd731-5992-46cf-a385-586ebe418fc9?monitor=true&api-version=2020-06-30 pragma: - no-cache server: @@ -831,7 +831,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/CreateUpdateDisks3Min;998,Microsoft.Compute/CreateUpdateDisks30Min;7994 x-ms-ratelimit-remaining-subscription-writes: - - '1195' + - '1186' status: code: 202 message: Accepted @@ -845,36 +845,36 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/556ec505-e315-4e5a-98e9-adfe50f62768?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/8f7fd731-5992-46cf-a385-586ebe418fc9?api-version=2020-06-30 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T05:17:02.5351176+00:00\",\r\n \"\ - endTime\": \"2020-05-19T05:17:02.6601061+00:00\",\r\n \"status\": \"Succeeded\"\ + string: "{\r\n \"startTime\": \"2020-09-16T05:59:17.7967092+00:00\",\r\n \"\ + endTime\": \"2020-09-16T05:59:17.9060823+00:00\",\r\n \"status\": \"Succeeded\"\ ,\r\n \"properties\": {\r\n \"output\": {\r\n \"name\": \"snapshotx66bb1115\"\ ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotx66bb1115\"\ ,\r\n \"type\": \"Microsoft.Compute/snapshots\",\r\n \"location\": \"eastus\"\ ,\r\n \"sku\": {\r\n \"name\": \"Standard_LRS\",\r\n \"tier\": \"Standard\"\ \r\n },\r\n \"properties\": {\r\n \"creationData\": {\r\n \"createOption\"\ : \"Copy\",\r\n \"sourceResourceId\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex66bb1115\"\ - ,\r\n \"sourceUniqueId\": \"ab12f51d-9cdd-4d30-b672-a11698d33fc8\"\r\n\ + ,\r\n \"sourceUniqueId\": \"dba8c9f9-cfaa-4ebb-b839-9fbb606b66c6\"\r\n\ \ },\r\n \"diskSizeGB\": 200,\r\n \"encryption\": {\r\n \"type\"\ : \"EncryptionAtRestWithPlatformKey\"\r\n },\r\n \"incremental\": false,\r\ - \n \"timeCreated\": \"2020-05-19T05:15:50.0311507+00:00\",\r\n \"provisioningState\"\ + \n \"timeCreated\": \"2020-09-16T05:58:05.3277699+00:00\",\r\n \"provisioningState\"\ : \"Succeeded\",\r\n \"diskState\": \"Unattached\",\r\n \"diskSizeBytes\"\ - : 214748364800,\r\n \"uniqueId\": \"3a900aca-0991-4e0b-a82b-24efcd5ff19e\"\ - \r\n }\r\n}\r\n },\r\n \"name\": \"556ec505-e315-4e5a-98e9-adfe50f62768\"\ - \r\n}" + : 214748364800,\r\n \"uniqueId\": \"b96e4720-d41b-4234-add5-dda3cd090896\"\ + ,\r\n \"networkAccessPolicy\": \"AllowAll\"\r\n }\r\n}\r\n },\r\n \"\ + name\": \"8f7fd731-5992-46cf-a385-586ebe418fc9\"\r\n}" headers: cache-control: - no-cache content-length: - - '1282' + - '1374' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:17:04 GMT + - Wed, 16 Sep 2020 05:59:20 GMT expires: - '-1' pragma: @@ -891,7 +891,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49984,Microsoft.Compute/GetOperation30Min;399962 + - Microsoft.Compute/GetOperation3Min;49984,Microsoft.Compute/GetOperation30Min;399963 status: code: 200 message: OK @@ -905,9 +905,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotx66bb1115?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotx66bb1115?api-version=2020-06-30 response: body: string: "{\r\n \"name\": \"snapshotx66bb1115\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotx66bb1115\"\ @@ -915,22 +915,22 @@ interactions: ,\r\n \"sku\": {\r\n \"name\": \"Standard_LRS\",\r\n \"tier\": \"Standard\"\ \r\n },\r\n \"properties\": {\r\n \"creationData\": {\r\n \"createOption\"\ : \"Copy\",\r\n \"sourceResourceId\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex66bb1115\"\ - ,\r\n \"sourceUniqueId\": \"ab12f51d-9cdd-4d30-b672-a11698d33fc8\"\r\n\ + ,\r\n \"sourceUniqueId\": \"dba8c9f9-cfaa-4ebb-b839-9fbb606b66c6\"\r\n\ \ },\r\n \"diskSizeGB\": 200,\r\n \"encryption\": {\r\n \"type\"\ : \"EncryptionAtRestWithPlatformKey\"\r\n },\r\n \"incremental\": false,\r\ - \n \"timeCreated\": \"2020-05-19T05:15:50.0311507+00:00\",\r\n \"provisioningState\"\ + \n \"timeCreated\": \"2020-09-16T05:58:05.3277699+00:00\",\r\n \"provisioningState\"\ : \"Succeeded\",\r\n \"diskState\": \"Unattached\",\r\n \"diskSizeBytes\"\ - : 214748364800,\r\n \"uniqueId\": \"3a900aca-0991-4e0b-a82b-24efcd5ff19e\"\ - \r\n }\r\n}" + : 214748364800,\r\n \"uniqueId\": \"b96e4720-d41b-4234-add5-dda3cd090896\"\ + ,\r\n \"networkAccessPolicy\": \"AllowAll\"\r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '1057' + - '1149' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:17:04 GMT + - Wed, 16 Sep 2020 05:59:20 GMT expires: - '-1' pragma: @@ -947,7 +947,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;4987,Microsoft.Compute/LowCostGet30Min;39946 + - Microsoft.Compute/LowCostGet3Min;4987,Microsoft.Compute/LowCostGet30Min;39957 status: code: 200 message: OK @@ -965,25 +965,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotx66bb1115/beginGetAccess?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotx66bb1115/beginGetAccess?api-version=2020-06-30 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/be842e61-07bf-46ed-9e90-66502fbd510a?api-version=2019-11-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/aaf6dab3-9fac-42ed-95d0-e1a19237738c?api-version=2020-06-30 cache-control: - no-cache content-length: - '0' date: - - Tue, 19 May 2020 05:17:04 GMT + - Wed, 16 Sep 2020 05:59:21 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/be842e61-07bf-46ed-9e90-66502fbd510a?monitor=true&api-version=2019-11-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/aaf6dab3-9fac-42ed-95d0-e1a19237738c?monitor=true&api-version=2020-06-30 pragma: - no-cache server: @@ -996,7 +996,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/HighCostSnapshotCreateHydrate3Min;998,Microsoft.Compute/HighCostSnapshotCreateHydrate30Min;7998 x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' status: code: 202 message: Accepted @@ -1010,24 +1010,24 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/be842e61-07bf-46ed-9e90-66502fbd510a?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/aaf6dab3-9fac-42ed-95d0-e1a19237738c?api-version=2020-06-30 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T05:17:05.3945727+00:00\",\r\n \"\ - endTime\": \"2020-05-19T05:17:05.5664218+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"properties\": {\r\n \"output\": {\r\n \"accessSAS\": \"https://md-hqnnqftxbnwp.blob.core.windows.net/g33d03z5cfq1/abcd?sv=2017-04-17&sr=b&si=86296b76-b4a1-4735-9e00-cad538fe33cf&sig=JXqM8ni%2F8mQCzlMqxxDVNNqBjzpnLP1IQwYZcGZ5cgA%3D\"\ - \r\n}\r\n },\r\n \"name\": \"be842e61-07bf-46ed-9e90-66502fbd510a\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T05:59:21.1560946+00:00\",\r\n \"\ + endTime\": \"2020-09-16T05:59:21.2967149+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"properties\": {\r\n \"output\": {\r\n \"accessSAS\": \"https://md-s1mqplvgmqbw.blob.core.windows.net/v5d14mzkkjfx/abcd?sv=2017-04-17&sr=b&si=a0854f1d-54fd-4beb-a43a-5bf4b6929c75&sig=T9ypYNYOO2u3bfj9as5lYL3ST65TfxFFxCaEfenyAgk%3D\"\ + \r\n}\r\n },\r\n \"name\": \"aaf6dab3-9fac-42ed-95d0-e1a19237738c\"\r\n}" headers: cache-control: - no-cache content-length: - - '423' + - '421' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:17:35 GMT + - Wed, 16 Sep 2020 05:59:51 GMT expires: - '-1' pragma: @@ -1044,7 +1044,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49985,Microsoft.Compute/GetOperation30Min;399960 + - Microsoft.Compute/GetOperation3Min;49985,Microsoft.Compute/GetOperation30Min;399961 status: code: 200 message: OK @@ -1058,22 +1058,22 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/be842e61-07bf-46ed-9e90-66502fbd510a?monitor=true&api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/aaf6dab3-9fac-42ed-95d0-e1a19237738c?monitor=true&api-version=2020-06-30 response: body: - string: "{\r\n \"accessSAS\": \"https://md-hqnnqftxbnwp.blob.core.windows.net/g33d03z5cfq1/abcd?sv=2017-04-17&sr=b&si=86296b76-b4a1-4735-9e00-cad538fe33cf&sig=JXqM8ni%2F8mQCzlMqxxDVNNqBjzpnLP1IQwYZcGZ5cgA%3D\"\ + string: "{\r\n \"accessSAS\": \"https://md-s1mqplvgmqbw.blob.core.windows.net/v5d14mzkkjfx/abcd?sv=2017-04-17&sr=b&si=a0854f1d-54fd-4beb-a43a-5bf4b6929c75&sig=T9ypYNYOO2u3bfj9as5lYL3ST65TfxFFxCaEfenyAgk%3D\"\ \r\n}" headers: cache-control: - no-cache content-length: - - '198' + - '196' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:17:35 GMT + - Wed, 16 Sep 2020 05:59:51 GMT expires: - '-1' pragma: @@ -1090,7 +1090,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49984,Microsoft.Compute/GetOperation30Min;399959 + - Microsoft.Compute/GetOperation3Min;49984,Microsoft.Compute/GetOperation30Min;399960 status: code: 200 message: OK @@ -1106,25 +1106,25 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotx66bb1115/endGetAccess?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotx66bb1115/endGetAccess?api-version=2020-06-30 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/30abe13f-6c3f-4864-a7b3-18602faefb0d?api-version=2019-11-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/74d27be3-cf11-4109-b4d2-6f0bae6a41bc?api-version=2020-06-30 cache-control: - no-cache content-length: - '0' date: - - Tue, 19 May 2020 05:17:35 GMT + - Wed, 16 Sep 2020 05:59:52 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/30abe13f-6c3f-4864-a7b3-18602faefb0d?monitor=true&api-version=2019-11-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/74d27be3-cf11-4109-b4d2-6f0bae6a41bc?monitor=true&api-version=2020-06-30 pragma: - no-cache server: @@ -1137,7 +1137,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/HighCostSnapshotCreateHydrate3Min;997,Microsoft.Compute/HighCostSnapshotCreateHydrate30Min;7997 x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1197' status: code: 202 message: Accepted @@ -1151,14 +1151,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/30abe13f-6c3f-4864-a7b3-18602faefb0d?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/74d27be3-cf11-4109-b4d2-6f0bae6a41bc?api-version=2020-06-30 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T05:17:36.2384288+00:00\",\r\n \"\ - endTime\": \"2020-05-19T05:17:36.3946981+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"30abe13f-6c3f-4864-a7b3-18602faefb0d\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T05:59:52.2499204+00:00\",\r\n \"\ + endTime\": \"2020-09-16T05:59:52.3905508+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"74d27be3-cf11-4109-b4d2-6f0bae6a41bc\"\r\n}" headers: cache-control: - no-cache @@ -1167,7 +1167,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:18:05 GMT + - Wed, 16 Sep 2020 06:00:22 GMT expires: - '-1' pragma: @@ -1184,7 +1184,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49985,Microsoft.Compute/GetOperation30Min;399957 + - Microsoft.Compute/GetOperation3Min;49985,Microsoft.Compute/GetOperation30Min;399958 status: code: 200 message: OK @@ -1198,9 +1198,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/30abe13f-6c3f-4864-a7b3-18602faefb0d?monitor=true&api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/74d27be3-cf11-4109-b4d2-6f0bae6a41bc?monitor=true&api-version=2020-06-30 response: body: string: '' @@ -1210,7 +1210,7 @@ interactions: content-length: - '0' date: - - Tue, 19 May 2020 05:18:05 GMT + - Wed, 16 Sep 2020 06:00:22 GMT expires: - '-1' pragma: @@ -1223,7 +1223,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49984,Microsoft.Compute/GetOperation30Min;399956 + - Microsoft.Compute/GetOperation3Min;49984,Microsoft.Compute/GetOperation30Min;399957 status: code: 200 message: OK @@ -1239,9 +1239,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/images/imagex66bb1115?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/images/imagex66bb1115?api-version=2020-06-01 response: body: string: '' @@ -1249,17 +1249,17 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b1d63507-5de7-49ff-a6f1-17243ced6a7c?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4adb19b5-ceae-462e-b9e0-fbf205f7ba53?api-version=2020-06-01 cache-control: - no-cache content-length: - '0' date: - - Tue, 19 May 2020 05:18:06 GMT + - Wed, 16 Sep 2020 06:00:24 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b1d63507-5de7-49ff-a6f1-17243ced6a7c?monitor=true&api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4adb19b5-ceae-462e-b9e0-fbf205f7ba53?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -1272,7 +1272,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/DeleteImages3Min;119,Microsoft.Compute/DeleteImages30Min;599 x-ms-ratelimit-remaining-subscription-deletes: - - '14999' + - '14991' status: code: 202 message: Accepted @@ -1286,23 +1286,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b1d63507-5de7-49ff-a6f1-17243ced6a7c?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4adb19b5-ceae-462e-b9e0-fbf205f7ba53?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T05:18:07.6387809+00:00\",\r\n \"\ - endTime\": \"2020-05-19T05:18:12.732567+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"b1d63507-5de7-49ff-a6f1-17243ced6a7c\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T06:00:25.1712574+00:00\",\r\n \"\ + endTime\": \"2020-09-16T06:00:30.26506+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"4adb19b5-ceae-462e-b9e0-fbf205f7ba53\"\r\n}" headers: cache-control: - no-cache content-length: - - '183' + - '182' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:18:36 GMT + - Wed, 16 Sep 2020 06:00:55 GMT expires: - '-1' pragma: @@ -1319,7 +1319,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14994,Microsoft.Compute/GetOperation30Min;29980 + - Microsoft.Compute/GetOperation3Min;14994,Microsoft.Compute/GetOperation30Min;29932 status: code: 200 message: OK @@ -1335,25 +1335,25 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotx66bb1115?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotx66bb1115?api-version=2020-06-30 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/d91428ed-160f-46ed-bd8c-bb1788ce396a?api-version=2019-11-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/b8e0aca2-0b30-4527-b2b3-56b6be3d8c62?api-version=2020-06-30 cache-control: - no-cache content-length: - '0' date: - - Tue, 19 May 2020 05:18:38 GMT + - Wed, 16 Sep 2020 06:00:55 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/d91428ed-160f-46ed-bd8c-bb1788ce396a?monitor=true&api-version=2019-11-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/b8e0aca2-0b30-4527-b2b3-56b6be3d8c62?monitor=true&api-version=2020-06-30 pragma: - no-cache server: @@ -1364,9 +1364,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/DeleteDisks3Min;999,Microsoft.Compute/DeleteDisks30Min;7997 + - Microsoft.Compute/DeleteDisks3Min;999,Microsoft.Compute/DeleteDisks30Min;7994 x-ms-ratelimit-remaining-subscription-deletes: - - '14998' + - '14990' status: code: 202 message: Accepted @@ -1380,14 +1380,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/d91428ed-160f-46ed-bd8c-bb1788ce396a?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/b8e0aca2-0b30-4527-b2b3-56b6be3d8c62?api-version=2020-06-30 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T05:18:38.5457102+00:00\",\r\n \"\ - endTime\": \"2020-05-19T05:18:38.7019356+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"d91428ed-160f-46ed-bd8c-bb1788ce396a\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T06:00:56.4532326+00:00\",\r\n \"\ + endTime\": \"2020-09-16T06:00:56.6719821+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"b8e0aca2-0b30-4527-b2b3-56b6be3d8c62\"\r\n}" headers: cache-control: - no-cache @@ -1396,7 +1396,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 05:19:08 GMT + - Wed, 16 Sep 2020 06:01:26 GMT expires: - '-1' pragma: @@ -1413,7 +1413,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49987,Microsoft.Compute/GetOperation30Min;399952 + - Microsoft.Compute/GetOperation3Min;49987,Microsoft.Compute/GetOperation30Min;399953 status: code: 200 message: OK diff --git a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_galleries.test_compute_galleries.yaml b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_galleries.test_compute_galleries.yaml index 8d6b0552537c..42b2223cf616 100644 --- a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_galleries.test_compute_galleries.yaml +++ b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_galleries.test_compute_galleries.yaml @@ -14,9 +14,9 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/diskname10bb14a9?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/diskname10bb14a9?api-version=2020-06-30 response: body: string: "{\r\n \"name\": \"diskname10bb14a9\",\r\n \"location\": \"eastus\"\ @@ -25,7 +25,7 @@ interactions: : \"Updating\",\r\n \"isArmResource\": true\r\n }\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/c4830b08-2bbe-4e16-b71a-c8213c508c03?api-version=2019-11-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/565a5841-3a90-4920-a5c5-9f792bd6f462?api-version=2020-06-30 cache-control: - no-cache content-length: @@ -33,11 +33,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:13:53 GMT + - Wed, 16 Sep 2020 06:01:42 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/c4830b08-2bbe-4e16-b71a-c8213c508c03?monitor=true&api-version=2019-11-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/565a5841-3a90-4920-a5c5-9f792bd6f462?monitor=true&api-version=2020-06-30 pragma: - no-cache server: @@ -50,7 +50,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/CreateUpdateDisks3Min;998,Microsoft.Compute/CreateUpdateDisks30Min;7993 x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1197' status: code: 202 message: Accepted @@ -64,13 +64,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/c4830b08-2bbe-4e16-b71a-c8213c508c03?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/565a5841-3a90-4920-a5c5-9f792bd6f462?api-version=2020-06-30 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:13:53.5083598+00:00\",\r\n \"\ - endTime\": \"2020-05-18T15:13:53.648954+00:00\",\r\n \"status\": \"Succeeded\"\ + string: "{\r\n \"startTime\": \"2020-09-16T06:01:42.6720975+00:00\",\r\n \"\ + endTime\": \"2020-09-16T06:01:42.828384+00:00\",\r\n \"status\": \"Succeeded\"\ ,\r\n \"properties\": {\r\n \"output\": {\r\n \"name\": \"diskname10bb14a9\"\ ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/diskname10bb14a9\"\ ,\r\n \"type\": \"Microsoft.Compute/disks\",\r\n \"location\": \"eastus\"\ @@ -79,20 +79,20 @@ interactions: : \"Empty\"\r\n },\r\n \"diskSizeGB\": 200,\r\n \"diskIOPSReadWrite\"\ : 500,\r\n \"diskMBpsReadWrite\": 60,\r\n \"encryption\": {\r\n \ \ \"type\": \"EncryptionAtRestWithPlatformKey\"\r\n },\r\n \"timeCreated\"\ - : \"2020-05-18T15:13:53.5083598+00:00\",\r\n \"provisioningState\": \"\ + : \"2020-09-16T06:01:42.6720975+00:00\",\r\n \"provisioningState\": \"\ Succeeded\",\r\n \"diskState\": \"Unattached\",\r\n \"diskSizeBytes\"\ - : 214748364800,\r\n \"uniqueId\": \"817f7cf6-bb15-405f-bccc-f458b370afd6\"\ - \r\n }\r\n}\r\n },\r\n \"name\": \"c4830b08-2bbe-4e16-b71a-c8213c508c03\"\ - \r\n}" + : 214748364800,\r\n \"uniqueId\": \"1f4981d3-25e2-4666-b2ce-cb17e4c2fdcb\"\ + ,\r\n \"networkAccessPolicy\": \"AllowAll\"\r\n }\r\n}\r\n },\r\n \"\ + name\": \"565a5841-3a90-4920-a5c5-9f792bd6f462\"\r\n}" headers: cache-control: - no-cache content-length: - - '1051' + - '1108' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:13:55 GMT + - Wed, 16 Sep 2020 06:01:45 GMT expires: - '-1' pragma: @@ -109,7 +109,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49986,Microsoft.Compute/GetOperation30Min;399958 + - Microsoft.Compute/GetOperation3Min;49988,Microsoft.Compute/GetOperation30Min;399952 status: code: 200 message: OK @@ -123,9 +123,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/diskname10bb14a9?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/diskname10bb14a9?api-version=2020-06-30 response: body: string: "{\r\n \"name\": \"diskname10bb14a9\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/diskname10bb14a9\"\ @@ -135,19 +135,19 @@ interactions: : \"Empty\"\r\n },\r\n \"diskSizeGB\": 200,\r\n \"diskIOPSReadWrite\"\ : 500,\r\n \"diskMBpsReadWrite\": 60,\r\n \"encryption\": {\r\n \ \ \"type\": \"EncryptionAtRestWithPlatformKey\"\r\n },\r\n \"timeCreated\"\ - : \"2020-05-18T15:13:53.5083598+00:00\",\r\n \"provisioningState\": \"\ + : \"2020-09-16T06:01:42.6720975+00:00\",\r\n \"provisioningState\": \"\ Succeeded\",\r\n \"diskState\": \"Unattached\",\r\n \"diskSizeBytes\"\ - : 214748364800,\r\n \"uniqueId\": \"817f7cf6-bb15-405f-bccc-f458b370afd6\"\ - \r\n }\r\n}" + : 214748364800,\r\n \"uniqueId\": \"1f4981d3-25e2-4666-b2ce-cb17e4c2fdcb\"\ + ,\r\n \"networkAccessPolicy\": \"AllowAll\"\r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '827' + - '884' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:13:55 GMT + - Wed, 16 Sep 2020 06:01:45 GMT expires: - '-1' pragma: @@ -164,13 +164,13 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;4990,Microsoft.Compute/LowCostGet30Min;39965 + - Microsoft.Compute/LowCostGet3Min;4992,Microsoft.Compute/LowCostGet30Min;39950 status: code: 200 message: OK - request: - body: 'b''{"location": "eastus", "properties": {"creationData": {"createOption": - "Copy", "sourceUri": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/diskname10bb14a9"}}}''' + body: 'b''b\''{"location": "eastus", "properties": {"creationData": {"createOption": + "Copy", "sourceUri": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/diskname10bb14a9"}}}\''''' headers: Accept: - application/json @@ -179,35 +179,35 @@ interactions: Connection: - keep-alive Content-Length: - - '273' + - '290' Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotname10bb14a9?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotname10bb14a9?api-version=2020-06-30 response: body: string: "{\r\n \"location\": \"eastus\",\r\n \"properties\": {\r\n \"creationData\"\ : {\r\n \"createOption\": \"Copy\",\r\n \"sourceUri\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/diskname10bb14a9\"\ - ,\r\n \"sourceUniqueId\": \"817f7cf6-bb15-405f-bccc-f458b370afd6\"\r\n\ + ,\r\n \"sourceUniqueId\": \"1f4981d3-25e2-4666-b2ce-cb17e4c2fdcb\"\r\n\ \ },\r\n \"provisioningState\": \"Updating\",\r\n \"isArmResource\"\ : true\r\n }\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/11d2c27c-9afa-4d3f-ba3b-e4871d603f53?api-version=2019-11-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/7ef886ee-00c8-41a5-96dc-e223e6500658?api-version=2020-06-30 cache-control: - no-cache content-length: - - '444' + - '461' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:13:57 GMT + - Wed, 16 Sep 2020 06:01:48 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/11d2c27c-9afa-4d3f-ba3b-e4871d603f53?monitor=true&api-version=2019-11-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/7ef886ee-00c8-41a5-96dc-e223e6500658?monitor=true&api-version=2020-06-30 pragma: - no-cache server: @@ -220,7 +220,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/HighCostSnapshotCreateHydrate3Min;997,Microsoft.Compute/HighCostSnapshotCreateHydrate30Min;7996 x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1196' status: code: 202 message: Accepted @@ -234,36 +234,36 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/11d2c27c-9afa-4d3f-ba3b-e4871d603f53?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/7ef886ee-00c8-41a5-96dc-e223e6500658?api-version=2020-06-30 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:13:57.8991053+00:00\",\r\n \"\ - endTime\": \"2020-05-18T15:13:58.4147095+00:00\",\r\n \"status\": \"Succeeded\"\ + string: "{\r\n \"startTime\": \"2020-09-16T06:01:48.6408863+00:00\",\r\n \"\ + endTime\": \"2020-09-16T06:01:49.2502442+00:00\",\r\n \"status\": \"Succeeded\"\ ,\r\n \"properties\": {\r\n \"output\": {\r\n \"name\": \"snapshotname10bb14a9\"\ ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotname10bb14a9\"\ ,\r\n \"type\": \"Microsoft.Compute/snapshots\",\r\n \"location\": \"eastus\"\ ,\r\n \"sku\": {\r\n \"name\": \"Standard_LRS\",\r\n \"tier\": \"Standard\"\ \r\n },\r\n \"properties\": {\r\n \"creationData\": {\r\n \"createOption\"\ : \"Copy\",\r\n \"sourceResourceId\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/diskname10bb14a9\"\ - ,\r\n \"sourceUniqueId\": \"817f7cf6-bb15-405f-bccc-f458b370afd6\"\r\n\ + ,\r\n \"sourceUniqueId\": \"1f4981d3-25e2-4666-b2ce-cb17e4c2fdcb\"\r\n\ \ },\r\n \"diskSizeGB\": 200,\r\n \"encryption\": {\r\n \"type\"\ : \"EncryptionAtRestWithPlatformKey\"\r\n },\r\n \"incremental\": false,\r\ - \n \"timeCreated\": \"2020-05-18T15:13:57.8991053+00:00\",\r\n \"provisioningState\"\ + \n \"timeCreated\": \"2020-09-16T06:01:48.6565186+00:00\",\r\n \"provisioningState\"\ : \"Succeeded\",\r\n \"diskState\": \"Unattached\",\r\n \"diskSizeBytes\"\ - : 214748364800,\r\n \"uniqueId\": \"1ac59b51-5aac-453e-b47b-849a0e40fa0b\"\ - \r\n }\r\n}\r\n },\r\n \"name\": \"11d2c27c-9afa-4d3f-ba3b-e4871d603f53\"\ - \r\n}" + : 214748364800,\r\n \"uniqueId\": \"8c8e92b1-eef9-4df5-ad8c-63ef74a9b032\"\ + ,\r\n \"networkAccessPolicy\": \"AllowAll\"\r\n }\r\n}\r\n },\r\n \"\ + name\": \"7ef886ee-00c8-41a5-96dc-e223e6500658\"\r\n}" headers: cache-control: - no-cache content-length: - - '1305' + - '1379' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:13:59 GMT + - Wed, 16 Sep 2020 06:01:50 GMT expires: - '-1' pragma: @@ -280,7 +280,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49987,Microsoft.Compute/GetOperation30Min;399957 + - Microsoft.Compute/GetOperation3Min;49986,Microsoft.Compute/GetOperation30Min;399950 status: code: 200 message: OK @@ -294,9 +294,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotname10bb14a9?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotname10bb14a9?api-version=2020-06-30 response: body: string: "{\r\n \"name\": \"snapshotname10bb14a9\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotname10bb14a9\"\ @@ -304,22 +304,22 @@ interactions: ,\r\n \"sku\": {\r\n \"name\": \"Standard_LRS\",\r\n \"tier\": \"Standard\"\ \r\n },\r\n \"properties\": {\r\n \"creationData\": {\r\n \"createOption\"\ : \"Copy\",\r\n \"sourceResourceId\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/diskname10bb14a9\"\ - ,\r\n \"sourceUniqueId\": \"817f7cf6-bb15-405f-bccc-f458b370afd6\"\r\n\ + ,\r\n \"sourceUniqueId\": \"1f4981d3-25e2-4666-b2ce-cb17e4c2fdcb\"\r\n\ \ },\r\n \"diskSizeGB\": 200,\r\n \"encryption\": {\r\n \"type\"\ : \"EncryptionAtRestWithPlatformKey\"\r\n },\r\n \"incremental\": false,\r\ - \n \"timeCreated\": \"2020-05-18T15:13:57.8991053+00:00\",\r\n \"provisioningState\"\ + \n \"timeCreated\": \"2020-09-16T06:01:48.6565186+00:00\",\r\n \"provisioningState\"\ : \"Succeeded\",\r\n \"diskState\": \"Unattached\",\r\n \"diskSizeBytes\"\ - : 214748364800,\r\n \"uniqueId\": \"1ac59b51-5aac-453e-b47b-849a0e40fa0b\"\ - \r\n }\r\n}" + : 214748364800,\r\n \"uniqueId\": \"8c8e92b1-eef9-4df5-ad8c-63ef74a9b032\"\ + ,\r\n \"networkAccessPolicy\": \"AllowAll\"\r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '1080' + - '1154' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:13:59 GMT + - Wed, 16 Sep 2020 06:01:52 GMT expires: - '-1' pragma: @@ -336,7 +336,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;4990,Microsoft.Compute/LowCostGet30Min;39964 + - Microsoft.Compute/LowCostGet3Min;4990,Microsoft.Compute/LowCostGet30Min;39948 status: code: 200 message: OK @@ -355,7 +355,7 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9?api-version=2019-12-01 response: @@ -367,15 +367,15 @@ interactions: \r\n },\r\n \"provisioningState\": \"Creating\"\r\n }\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/b0e64ba6-319f-41aa-9056-b57d72969fda?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/3ea32b7e-3962-4cfc-bcb3-bb213feb71ad?api-version=2019-12-01 cache-control: - no-cache content-length: - - '527' + - '544' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:14:02 GMT + - Wed, 16 Sep 2020 06:01:56 GMT expires: - '-1' pragma: @@ -390,7 +390,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/CreateUpdateGallery3Min;49,Microsoft.Compute/CreateUpdateGallery30Min;299 x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1195' status: code: 201 message: Created @@ -404,14 +404,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/b0e64ba6-319f-41aa-9056-b57d72969fda?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/3ea32b7e-3962-4cfc-bcb3-bb213feb71ad?api-version=2019-12-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:14:02.1714647+00:00\",\r\n \"\ - endTime\": \"2020-05-18T15:14:02.3902176+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"b0e64ba6-319f-41aa-9056-b57d72969fda\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T06:01:54.9577697+00:00\",\r\n \"\ + endTime\": \"2020-09-16T06:01:55.2077707+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"3ea32b7e-3962-4cfc-bcb3-bb213feb71ad\"\r\n}" headers: cache-control: - no-cache @@ -420,7 +420,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:14:32 GMT + - Wed, 16 Sep 2020 06:02:26 GMT expires: - '-1' pragma: @@ -437,7 +437,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1198,Microsoft.Compute/GetOperationStatus30Min;2398 + - Microsoft.Compute/GetOperationStatus3Min;1198,Microsoft.Compute/GetOperationStatus30Min;4198 status: code: 200 message: OK @@ -451,7 +451,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9?api-version=2019-12-01 response: @@ -465,11 +465,11 @@ interactions: cache-control: - no-cache content-length: - - '528' + - '545' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:14:32 GMT + - Wed, 16 Sep 2020 06:02:26 GMT expires: - '-1' pragma: @@ -506,7 +506,7 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/applications/applicationname10bb14a9?api-version=2019-12-01 response: @@ -520,11 +520,11 @@ interactions: cache-control: - no-cache content-length: - - '535' + - '552' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:14:33 GMT + - Wed, 16 Sep 2020 06:02:27 GMT expires: - '-1' pragma: @@ -539,7 +539,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/CreateUpdateGalleryApplication3Min;149,Microsoft.Compute/CreateUpdateGalleryApplication30Min;749 x-ms-ratelimit-remaining-subscription-writes: - - '1196' + - '1194' status: code: 201 message: Created @@ -553,7 +553,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/applications/applicationname10bb14a9?api-version=2019-12-01 response: @@ -567,11 +567,11 @@ interactions: cache-control: - no-cache content-length: - - '535' + - '552' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:15:04 GMT + - Wed, 16 Sep 2020 06:02:58 GMT expires: - '-1' pragma: @@ -608,7 +608,7 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/images/imagex10bb14a9?api-version=2019-12-01 response: @@ -622,15 +622,15 @@ interactions: \n \"provisioningState\": \"Creating\"\r\n }\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/0633e81f-00ee-4e0c-99f4-f22e8ce5a443?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/77e528a0-9f73-4f48-9bd1-32b117180d79?api-version=2019-12-01 cache-control: - no-cache content-length: - - '599' + - '616' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:15:07 GMT + - Wed, 16 Sep 2020 06:03:07 GMT expires: - '-1' pragma: @@ -645,7 +645,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/CreateUpdateGalleryImage3Min;149,Microsoft.Compute/CreateUpdateGalleryImage30Min;749 x-ms-ratelimit-remaining-subscription-writes: - - '1195' + - '1193' status: code: 201 message: Created @@ -659,23 +659,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/0633e81f-00ee-4e0c-99f4-f22e8ce5a443?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/77e528a0-9f73-4f48-9bd1-32b117180d79?api-version=2019-12-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:15:06.5625639+00:00\",\r\n \"\ - endTime\": \"2020-05-18T15:15:06.6563196+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"0633e81f-00ee-4e0c-99f4-f22e8ce5a443\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T06:03:05.301581+00:00\",\r\n \"\ + endTime\": \"2020-09-16T06:03:05.4265751+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"77e528a0-9f73-4f48-9bd1-32b117180d79\"\r\n}" headers: cache-control: - no-cache content-length: - - '184' + - '183' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:15:37 GMT + - Wed, 16 Sep 2020 06:03:37 GMT expires: - '-1' pragma: @@ -692,7 +692,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1196,Microsoft.Compute/GetOperationStatus30Min;2396 + - Microsoft.Compute/GetOperationStatus3Min;1196,Microsoft.Compute/GetOperationStatus30Min;4196 status: code: 200 message: OK @@ -706,7 +706,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/images/imagex10bb14a9?api-version=2019-12-01 response: @@ -722,11 +722,11 @@ interactions: cache-control: - no-cache content-length: - - '600' + - '617' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:15:37 GMT + - Wed, 16 Sep 2020 06:03:37 GMT expires: - '-1' pragma: @@ -748,10 +748,10 @@ interactions: code: 200 message: OK - request: - body: 'b''{"location": "eastus", "properties": {"publishingProfile": {"targetRegions": + body: 'b''b\''{"location": "eastus", "properties": {"publishingProfile": {"targetRegions": [{"name": "East US", "regionalReplicaCount": 2, "storageAccountType": "Standard_ZRS"}]}, "storageProfile": {"osDiskImage": {"hostCaching": "ReadOnly", "source": {"id": - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotname10bb14a9"}}}}}''' + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotname10bb14a9"}}}}}\''''' headers: Accept: - application/json @@ -760,11 +760,11 @@ interactions: Connection: - keep-alive Content-Length: - - '436' + - '453' Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/images/imagex10bb14a9/versions/1.0.0?api-version=2019-12-01 response: @@ -775,7 +775,7 @@ interactions: : {\r\n \"targetRegions\": [\r\n {\r\n \"name\": \"East\ \ US\",\r\n \"regionalReplicaCount\": 2,\r\n \"storageAccountType\"\ : \"Standard_ZRS\"\r\n }\r\n ],\r\n \"replicaCount\": 1,\r\ - \n \"excludeFromLatest\": false,\r\n \"publishedDate\": \"2020-05-18T15:15:39.6720797+00:00\"\ + \n \"excludeFromLatest\": false,\r\n \"publishedDate\": \"2020-09-16T06:03:41.0047019+00:00\"\ ,\r\n \"storageAccountType\": \"Standard_LRS\"\r\n },\r\n \"storageProfile\"\ : {\r\n \"osDiskImage\": {\r\n \"hostCaching\": \"ReadOnly\",\r\ \n \"source\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotname10bb14a9\"\ @@ -783,15 +783,15 @@ interactions: \r\n }\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/164c343a-0aa7-434c-b3f3-a43360023da9?api-version=2019-12-01 cache-control: - no-cache content-length: - - '1115' + - '1149' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:15:40 GMT + - Wed, 16 Sep 2020 06:03:41 GMT expires: - '-1' pragma: @@ -806,7 +806,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/CreateUpdateGalleryImageVersion3Min;374,Microsoft.Compute/CreateUpdateGalleryImageVersion30Min;1199 x-ms-ratelimit-remaining-subscription-writes: - - '1194' + - '1192' status: code: 201 message: Created @@ -820,13 +820,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/164c343a-0aa7-434c-b3f3-a43360023da9?api-version=2019-12-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:15:39.6564355+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb\"\ + string: "{\r\n \"startTime\": \"2020-09-16T06:03:41.0047019+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"164c343a-0aa7-434c-b3f3-a43360023da9\"\ \r\n}" headers: cache-control: @@ -836,7 +836,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:16:10 GMT + - Wed, 16 Sep 2020 06:04:12 GMT expires: - '-1' pragma: @@ -853,7 +853,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1194,Microsoft.Compute/GetOperationStatus30Min;2394 + - Microsoft.Compute/GetOperationStatus3Min;1194,Microsoft.Compute/GetOperationStatus30Min;4194 status: code: 200 message: OK @@ -867,13 +867,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/164c343a-0aa7-434c-b3f3-a43360023da9?api-version=2019-12-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:15:39.6564355+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb\"\ + string: "{\r\n \"startTime\": \"2020-09-16T06:03:41.0047019+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"164c343a-0aa7-434c-b3f3-a43360023da9\"\ \r\n}" headers: cache-control: @@ -883,7 +883,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:16:39 GMT + - Wed, 16 Sep 2020 06:04:43 GMT expires: - '-1' pragma: @@ -900,7 +900,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1191,Microsoft.Compute/GetOperationStatus30Min;2391 + - Microsoft.Compute/GetOperationStatus3Min;1191,Microsoft.Compute/GetOperationStatus30Min;4191 status: code: 200 message: OK @@ -914,13 +914,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/164c343a-0aa7-434c-b3f3-a43360023da9?api-version=2019-12-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:15:39.6564355+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb\"\ + string: "{\r\n \"startTime\": \"2020-09-16T06:03:41.0047019+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"164c343a-0aa7-434c-b3f3-a43360023da9\"\ \r\n}" headers: cache-control: @@ -930,7 +930,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:17:10 GMT + - Wed, 16 Sep 2020 06:05:13 GMT expires: - '-1' pragma: @@ -947,7 +947,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1189,Microsoft.Compute/GetOperationStatus30Min;2388 + - Microsoft.Compute/GetOperationStatus3Min;1190,Microsoft.Compute/GetOperationStatus30Min;4188 status: code: 200 message: OK @@ -961,13 +961,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/164c343a-0aa7-434c-b3f3-a43360023da9?api-version=2019-12-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:15:39.6564355+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb\"\ + string: "{\r\n \"startTime\": \"2020-09-16T06:03:41.0047019+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"164c343a-0aa7-434c-b3f3-a43360023da9\"\ \r\n}" headers: cache-control: @@ -977,7 +977,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:17:40 GMT + - Wed, 16 Sep 2020 06:05:43 GMT expires: - '-1' pragma: @@ -994,7 +994,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1187,Microsoft.Compute/GetOperationStatus30Min;2385 + - Microsoft.Compute/GetOperationStatus3Min;1187,Microsoft.Compute/GetOperationStatus30Min;4185 status: code: 200 message: OK @@ -1008,13 +1008,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/164c343a-0aa7-434c-b3f3-a43360023da9?api-version=2019-12-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:15:39.6564355+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb\"\ + string: "{\r\n \"startTime\": \"2020-09-16T06:03:41.0047019+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"164c343a-0aa7-434c-b3f3-a43360023da9\"\ \r\n}" headers: cache-control: @@ -1024,7 +1024,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:18:11 GMT + - Wed, 16 Sep 2020 06:06:14 GMT expires: - '-1' pragma: @@ -1041,7 +1041,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1185,Microsoft.Compute/GetOperationStatus30Min;2382 + - Microsoft.Compute/GetOperationStatus3Min;1185,Microsoft.Compute/GetOperationStatus30Min;4182 status: code: 200 message: OK @@ -1055,13 +1055,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/164c343a-0aa7-434c-b3f3-a43360023da9?api-version=2019-12-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:15:39.6564355+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb\"\ + string: "{\r\n \"startTime\": \"2020-09-16T06:03:41.0047019+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"164c343a-0aa7-434c-b3f3-a43360023da9\"\ \r\n}" headers: cache-control: @@ -1071,7 +1071,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:18:41 GMT + - Wed, 16 Sep 2020 06:06:44 GMT expires: - '-1' pragma: @@ -1088,7 +1088,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1185,Microsoft.Compute/GetOperationStatus30Min;2380 + - Microsoft.Compute/GetOperationStatus3Min;1185,Microsoft.Compute/GetOperationStatus30Min;4180 status: code: 200 message: OK @@ -1102,13 +1102,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/164c343a-0aa7-434c-b3f3-a43360023da9?api-version=2019-12-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:15:39.6564355+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb\"\ + string: "{\r\n \"startTime\": \"2020-09-16T06:03:41.0047019+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"164c343a-0aa7-434c-b3f3-a43360023da9\"\ \r\n}" headers: cache-control: @@ -1118,7 +1118,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:19:10 GMT + - Wed, 16 Sep 2020 06:07:14 GMT expires: - '-1' pragma: @@ -1135,7 +1135,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1185,Microsoft.Compute/GetOperationStatus30Min;2377 + - Microsoft.Compute/GetOperationStatus3Min;1184,Microsoft.Compute/GetOperationStatus30Min;4177 status: code: 200 message: OK @@ -1149,13 +1149,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/164c343a-0aa7-434c-b3f3-a43360023da9?api-version=2019-12-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:15:39.6564355+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb\"\ + string: "{\r\n \"startTime\": \"2020-09-16T06:03:41.0047019+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"164c343a-0aa7-434c-b3f3-a43360023da9\"\ \r\n}" headers: cache-control: @@ -1165,7 +1165,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:19:40 GMT + - Wed, 16 Sep 2020 06:07:47 GMT expires: - '-1' pragma: @@ -1182,7 +1182,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1184,Microsoft.Compute/GetOperationStatus30Min;2374 + - Microsoft.Compute/GetOperationStatus3Min;1184,Microsoft.Compute/GetOperationStatus30Min;4174 status: code: 200 message: OK @@ -1196,13 +1196,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/164c343a-0aa7-434c-b3f3-a43360023da9?api-version=2019-12-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:15:39.6564355+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb\"\ + string: "{\r\n \"startTime\": \"2020-09-16T06:03:41.0047019+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"164c343a-0aa7-434c-b3f3-a43360023da9\"\ \r\n}" headers: cache-control: @@ -1212,7 +1212,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:20:12 GMT + - Wed, 16 Sep 2020 06:08:17 GMT expires: - '-1' pragma: @@ -1229,7 +1229,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1184,Microsoft.Compute/GetOperationStatus30Min;2371 + - Microsoft.Compute/GetOperationStatus3Min;1184,Microsoft.Compute/GetOperationStatus30Min;4171 status: code: 200 message: OK @@ -1243,13 +1243,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/164c343a-0aa7-434c-b3f3-a43360023da9?api-version=2019-12-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:15:39.6564355+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb\"\ + string: "{\r\n \"startTime\": \"2020-09-16T06:03:41.0047019+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"164c343a-0aa7-434c-b3f3-a43360023da9\"\ \r\n}" headers: cache-control: @@ -1259,7 +1259,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:20:41 GMT + - Wed, 16 Sep 2020 06:08:47 GMT expires: - '-1' pragma: @@ -1276,7 +1276,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1184,Microsoft.Compute/GetOperationStatus30Min;2368 + - Microsoft.Compute/GetOperationStatus3Min;1184,Microsoft.Compute/GetOperationStatus30Min;4168 status: code: 200 message: OK @@ -1290,13 +1290,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/164c343a-0aa7-434c-b3f3-a43360023da9?api-version=2019-12-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:15:39.6564355+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb\"\ + string: "{\r\n \"startTime\": \"2020-09-16T06:03:41.0047019+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"164c343a-0aa7-434c-b3f3-a43360023da9\"\ \r\n}" headers: cache-control: @@ -1306,7 +1306,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:21:11 GMT + - Wed, 16 Sep 2020 06:09:18 GMT expires: - '-1' pragma: @@ -1323,7 +1323,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1185,Microsoft.Compute/GetOperationStatus30Min;2366 + - Microsoft.Compute/GetOperationStatus3Min;1184,Microsoft.Compute/GetOperationStatus30Min;4166 status: code: 200 message: OK @@ -1337,13 +1337,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/164c343a-0aa7-434c-b3f3-a43360023da9?api-version=2019-12-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:15:39.6564355+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb\"\ + string: "{\r\n \"startTime\": \"2020-09-16T06:03:41.0047019+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"164c343a-0aa7-434c-b3f3-a43360023da9\"\ \r\n}" headers: cache-control: @@ -1353,7 +1353,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:21:41 GMT + - Wed, 16 Sep 2020 06:09:48 GMT expires: - '-1' pragma: @@ -1370,7 +1370,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1184,Microsoft.Compute/GetOperationStatus30Min;2363 + - Microsoft.Compute/GetOperationStatus3Min;1184,Microsoft.Compute/GetOperationStatus30Min;4163 status: code: 200 message: OK @@ -1384,13 +1384,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/164c343a-0aa7-434c-b3f3-a43360023da9?api-version=2019-12-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:15:39.6564355+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb\"\ + string: "{\r\n \"startTime\": \"2020-09-16T06:03:41.0047019+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"164c343a-0aa7-434c-b3f3-a43360023da9\"\ \r\n}" headers: cache-control: @@ -1400,7 +1400,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:22:11 GMT + - Wed, 16 Sep 2020 06:10:18 GMT expires: - '-1' pragma: @@ -1417,7 +1417,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1184,Microsoft.Compute/GetOperationStatus30Min;2360 + - Microsoft.Compute/GetOperationStatus3Min;1184,Microsoft.Compute/GetOperationStatus30Min;4160 status: code: 200 message: OK @@ -1431,13 +1431,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/164c343a-0aa7-434c-b3f3-a43360023da9?api-version=2019-12-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:15:39.6564355+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb\"\ + string: "{\r\n \"startTime\": \"2020-09-16T06:03:41.0047019+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"164c343a-0aa7-434c-b3f3-a43360023da9\"\ \r\n}" headers: cache-control: @@ -1447,7 +1447,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:22:42 GMT + - Wed, 16 Sep 2020 06:10:49 GMT expires: - '-1' pragma: @@ -1464,7 +1464,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1184,Microsoft.Compute/GetOperationStatus30Min;2357 + - Microsoft.Compute/GetOperationStatus3Min;1184,Microsoft.Compute/GetOperationStatus30Min;4157 status: code: 200 message: OK @@ -1478,13 +1478,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/164c343a-0aa7-434c-b3f3-a43360023da9?api-version=2019-12-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:15:39.6564355+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb\"\ + string: "{\r\n \"startTime\": \"2020-09-16T06:03:41.0047019+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"164c343a-0aa7-434c-b3f3-a43360023da9\"\ \r\n}" headers: cache-control: @@ -1494,7 +1494,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:23:12 GMT + - Wed, 16 Sep 2020 06:11:20 GMT expires: - '-1' pragma: @@ -1511,7 +1511,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1184,Microsoft.Compute/GetOperationStatus30Min;2354 + - Microsoft.Compute/GetOperationStatus3Min;1184,Microsoft.Compute/GetOperationStatus30Min;4154 status: code: 200 message: OK @@ -1525,13 +1525,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/164c343a-0aa7-434c-b3f3-a43360023da9?api-version=2019-12-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:15:39.6564355+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb\"\ + string: "{\r\n \"startTime\": \"2020-09-16T06:03:41.0047019+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"164c343a-0aa7-434c-b3f3-a43360023da9\"\ \r\n}" headers: cache-control: @@ -1541,7 +1541,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:23:43 GMT + - Wed, 16 Sep 2020 06:11:50 GMT expires: - '-1' pragma: @@ -1558,7 +1558,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1185,Microsoft.Compute/GetOperationStatus30Min;2352 + - Microsoft.Compute/GetOperationStatus3Min;1184,Microsoft.Compute/GetOperationStatus30Min;4152 status: code: 200 message: OK @@ -1572,13 +1572,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/164c343a-0aa7-434c-b3f3-a43360023da9?api-version=2019-12-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:15:39.6564355+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb\"\ + string: "{\r\n \"startTime\": \"2020-09-16T06:03:41.0047019+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"164c343a-0aa7-434c-b3f3-a43360023da9\"\ \r\n}" headers: cache-control: @@ -1588,7 +1588,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:24:13 GMT + - Wed, 16 Sep 2020 06:12:20 GMT expires: - '-1' pragma: @@ -1605,7 +1605,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1184,Microsoft.Compute/GetOperationStatus30Min;2349 + - Microsoft.Compute/GetOperationStatus3Min;1184,Microsoft.Compute/GetOperationStatus30Min;4149 status: code: 200 message: OK @@ -1619,13 +1619,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/164c343a-0aa7-434c-b3f3-a43360023da9?api-version=2019-12-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:15:39.6564355+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb\"\ + string: "{\r\n \"startTime\": \"2020-09-16T06:03:41.0047019+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"164c343a-0aa7-434c-b3f3-a43360023da9\"\ \r\n}" headers: cache-control: @@ -1635,7 +1635,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:24:42 GMT + - Wed, 16 Sep 2020 06:12:52 GMT expires: - '-1' pragma: @@ -1652,7 +1652,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1184,Microsoft.Compute/GetOperationStatus30Min;2346 + - Microsoft.Compute/GetOperationStatus3Min;1184,Microsoft.Compute/GetOperationStatus30Min;4146 status: code: 200 message: OK @@ -1666,14 +1666,343 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/164c343a-0aa7-434c-b3f3-a43360023da9?api-version=2019-12-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:15:39.6564355+00:00\",\r\n \"\ - endTime\": \"2020-05-18T15:24:55.0045076+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"27b95bcc-aa8e-4d5e-a711-f2f63e3d63bb\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T06:03:41.0047019+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"164c343a-0aa7-434c-b3f3-a43360023da9\"\ + \r\n}" + headers: + cache-control: + - no-cache + content-length: + - '134' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 06:13:23 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetOperationStatus3Min;1184,Microsoft.Compute/GetOperationStatus30Min;4143 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/164c343a-0aa7-434c-b3f3-a43360023da9?api-version=2019-12-01 + response: + body: + string: "{\r\n \"startTime\": \"2020-09-16T06:03:41.0047019+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"164c343a-0aa7-434c-b3f3-a43360023da9\"\ + \r\n}" + headers: + cache-control: + - no-cache + content-length: + - '134' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 06:13:54 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetOperationStatus3Min;1183,Microsoft.Compute/GetOperationStatus30Min;4140 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/164c343a-0aa7-434c-b3f3-a43360023da9?api-version=2019-12-01 + response: + body: + string: "{\r\n \"startTime\": \"2020-09-16T06:03:41.0047019+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"164c343a-0aa7-434c-b3f3-a43360023da9\"\ + \r\n}" + headers: + cache-control: + - no-cache + content-length: + - '134' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 06:14:24 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetOperationStatus3Min;1183,Microsoft.Compute/GetOperationStatus30Min;4137 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/164c343a-0aa7-434c-b3f3-a43360023da9?api-version=2019-12-01 + response: + body: + string: "{\r\n \"startTime\": \"2020-09-16T06:03:41.0047019+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"164c343a-0aa7-434c-b3f3-a43360023da9\"\ + \r\n}" + headers: + cache-control: + - no-cache + content-length: + - '134' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 06:14:54 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetOperationStatus3Min;1184,Microsoft.Compute/GetOperationStatus30Min;4135 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/164c343a-0aa7-434c-b3f3-a43360023da9?api-version=2019-12-01 + response: + body: + string: "{\r\n \"startTime\": \"2020-09-16T06:03:41.0047019+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"164c343a-0aa7-434c-b3f3-a43360023da9\"\ + \r\n}" + headers: + cache-control: + - no-cache + content-length: + - '134' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 06:15:24 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetOperationStatus3Min;1184,Microsoft.Compute/GetOperationStatus30Min;4132 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/164c343a-0aa7-434c-b3f3-a43360023da9?api-version=2019-12-01 + response: + body: + string: "{\r\n \"startTime\": \"2020-09-16T06:03:41.0047019+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"164c343a-0aa7-434c-b3f3-a43360023da9\"\ + \r\n}" + headers: + cache-control: + - no-cache + content-length: + - '134' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 06:15:55 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetOperationStatus3Min;1184,Microsoft.Compute/GetOperationStatus30Min;4129 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/164c343a-0aa7-434c-b3f3-a43360023da9?api-version=2019-12-01 + response: + body: + string: "{\r\n \"startTime\": \"2020-09-16T06:03:41.0047019+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"164c343a-0aa7-434c-b3f3-a43360023da9\"\ + \r\n}" + headers: + cache-control: + - no-cache + content-length: + - '134' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 06:16:25 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetOperationStatus3Min;1183,Microsoft.Compute/GetOperationStatus30Min;4126 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/164c343a-0aa7-434c-b3f3-a43360023da9?api-version=2019-12-01 + response: + body: + string: "{\r\n \"startTime\": \"2020-09-16T06:03:41.0047019+00:00\",\r\n \"\ + endTime\": \"2020-09-16T06:16:41.5521288+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"164c343a-0aa7-434c-b3f3-a43360023da9\"\r\n}" headers: cache-control: - no-cache @@ -1682,7 +2011,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:25:13 GMT + - Wed, 16 Sep 2020 06:16:55 GMT expires: - '-1' pragma: @@ -1699,7 +2028,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1184,Microsoft.Compute/GetOperationStatus30Min;2343 + - Microsoft.Compute/GetOperationStatus3Min;1183,Microsoft.Compute/GetOperationStatus30Min;4123 status: code: 200 message: OK @@ -1713,7 +2042,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/images/imagex10bb14a9/versions/1.0.0?api-version=2019-12-01 response: @@ -1724,7 +2053,7 @@ interactions: : {\r\n \"targetRegions\": [\r\n {\r\n \"name\": \"East\ \ US\",\r\n \"regionalReplicaCount\": 2,\r\n \"storageAccountType\"\ : \"Standard_ZRS\"\r\n }\r\n ],\r\n \"replicaCount\": 1,\r\ - \n \"excludeFromLatest\": false,\r\n \"publishedDate\": \"2020-05-18T15:15:39.6720797+00:00\"\ + \n \"excludeFromLatest\": false,\r\n \"publishedDate\": \"2020-09-16T06:03:41.0047019+00:00\"\ ,\r\n \"storageAccountType\": \"Standard_LRS\"\r\n },\r\n \"storageProfile\"\ : {\r\n \"osDiskImage\": {\r\n \"sizeInGB\": 200,\r\n \"\ hostCaching\": \"ReadOnly\",\r\n \"source\": {\r\n \"id\"\ @@ -1735,11 +2064,11 @@ interactions: cache-control: - no-cache content-length: - - '1142' + - '1176' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:25:13 GMT + - Wed, 16 Sep 2020 06:16:57 GMT expires: - '-1' pragma: @@ -1756,7 +2085,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetGalleryImageVersion3Min;1997,Microsoft.Compute/GetGalleryImageVersion30Min;9995 + - Microsoft.Compute/GetGalleryImageVersion3Min;1998,Microsoft.Compute/GetGalleryImageVersion30Min;9996 status: code: 200 message: OK @@ -1770,9 +2099,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/images/imagex10bb14a9/versions/1.0.0?$expand=ReplicationStatus&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/images/imagex10bb14a9/versions/1.0.0?api-version=2019-12-01 response: body: string: "{\r\n \"name\": \"1.0.0\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/images/imagex10bb14a9/versions/1.0.0\"\ @@ -1781,25 +2110,22 @@ interactions: : {\r\n \"targetRegions\": [\r\n {\r\n \"name\": \"East\ \ US\",\r\n \"regionalReplicaCount\": 2,\r\n \"storageAccountType\"\ : \"Standard_ZRS\"\r\n }\r\n ],\r\n \"replicaCount\": 1,\r\ - \n \"excludeFromLatest\": false,\r\n \"publishedDate\": \"2020-05-18T15:15:39.6720797+00:00\"\ + \n \"excludeFromLatest\": false,\r\n \"publishedDate\": \"2020-09-16T06:03:41.0047019+00:00\"\ ,\r\n \"storageAccountType\": \"Standard_LRS\"\r\n },\r\n \"storageProfile\"\ : {\r\n \"osDiskImage\": {\r\n \"sizeInGB\": 200,\r\n \"\ hostCaching\": \"ReadOnly\",\r\n \"source\": {\r\n \"id\"\ : \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotname10bb14a9\"\ \r\n }\r\n }\r\n },\r\n \"provisioningState\": \"Succeeded\"\ - ,\r\n \"replicationStatus\": {\r\n \"aggregatedState\": \"Completed\"\ - ,\r\n \"summary\": [\r\n {\r\n \"region\": \"eastus\"\ - ,\r\n \"state\": \"Completed\",\r\n \"progress\": 100\r\n\ - \ }\r\n ]\r\n }\r\n }\r\n}" + \r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '1359' + - '1176' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:25:13 GMT + - Wed, 16 Sep 2020 06:16:57 GMT expires: - '-1' pragma: @@ -1816,7 +2142,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetGalleryImageVersion3Min;1996,Microsoft.Compute/GetGalleryImageVersion30Min;9994 + - Microsoft.Compute/GetGalleryImageVersion3Min;1997,Microsoft.Compute/GetGalleryImageVersion30Min;9995 status: code: 200 message: OK @@ -1830,7 +2156,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/images/imagex10bb14a9?api-version=2019-12-01 response: @@ -1846,11 +2172,11 @@ interactions: cache-control: - no-cache content-length: - - '600' + - '617' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:25:13 GMT + - Wed, 16 Sep 2020 06:16:58 GMT expires: - '-1' pragma: @@ -1867,7 +2193,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetGalleryImage3Min;597,Microsoft.Compute/GetGalleryImage30Min;2992 + - Microsoft.Compute/GetGalleryImage3Min;598,Microsoft.Compute/GetGalleryImage30Min;2989 status: code: 200 message: OK @@ -1881,7 +2207,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/applications/applicationname10bb14a9?api-version=2019-12-01 response: @@ -1895,11 +2221,11 @@ interactions: cache-control: - no-cache content-length: - - '535' + - '552' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:25:13 GMT + - Wed, 16 Sep 2020 06:16:58 GMT expires: - '-1' pragma: @@ -1916,7 +2242,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetGalleryApplication3Min;299,Microsoft.Compute/GetGalleryApplication30Min;1996 + - Microsoft.Compute/GetGalleryApplication3Min;298,Microsoft.Compute/GetGalleryApplication30Min;1995 status: code: 200 message: OK @@ -1930,7 +2256,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9?api-version=2019-12-01 response: @@ -1944,11 +2270,11 @@ interactions: cache-control: - no-cache content-length: - - '528' + - '545' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:25:13 GMT + - Wed, 16 Sep 2020 06:16:59 GMT expires: - '-1' pragma: @@ -1965,14 +2291,15 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetGallery3Min;345,Microsoft.Compute/GetGallery30Min;2490 + - Microsoft.Compute/GetGallery3Min;349,Microsoft.Compute/GetGallery30Min;2490 status: code: 200 message: OK - request: - body: 'b''{"properties": {"publishingProfile": {"targetRegions": [{"name": "East - US", "regionalReplicaCount": 2, "storageAccountType": "Standard_ZRS"}]}, "storageProfile": - {"osDiskImage": {"hostCaching": "ReadOnly", "source": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotname10bb14a9"}}}}}''' + body: 'b''b\''{"properties": {"publishingProfile": {"targetRegions": [{"name": + "East US", "regionalReplicaCount": 2, "storageAccountType": "Standard_ZRS"}]}, + "storageProfile": {"osDiskImage": {"hostCaching": "ReadOnly", "source": {"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotname10bb14a9"}}}}}\''''' headers: Accept: - application/json @@ -1981,11 +2308,11 @@ interactions: Connection: - keep-alive Content-Length: - - '414' + - '431' Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PATCH uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/images/imagex10bb14a9/versions/1.0.0?api-version=2019-12-01 response: @@ -1996,7 +2323,7 @@ interactions: : {\r\n \"targetRegions\": [\r\n {\r\n \"name\": \"East\ \ US\",\r\n \"regionalReplicaCount\": 2,\r\n \"storageAccountType\"\ : \"Standard_ZRS\"\r\n }\r\n ],\r\n \"replicaCount\": 1,\r\ - \n \"excludeFromLatest\": false,\r\n \"publishedDate\": \"2020-05-18T15:15:39.6720797+00:00\"\ + \n \"excludeFromLatest\": false,\r\n \"publishedDate\": \"2020-09-16T06:03:41.0047019+00:00\"\ ,\r\n \"storageAccountType\": \"Standard_LRS\"\r\n },\r\n \"storageProfile\"\ : {\r\n \"osDiskImage\": {\r\n \"sizeInGB\": 200,\r\n \"\ hostCaching\": \"ReadOnly\",\r\n \"source\": {\r\n \"id\"\ @@ -2005,15 +2332,15 @@ interactions: \r\n }\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/e183d621-d91e-4780-a9b9-632e9791a4a7?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/ef33edc7-75c6-4f64-baf9-22d55cbe6823?api-version=2019-12-01 cache-control: - no-cache content-length: - - '1141' + - '1175' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:25:14 GMT + - Wed, 16 Sep 2020 06:16:59 GMT expires: - '-1' pragma: @@ -2032,7 +2359,101 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/CreateUpdateGalleryImageVersion3Min;374,Microsoft.Compute/CreateUpdateGalleryImageVersion30Min;1198 x-ms-ratelimit-remaining-subscription-writes: - - '1193' + - '1191' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/ef33edc7-75c6-4f64-baf9-22d55cbe6823?api-version=2019-12-01 + response: + body: + string: "{\r\n \"startTime\": \"2020-09-16T06:16:59.7240268+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"ef33edc7-75c6-4f64-baf9-22d55cbe6823\"\ + \r\n}" + headers: + cache-control: + - no-cache + content-length: + - '134' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 06:17:29 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetOperationStatus3Min;1188,Microsoft.Compute/GetOperationStatus30Min;4122 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/ef33edc7-75c6-4f64-baf9-22d55cbe6823?api-version=2019-12-01 + response: + body: + string: "{\r\n \"startTime\": \"2020-09-16T06:16:59.7240268+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"ef33edc7-75c6-4f64-baf9-22d55cbe6823\"\ + \r\n}" + headers: + cache-control: + - no-cache + content-length: + - '134' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 06:17:59 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetOperationStatus3Min;1190,Microsoft.Compute/GetOperationStatus30Min;4121 status: code: 200 message: OK @@ -2046,13 +2467,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/e183d621-d91e-4780-a9b9-632e9791a4a7?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/ef33edc7-75c6-4f64-baf9-22d55cbe6823?api-version=2019-12-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:25:15.1451683+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"e183d621-d91e-4780-a9b9-632e9791a4a7\"\ + string: "{\r\n \"startTime\": \"2020-09-16T06:16:59.7240268+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"ef33edc7-75c6-4f64-baf9-22d55cbe6823\"\ \r\n}" headers: cache-control: @@ -2062,7 +2483,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:25:45 GMT + - Wed, 16 Sep 2020 06:18:30 GMT expires: - '-1' pragma: @@ -2079,7 +2500,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1186,Microsoft.Compute/GetOperationStatus30Min;2342 + - Microsoft.Compute/GetOperationStatus3Min;1191,Microsoft.Compute/GetOperationStatus30Min;4120 status: code: 200 message: OK @@ -2093,13 +2514,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/e183d621-d91e-4780-a9b9-632e9791a4a7?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/ef33edc7-75c6-4f64-baf9-22d55cbe6823?api-version=2019-12-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:25:15.1451683+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"e183d621-d91e-4780-a9b9-632e9791a4a7\"\ + string: "{\r\n \"startTime\": \"2020-09-16T06:16:59.7240268+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"ef33edc7-75c6-4f64-baf9-22d55cbe6823\"\ \r\n}" headers: cache-control: @@ -2109,7 +2530,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:26:14 GMT + - Wed, 16 Sep 2020 06:19:01 GMT expires: - '-1' pragma: @@ -2126,7 +2547,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1188,Microsoft.Compute/GetOperationStatus30Min;2341 + - Microsoft.Compute/GetOperationStatus3Min;1193,Microsoft.Compute/GetOperationStatus30Min;4119 status: code: 200 message: OK @@ -2140,14 +2561,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/e183d621-d91e-4780-a9b9-632e9791a4a7?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/ef33edc7-75c6-4f64-baf9-22d55cbe6823?api-version=2019-12-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:25:15.1451683+00:00\",\r\n \"\ - endTime\": \"2020-05-18T15:26:45.2396232+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"e183d621-d91e-4780-a9b9-632e9791a4a7\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T06:16:59.7240268+00:00\",\r\n \"\ + endTime\": \"2020-09-16T06:19:29.8491525+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"ef33edc7-75c6-4f64-baf9-22d55cbe6823\"\r\n}" headers: cache-control: - no-cache @@ -2156,7 +2577,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:26:45 GMT + - Wed, 16 Sep 2020 06:19:31 GMT expires: - '-1' pragma: @@ -2173,7 +2594,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1189,Microsoft.Compute/GetOperationStatus30Min;2340 + - Microsoft.Compute/GetOperationStatus3Min;1195,Microsoft.Compute/GetOperationStatus30Min;4118 status: code: 200 message: OK @@ -2187,7 +2608,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/images/imagex10bb14a9/versions/1.0.0?api-version=2019-12-01 response: @@ -2198,7 +2619,7 @@ interactions: : {\r\n \"targetRegions\": [\r\n {\r\n \"name\": \"East\ \ US\",\r\n \"regionalReplicaCount\": 2,\r\n \"storageAccountType\"\ : \"Standard_ZRS\"\r\n }\r\n ],\r\n \"replicaCount\": 1,\r\ - \n \"excludeFromLatest\": false,\r\n \"publishedDate\": \"2020-05-18T15:15:39.6720797+00:00\"\ + \n \"excludeFromLatest\": false,\r\n \"publishedDate\": \"2020-09-16T06:03:41.0047019+00:00\"\ ,\r\n \"storageAccountType\": \"Standard_LRS\"\r\n },\r\n \"storageProfile\"\ : {\r\n \"osDiskImage\": {\r\n \"sizeInGB\": 200,\r\n \"\ hostCaching\": \"ReadOnly\",\r\n \"source\": {\r\n \"id\"\ @@ -2209,11 +2630,11 @@ interactions: cache-control: - no-cache content-length: - - '1142' + - '1176' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:26:45 GMT + - Wed, 16 Sep 2020 06:19:32 GMT expires: - '-1' pragma: @@ -2230,7 +2651,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetGalleryImageVersion3Min;1992,Microsoft.Compute/GetGalleryImageVersion30Min;9990 + - Microsoft.Compute/GetGalleryImageVersion3Min;1997,Microsoft.Compute/GetGalleryImageVersion30Min;9992 status: code: 200 message: OK @@ -2249,7 +2670,7 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PATCH uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/images/imagex10bb14a9?api-version=2019-12-01 response: @@ -2263,15 +2684,15 @@ interactions: \n \"provisioningState\": \"Updating\"\r\n }\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/d0d7599b-14e5-42a3-b313-980564fc2d5c?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/176789e9-66ee-432b-b192-a2e8cb095ff2?api-version=2019-12-01 cache-control: - no-cache content-length: - - '599' + - '616' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:26:46 GMT + - Wed, 16 Sep 2020 06:19:33 GMT expires: - '-1' pragma: @@ -2290,7 +2711,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/CreateUpdateGalleryImage3Min;149,Microsoft.Compute/CreateUpdateGalleryImage30Min;748 x-ms-ratelimit-remaining-subscription-writes: - - '1192' + - '1190' status: code: 200 message: OK @@ -2304,14 +2725,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/d0d7599b-14e5-42a3-b313-980564fc2d5c?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/176789e9-66ee-432b-b192-a2e8cb095ff2?api-version=2019-12-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:26:46.8020841+00:00\",\r\n \"\ - endTime\": \"2020-05-18T15:26:46.8489717+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"d0d7599b-14e5-42a3-b313-980564fc2d5c\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T06:19:33.3804476+00:00\",\r\n \"\ + endTime\": \"2020-09-16T06:19:33.4116783+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"176789e9-66ee-432b-b192-a2e8cb095ff2\"\r\n}" headers: cache-control: - no-cache @@ -2320,7 +2741,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:27:16 GMT + - Wed, 16 Sep 2020 06:20:03 GMT expires: - '-1' pragma: @@ -2337,7 +2758,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1191,Microsoft.Compute/GetOperationStatus30Min;2339 + - Microsoft.Compute/GetOperationStatus3Min;1194,Microsoft.Compute/GetOperationStatus30Min;4117 status: code: 200 message: OK @@ -2351,7 +2772,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/images/imagex10bb14a9?api-version=2019-12-01 response: @@ -2367,11 +2788,11 @@ interactions: cache-control: - no-cache content-length: - - '600' + - '617' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:27:16 GMT + - Wed, 16 Sep 2020 06:20:04 GMT expires: - '-1' pragma: @@ -2388,7 +2809,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetGalleryImage3Min;593,Microsoft.Compute/GetGalleryImage30Min;2988 + - Microsoft.Compute/GetGalleryImage3Min;598,Microsoft.Compute/GetGalleryImage30Min;2987 status: code: 200 message: OK @@ -2408,7 +2829,7 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PATCH uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/applications/applicationname10bb14a9?api-version=2019-12-01 response: @@ -2423,11 +2844,11 @@ interactions: cache-control: - no-cache content-length: - - '574' + - '591' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:27:17 GMT + - Wed, 16 Sep 2020 06:20:04 GMT expires: - '-1' pragma: @@ -2446,7 +2867,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/CreateUpdateGalleryApplication3Min;149,Microsoft.Compute/CreateUpdateGalleryApplication30Min;748 x-ms-ratelimit-remaining-subscription-writes: - - '1191' + - '1189' status: code: 200 message: OK @@ -2464,7 +2885,7 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PATCH uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9?api-version=2019-12-01 response: @@ -2476,15 +2897,15 @@ interactions: \r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/04bcffd8-26a3-408f-9145-0e4266ab83fb?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/cd116f8b-a096-4d58-ae8f-fa9c4abc0e92?api-version=2019-12-01 cache-control: - no-cache content-length: - - '528' + - '545' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:27:17 GMT + - Wed, 16 Sep 2020 06:20:05 GMT expires: - '-1' pragma: @@ -2503,7 +2924,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/CreateUpdateGallery3Min;49,Microsoft.Compute/CreateUpdateGallery30Min;298 x-ms-ratelimit-remaining-subscription-writes: - - '1190' + - '1188' status: code: 200 message: OK @@ -2517,14 +2938,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/04bcffd8-26a3-408f-9145-0e4266ab83fb?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/cd116f8b-a096-4d58-ae8f-fa9c4abc0e92?api-version=2019-12-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:27:18.4742169+00:00\",\r\n \"\ - endTime\": \"2020-05-18T15:27:18.5211158+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"04bcffd8-26a3-408f-9145-0e4266ab83fb\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T06:20:05.1929287+00:00\",\r\n \"\ + endTime\": \"2020-09-16T06:20:05.2241801+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"cd116f8b-a096-4d58-ae8f-fa9c4abc0e92\"\r\n}" headers: cache-control: - no-cache @@ -2533,7 +2954,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:27:48 GMT + - Wed, 16 Sep 2020 06:20:35 GMT expires: - '-1' pragma: @@ -2550,7 +2971,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1193,Microsoft.Compute/GetOperationStatus30Min;2338 + - Microsoft.Compute/GetOperationStatus3Min;1194,Microsoft.Compute/GetOperationStatus30Min;4116 status: code: 200 message: OK @@ -2564,7 +2985,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9?api-version=2019-12-01 response: @@ -2578,11 +2999,11 @@ interactions: cache-control: - no-cache content-length: - - '528' + - '545' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:27:48 GMT + - Wed, 16 Sep 2020 06:20:35 GMT expires: - '-1' pragma: @@ -2599,7 +3020,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetGallery3Min;347,Microsoft.Compute/GetGallery30Min;2488 + - Microsoft.Compute/GetGallery3Min;348,Microsoft.Compute/GetGallery30Min;2488 status: code: 200 message: OK @@ -2607,7 +3028,7 @@ interactions: body: null headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate Connection: @@ -2615,7 +3036,7 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/images/imagex10bb14a9/versions/1.0.0?api-version=2019-12-01 response: @@ -2623,17 +3044,17 @@ interactions: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/2050fcf2-6218-4f97-8030-e9cdf6a93c5a?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/1056f352-e2f5-4b50-95a8-0c960b9cb3dc?api-version=2019-12-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 18 May 2020 15:27:49 GMT + - Wed, 16 Sep 2020 06:20:36 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/2050fcf2-6218-4f97-8030-e9cdf6a93c5a?monitor=true&api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/1056f352-e2f5-4b50-95a8-0c960b9cb3dc?monitor=true&api-version=2019-12-01 pragma: - no-cache server: @@ -2646,7 +3067,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/DeleteGalleryImageVersion3Min;149,Microsoft.Compute/DeleteGalleryImageVersion30Min;999 x-ms-ratelimit-remaining-subscription-deletes: - - '14999' + - '14998' status: code: 202 message: Accepted @@ -2660,23 +3081,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/2050fcf2-6218-4f97-8030-e9cdf6a93c5a?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/1056f352-e2f5-4b50-95a8-0c960b9cb3dc?api-version=2019-12-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:27:49.9277055+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"2050fcf2-6218-4f97-8030-e9cdf6a93c5a\"\ + string: "{\r\n \"startTime\": \"2020-09-16T06:20:36.817992+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"1056f352-e2f5-4b50-95a8-0c960b9cb3dc\"\ \r\n}" headers: cache-control: - no-cache content-length: - - '134' + - '133' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:28:20 GMT + - Wed, 16 Sep 2020 06:21:06 GMT expires: - '-1' pragma: @@ -2693,7 +3114,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1193,Microsoft.Compute/GetOperationStatus30Min;2336 + - Microsoft.Compute/GetOperationStatus3Min;1193,Microsoft.Compute/GetOperationStatus30Min;4114 status: code: 200 message: OK @@ -2707,23 +3128,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/2050fcf2-6218-4f97-8030-e9cdf6a93c5a?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/1056f352-e2f5-4b50-95a8-0c960b9cb3dc?api-version=2019-12-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:27:49.9277055+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"2050fcf2-6218-4f97-8030-e9cdf6a93c5a\"\ + string: "{\r\n \"startTime\": \"2020-09-16T06:20:36.817992+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"1056f352-e2f5-4b50-95a8-0c960b9cb3dc\"\ \r\n}" headers: cache-control: - no-cache content-length: - - '134' + - '133' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:28:50 GMT + - Wed, 16 Sep 2020 06:21:36 GMT expires: - '-1' pragma: @@ -2740,7 +3161,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1191,Microsoft.Compute/GetOperationStatus30Min;2333 + - Microsoft.Compute/GetOperationStatus3Min;1191,Microsoft.Compute/GetOperationStatus30Min;4111 status: code: 200 message: OK @@ -2754,23 +3175,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/2050fcf2-6218-4f97-8030-e9cdf6a93c5a?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/1056f352-e2f5-4b50-95a8-0c960b9cb3dc?api-version=2019-12-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:27:49.9277055+00:00\",\r\n \"\ - endTime\": \"2020-05-18T15:29:20.225221+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"2050fcf2-6218-4f97-8030-e9cdf6a93c5a\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T06:20:36.817992+00:00\",\r\n \"\ + endTime\": \"2020-09-16T06:22:06.974339+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"1056f352-e2f5-4b50-95a8-0c960b9cb3dc\"\r\n}" headers: cache-control: - no-cache content-length: - - '183' + - '182' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:29:20 GMT + - Wed, 16 Sep 2020 06:22:07 GMT expires: - '-1' pragma: @@ -2787,7 +3208,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1189,Microsoft.Compute/GetOperationStatus30Min;2330 + - Microsoft.Compute/GetOperationStatus3Min;1189,Microsoft.Compute/GetOperationStatus30Min;4108 status: code: 200 message: OK @@ -2795,7 +3216,7 @@ interactions: body: null headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate Connection: @@ -2803,7 +3224,7 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/applications/applicationname10bb14a9?api-version=2019-12-01 response: @@ -2815,7 +3236,7 @@ interactions: content-length: - '0' date: - - Mon, 18 May 2020 15:29:20 GMT + - Wed, 16 Sep 2020 06:22:08 GMT expires: - '-1' pragma: @@ -2830,7 +3251,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/DeleteGalleryApplication3Min;49,Microsoft.Compute/DeleteGalleryApplication30Min;299 x-ms-ratelimit-remaining-subscription-deletes: - - '14998' + - '14997' status: code: 200 message: OK @@ -2846,25 +3267,25 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotname10bb14a9/endGetAccess?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotname10bb14a9/endGetAccess?api-version=2020-06-30 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/91c386be-10d5-4e27-b954-85c6dca1dd65?api-version=2019-11-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/1c887b30-8a17-4186-98e8-3c6e2d2001db?api-version=2020-06-30 cache-control: - no-cache content-length: - '0' date: - - Mon, 18 May 2020 15:29:21 GMT + - Wed, 16 Sep 2020 06:22:09 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/91c386be-10d5-4e27-b954-85c6dca1dd65?monitor=true&api-version=2019-11-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/1c887b30-8a17-4186-98e8-3c6e2d2001db?monitor=true&api-version=2020-06-30 pragma: - no-cache server: @@ -2877,7 +3298,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/HighCostSnapshotCreateHydrate3Min;999,Microsoft.Compute/HighCostSnapshotCreateHydrate30Min;7994 x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1197' status: code: 202 message: Accepted @@ -2891,14 +3312,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/91c386be-10d5-4e27-b954-85c6dca1dd65?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/1c887b30-8a17-4186-98e8-3c6e2d2001db?api-version=2020-06-30 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:29:22.0501187+00:00\",\r\n \"\ - endTime\": \"2020-05-18T15:29:22.2063505+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"91c386be-10d5-4e27-b954-85c6dca1dd65\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T06:22:09.6010718+00:00\",\r\n \"\ + endTime\": \"2020-09-16T06:22:09.7416975+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"1c887b30-8a17-4186-98e8-3c6e2d2001db\"\r\n}" headers: cache-control: - no-cache @@ -2907,7 +3328,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:29:52 GMT + - Wed, 16 Sep 2020 06:22:39 GMT expires: - '-1' pragma: @@ -2924,7 +3345,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49996,Microsoft.Compute/GetOperation30Min;399927 + - Microsoft.Compute/GetOperation3Min;49996,Microsoft.Compute/GetOperation30Min;399934 status: code: 200 message: OK @@ -2938,9 +3359,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/91c386be-10d5-4e27-b954-85c6dca1dd65?monitor=true&api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/1c887b30-8a17-4186-98e8-3c6e2d2001db?monitor=true&api-version=2020-06-30 response: body: string: '' @@ -2950,7 +3371,7 @@ interactions: content-length: - '0' date: - - Mon, 18 May 2020 15:29:52 GMT + - Wed, 16 Sep 2020 06:22:40 GMT expires: - '-1' pragma: @@ -2963,7 +3384,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49995,Microsoft.Compute/GetOperation30Min;399926 + - Microsoft.Compute/GetOperation3Min;49995,Microsoft.Compute/GetOperation30Min;399933 status: code: 200 message: OK @@ -2979,25 +3400,25 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotname10bb14a9?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotname10bb14a9?api-version=2020-06-30 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/4a0445b5-762b-4733-8ad4-99ad6bcd6831?api-version=2019-11-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/5bb59ff8-6c74-486b-b022-7c9161fbf6c7?api-version=2020-06-30 cache-control: - no-cache content-length: - '0' date: - - Mon, 18 May 2020 15:29:53 GMT + - Wed, 16 Sep 2020 06:22:41 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/4a0445b5-762b-4733-8ad4-99ad6bcd6831?monitor=true&api-version=2019-11-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/5bb59ff8-6c74-486b-b022-7c9161fbf6c7?monitor=true&api-version=2020-06-30 pragma: - no-cache server: @@ -3008,9 +3429,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/DeleteDisks3Min;996,Microsoft.Compute/DeleteDisks30Min;7989 + - Microsoft.Compute/DeleteDisks3Min;996,Microsoft.Compute/DeleteDisks30Min;7990 x-ms-ratelimit-remaining-subscription-deletes: - - '14997' + - '14996' status: code: 202 message: Accepted @@ -3024,23 +3445,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/4a0445b5-762b-4733-8ad4-99ad6bcd6831?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/5bb59ff8-6c74-486b-b022-7c9161fbf6c7?api-version=2020-06-30 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:29:53.5346081+00:00\",\r\n \"\ - endTime\": \"2020-05-18T15:29:53.7533633+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"4a0445b5-762b-4733-8ad4-99ad6bcd6831\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T06:22:41.5075306+00:00\",\r\n \"\ + endTime\": \"2020-09-16T06:22:41.75755+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"5bb59ff8-6c74-486b-b022-7c9161fbf6c7\"\r\n}" headers: cache-control: - no-cache content-length: - - '184' + - '182' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:30:23 GMT + - Wed, 16 Sep 2020 06:23:11 GMT expires: - '-1' pragma: @@ -3057,7 +3478,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49993,Microsoft.Compute/GetOperation30Min;399924 + - Microsoft.Compute/GetOperation3Min;49993,Microsoft.Compute/GetOperation30Min;399931 status: code: 200 message: OK @@ -3065,7 +3486,7 @@ interactions: body: null headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate Connection: @@ -3073,7 +3494,7 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/images/imagex10bb14a9?api-version=2019-12-01 response: @@ -3081,17 +3502,17 @@ interactions: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/6e181ecc-71fe-46be-b700-49d2f39b701b?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/f7b715ec-1228-41ff-9519-c8b687543203?api-version=2019-12-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 18 May 2020 15:30:24 GMT + - Wed, 16 Sep 2020 06:23:12 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/6e181ecc-71fe-46be-b700-49d2f39b701b?monitor=true&api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/f7b715ec-1228-41ff-9519-c8b687543203?monitor=true&api-version=2019-12-01 pragma: - no-cache server: @@ -3104,7 +3525,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/DeleteGalleryImage3Min;49,Microsoft.Compute/DeleteGalleryImage30Min;299 x-ms-ratelimit-remaining-subscription-deletes: - - '14996' + - '14995' status: code: 202 message: Accepted @@ -3118,14 +3539,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/6e181ecc-71fe-46be-b700-49d2f39b701b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/f7b715ec-1228-41ff-9519-c8b687543203?api-version=2019-12-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:30:24.7570972+00:00\",\r\n \"\ - endTime\": \"2020-05-18T15:30:25.0070675+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"6e181ecc-71fe-46be-b700-49d2f39b701b\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T06:23:13.4587481+00:00\",\r\n \"\ + endTime\": \"2020-09-16T06:23:13.6779008+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"f7b715ec-1228-41ff-9519-c8b687543203\"\r\n}" headers: cache-control: - no-cache @@ -3134,7 +3555,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:30:54 GMT + - Wed, 16 Sep 2020 06:23:43 GMT expires: - '-1' pragma: @@ -3151,7 +3572,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1189,Microsoft.Compute/GetOperationStatus30Min;2327 + - Microsoft.Compute/GetOperationStatus3Min;1190,Microsoft.Compute/GetOperationStatus30Min;4105 status: code: 200 message: OK @@ -3159,7 +3580,7 @@ interactions: body: null headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate Connection: @@ -3167,7 +3588,7 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9?api-version=2019-12-01 response: @@ -3175,17 +3596,17 @@ interactions: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/63203272-f1f5-45b6-ba03-5b8157c35c7f?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/fd7ea217-255c-4ab4-b3ec-9ae6b3ce2db9?api-version=2019-12-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 18 May 2020 15:30:55 GMT + - Wed, 16 Sep 2020 06:23:44 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/63203272-f1f5-45b6-ba03-5b8157c35c7f?monitor=true&api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/fd7ea217-255c-4ab4-b3ec-9ae6b3ce2db9?monitor=true&api-version=2019-12-01 pragma: - no-cache server: @@ -3198,7 +3619,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/DeleteGallery3Min;49,Microsoft.Compute/DeleteGallery30Min;299 x-ms-ratelimit-remaining-subscription-deletes: - - '14995' + - '14994' status: code: 202 message: Accepted @@ -3212,14 +3633,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/63203272-f1f5-45b6-ba03-5b8157c35c7f?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/fd7ea217-255c-4ab4-b3ec-9ae6b3ce2db9?api-version=2019-12-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:30:55.7257882+00:00\",\r\n \"\ - endTime\": \"2020-05-18T15:30:55.8507654+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"63203272-f1f5-45b6-ba03-5b8157c35c7f\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T06:23:44.7244274+00:00\",\r\n \"\ + endTime\": \"2020-09-16T06:23:44.8494275+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"fd7ea217-255c-4ab4-b3ec-9ae6b3ce2db9\"\r\n}" headers: cache-control: - no-cache @@ -3228,7 +3649,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:31:25 GMT + - Wed, 16 Sep 2020 06:24:14 GMT expires: - '-1' pragma: @@ -3245,7 +3666,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1190,Microsoft.Compute/GetOperationStatus30Min;2325 + - Microsoft.Compute/GetOperationStatus3Min;1191,Microsoft.Compute/GetOperationStatus30Min;4103 status: code: 200 message: OK diff --git a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vm.test_compute_vm.yaml b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vm.test_compute_vm.yaml index f43b58cbac51..e18a89d75de0 100644 --- a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vm.test_compute_vm.yaml +++ b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vm.test_compute_vm.yaml @@ -12,21 +12,18 @@ interactions: Content-Length: - '92' Content-Type: - - application/json; charset=utf-8 + - application/json User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex15cf0eff?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex15cf0eff?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"networknamex15cf0eff\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex15cf0eff\"\ - ,\r\n \"etag\": \"W/\\\"3141de32-22a5-4025-a2de-4e26db37b26e\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"36749651-a214-45a6-9c88-e877587f713f\\\"\",\r\n \ \ \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \ - \ \"resourceGuid\": \"08743518-830f-4715-a435-09bd0c5bd3c1\",\r\n \"\ + \ \"resourceGuid\": \"549ab2cf-812b-4497-8e53-92af777cd591\",\r\n \"\ addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\ \r\n ]\r\n },\r\n \"subnets\": [],\r\n \"virtualNetworkPeerings\"\ : [],\r\n \"enableDdosProtection\": false,\r\n \"enableVmProtection\"\ @@ -35,15 +32,15 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/68480ca8-3f63-4798-bd6a-fba762449349?api-version=2020-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/567ff67b-80e3-4933-8f20-4ac619a519fa?api-version=2020-06-01 cache-control: - no-cache content-length: - - '696' + - '727' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:31:36 GMT + - Wed, 16 Sep 2020 06:24:35 GMT expires: - '-1' pragma: @@ -56,9 +53,9 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 9a188f69-0eb0-403f-a1c3-591b45e278b7 + - 6a7eef99-f2e7-4af6-b0e0-7ff43259aa55 x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1195' status: code: 201 message: Created @@ -66,16 +63,15 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/68480ca8-3f63-4798-bd6a-fba762449349?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/567ff67b-80e3-4933-8f20-4ac619a519fa?api-version=2020-06-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -87,7 +83,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:31:40 GMT + - Wed, 16 Sep 2020 06:24:39 GMT expires: - '-1' pragma: @@ -104,7 +100,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - bcf2f69a-88aa-42cd-8ca1-efdda1e33a63 + - 93038688-6025-4b77-bd58-8449fb0998c0 status: code: 200 message: OK @@ -112,23 +108,22 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex15cf0eff?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex15cf0eff?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"networknamex15cf0eff\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex15cf0eff\"\ - ,\r\n \"etag\": \"W/\\\"840ba359-7c59-45cc-8d91-8e3fa33d7e3e\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"099e66d2-f2a1-4e26-bdc0-cc522b2bca4e\\\"\",\r\n \ \ \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n\ - \ \"resourceGuid\": \"08743518-830f-4715-a435-09bd0c5bd3c1\",\r\n \"\ + \ \"resourceGuid\": \"549ab2cf-812b-4497-8e53-92af777cd591\",\r\n \"\ addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\ \r\n ]\r\n },\r\n \"subnets\": [],\r\n \"virtualNetworkPeerings\"\ : [],\r\n \"enableDdosProtection\": false,\r\n \"enableVmProtection\"\ @@ -137,13 +132,13 @@ interactions: cache-control: - no-cache content-length: - - '697' + - '728' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:31:41 GMT + - Wed, 16 Sep 2020 06:24:40 GMT etag: - - W/"840ba359-7c59-45cc-8d91-8e3fa33d7e3e" + - W/"099e66d2-f2a1-4e26-bdc0-cc522b2bca4e" expires: - '-1' pragma: @@ -160,7 +155,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - d1d82193-77ec-4737-8a80-bc5b0dced5cd + - d26f2f6f-e600-4377-88bd-127fa8816f54 status: code: 200 message: OK @@ -176,33 +171,30 @@ interactions: Content-Length: - '48' Content-Type: - - application/json; charset=utf-8 + - application/json User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex15cf0eff/subnets/subnetx15cf0eff?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex15cf0eff/subnets/subnetx15cf0eff?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"subnetx15cf0eff\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex15cf0eff/subnets/subnetx15cf0eff\"\ - ,\r\n \"etag\": \"W/\\\"a1570134-15f1-434c-830b-686d2349aaf7\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"c1b6c345-6083-4db8-b43b-e489646ffc49\\\"\",\r\n \ \ \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"\ addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\"\ : \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\ \n },\r\n \"type\": \"Microsoft.Network/virtualNetworks/subnets\"\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/a199f480-f875-4580-83ad-b22920f1529e?api-version=2020-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/7c8f96a8-4642-4d30-9c15-e633d373dca7?api-version=2020-06-01 cache-control: - no-cache content-length: - - '585' + - '616' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:31:42 GMT + - Wed, 16 Sep 2020 06:24:40 GMT expires: - '-1' pragma: @@ -215,9 +207,9 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 28aad5fa-9de9-4f07-b5be-8b68236f5666 + - 37e78d2e-e375-4fb4-9faa-6374ee925188 x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1194' status: code: 201 message: Created @@ -225,16 +217,15 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/a199f480-f875-4580-83ad-b22920f1529e?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/7c8f96a8-4642-4d30-9c15-e633d373dca7?api-version=2020-06-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -246,7 +237,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:31:46 GMT + - Wed, 16 Sep 2020 06:24:44 GMT expires: - '-1' pragma: @@ -263,7 +254,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - e4f424bb-e277-474c-a4ed-2d80269c7ee4 + - 1c0ad23c-a910-4a5e-8b86-959e666f4740 status: code: 200 message: OK @@ -271,20 +262,19 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex15cf0eff/subnets/subnetx15cf0eff?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex15cf0eff/subnets/subnetx15cf0eff?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"subnetx15cf0eff\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex15cf0eff/subnets/subnetx15cf0eff\"\ - ,\r\n \"etag\": \"W/\\\"f0e69955-9fba-44d5-afd4-bd8983123c8b\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"1a9d9f06-189f-4e8d-aceb-b40bb2222431\\\"\",\r\n \ \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"\ addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\"\ : \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\ @@ -293,13 +283,13 @@ interactions: cache-control: - no-cache content-length: - - '586' + - '617' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:31:46 GMT + - Wed, 16 Sep 2020 06:24:44 GMT etag: - - W/"f0e69955-9fba-44d5-afd4-bd8983123c8b" + - W/"1a9d9f06-189f-4e8d-aceb-b40bb2222431" expires: - '-1' pragma: @@ -316,14 +306,13 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - b428ad49-d571-4916-b18c-da805e02f850 + - 0f15d3d9-89c9-49e7-8cbf-6364dbf05a24 status: code: 200 message: OK - request: - body: 'b''{"location": "eastus", "properties": {"ipConfigurations": [{"properties": - {"subnet": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex15cf0eff/subnets/subnetx15cf0eff"}}, - "name": "MyIpConfig"}]}}''' + body: 'b''b\''{"location": "eastus", "properties": {"ipConfigurations": [{"name": + "MyIpConfig", "properties": {"subnet": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex15cf0eff/subnets/subnetx15cf0eff"}}}]}}\''''' headers: Accept: - application/json @@ -332,25 +321,22 @@ interactions: Connection: - keep-alive Content-Length: - - '322' + - '353' Content-Type: - - application/json; charset=utf-8 + - application/json User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacex15cf0eff?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacex15cf0eff?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"interfacex15cf0eff\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacex15cf0eff\"\ - ,\r\n \"etag\": \"W/\\\"ea3f7b20-79c9-4307-aa51-b138febf07bd\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"c13758d0-0415-4152-bbc4-d5c118c7de62\\\"\",\r\n \ \ \"location\": \"eastus\",\r\n \"properties\": {\r\n \"provisioningState\"\ - : \"Succeeded\",\r\n \"resourceGuid\": \"584fbc84-9284-40a7-895c-1fc59465254c\"\ + : \"Succeeded\",\r\n \"resourceGuid\": \"87dd5f4a-045d-4333-8157-e0466bfbd2b2\"\ ,\r\n \"ipConfigurations\": [\r\n {\r\n \"name\": \"MyIpConfig\"\ ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacex15cf0eff/ipConfigurations/MyIpConfig\"\ - ,\r\n \"etag\": \"W/\\\"ea3f7b20-79c9-4307-aa51-b138febf07bd\\\"\"\ + ,\r\n \"etag\": \"W/\\\"c13758d0-0415-4152-bbc4-d5c118c7de62\\\"\"\ ,\r\n \"type\": \"Microsoft.Network/networkInterfaces/ipConfigurations\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\ ,\r\n \"privateIPAddress\": \"10.0.0.4\",\r\n \"privateIPAllocationMethod\"\ @@ -358,7 +344,7 @@ interactions: \r\n },\r\n \"primary\": true,\r\n \"privateIPAddressVersion\"\ : \"IPv4\"\r\n }\r\n }\r\n ],\r\n \"dnsSettings\": {\r\n\ \ \"dnsServers\": [],\r\n \"appliedDnsServers\": [],\r\n \"\ - internalDomainNameSuffix\": \"da0xicapqmkupjbvbg4qyw4tyb.bx.internal.cloudapp.net\"\ + internalDomainNameSuffix\": \"z4zjuvblqglujdstskxxo5gvsb.bx.internal.cloudapp.net\"\ \r\n },\r\n \"enableAcceleratedNetworking\": false,\r\n \"enableIPForwarding\"\ : false,\r\n \"hostedWorkloads\": [],\r\n \"tapConfigurations\": [],\r\ \n \"nicType\": \"Standard\"\r\n },\r\n \"type\": \"Microsoft.Network/networkInterfaces\"\ @@ -367,15 +353,15 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/343ae6a4-6307-4c5c-b18a-9fefc3cc9d14?api-version=2020-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/441e5639-7105-4d0b-840f-2ad724ab11dd?api-version=2020-06-01 cache-control: - no-cache content-length: - - '1770' + - '1863' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:31:48 GMT + - Wed, 16 Sep 2020 06:24:49 GMT expires: - '-1' pragma: @@ -388,9 +374,9 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - cde49b0a-800c-4fc4-aaa3-6ecd08762520 + - 943c9c3c-8de1-4675-a91a-f2dc6e142df1 x-ms-ratelimit-remaining-subscription-writes: - - '1196' + - '1193' status: code: 201 message: Created @@ -398,16 +384,15 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/343ae6a4-6307-4c5c-b18a-9fefc3cc9d14?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/441e5639-7105-4d0b-840f-2ad724ab11dd?api-version=2020-06-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -419,7 +404,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:32:19 GMT + - Wed, 16 Sep 2020 06:25:20 GMT expires: - '-1' pragma: @@ -436,7 +421,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - e9108839-97c5-43eb-a0f6-030fcd38059d + - d171bc48-97b6-4264-8703-cc2ccd439143 status: code: 200 message: OK @@ -444,25 +429,24 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacex15cf0eff?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacex15cf0eff?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"interfacex15cf0eff\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacex15cf0eff\"\ - ,\r\n \"etag\": \"W/\\\"ea3f7b20-79c9-4307-aa51-b138febf07bd\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"c13758d0-0415-4152-bbc4-d5c118c7de62\\\"\",\r\n \ \ \"location\": \"eastus\",\r\n \"properties\": {\r\n \"provisioningState\"\ - : \"Succeeded\",\r\n \"resourceGuid\": \"584fbc84-9284-40a7-895c-1fc59465254c\"\ + : \"Succeeded\",\r\n \"resourceGuid\": \"87dd5f4a-045d-4333-8157-e0466bfbd2b2\"\ ,\r\n \"ipConfigurations\": [\r\n {\r\n \"name\": \"MyIpConfig\"\ ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacex15cf0eff/ipConfigurations/MyIpConfig\"\ - ,\r\n \"etag\": \"W/\\\"ea3f7b20-79c9-4307-aa51-b138febf07bd\\\"\"\ + ,\r\n \"etag\": \"W/\\\"c13758d0-0415-4152-bbc4-d5c118c7de62\\\"\"\ ,\r\n \"type\": \"Microsoft.Network/networkInterfaces/ipConfigurations\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\ ,\r\n \"privateIPAddress\": \"10.0.0.4\",\r\n \"privateIPAllocationMethod\"\ @@ -470,7 +454,7 @@ interactions: \r\n },\r\n \"primary\": true,\r\n \"privateIPAddressVersion\"\ : \"IPv4\"\r\n }\r\n }\r\n ],\r\n \"dnsSettings\": {\r\n\ \ \"dnsServers\": [],\r\n \"appliedDnsServers\": [],\r\n \"\ - internalDomainNameSuffix\": \"da0xicapqmkupjbvbg4qyw4tyb.bx.internal.cloudapp.net\"\ + internalDomainNameSuffix\": \"z4zjuvblqglujdstskxxo5gvsb.bx.internal.cloudapp.net\"\ \r\n },\r\n \"enableAcceleratedNetworking\": false,\r\n \"enableIPForwarding\"\ : false,\r\n \"hostedWorkloads\": [],\r\n \"tapConfigurations\": [],\r\ \n \"nicType\": \"Standard\"\r\n },\r\n \"type\": \"Microsoft.Network/networkInterfaces\"\ @@ -479,13 +463,13 @@ interactions: cache-control: - no-cache content-length: - - '1770' + - '1863' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:32:19 GMT + - Wed, 16 Sep 2020 06:25:20 GMT etag: - - W/"ea3f7b20-79c9-4307-aa51-b138febf07bd" + - W/"c13758d0-0415-4152-bbc4-d5c118c7de62" expires: - '-1' pragma: @@ -502,12 +486,12 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - f986b561-e1f7-4a90-b8f8-4060834675d5 + - 51624c31-ad87-43a8-9107-236c2215b51f status: code: 200 message: OK - request: - body: 'b''{"location": "eastus", "properties": {"hardwareProfile": {"vmSize": + body: 'b''b\''{"location": "eastus", "properties": {"hardwareProfile": {"vmSize": "Standard_D2_v2"}, "storageProfile": {"imageReference": {"publisher": "MicrosoftWindowsServer", "offer": "WindowsServer", "sku": "2016-Datacenter", "version": "latest"}, "osDisk": {"name": "myVMosdisk", "caching": "ReadWrite", "createOption": "FromImage", @@ -516,7 +500,7 @@ interactions: "Empty", "diskSizeGB": 1023}]}, "osProfile": {"computerName": "myVM", "adminUsername": "testuser", "adminPassword": "Aa1!zyx_", "windowsConfiguration": {"enableAutomaticUpdates": true}}, "networkProfile": {"networkInterfaces": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacex15cf0eff", - "properties": {"primary": true}}]}}}''' + "properties": {"primary": true}}]}}}\''''' headers: Accept: - application/json @@ -525,23 +509,23 @@ interactions: Connection: - keep-alive Content-Length: - - '929' + - '960' Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"virtualmachinex15cf0eff\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff\"\ ,\r\n \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\"\ - : \"eastus\",\r\n \"properties\": {\r\n \"vmId\": \"ab70a5c7-54fb-4278-830e-d4e3636657b2\"\ + : \"eastus\",\r\n \"properties\": {\r\n \"vmId\": \"d513c9d3-b764-446e-b2cd-7613552ca441\"\ ,\r\n \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_D2_v2\"\r\n\ \ },\r\n \"storageProfile\": {\r\n \"imageReference\": {\r\n \ \ \"publisher\": \"MicrosoftWindowsServer\",\r\n \"offer\": \"\ WindowsServer\",\r\n \"sku\": \"2016-Datacenter\",\r\n \"version\"\ - : \"latest\",\r\n \"exactVersion\": \"14393.3686.2005061700\"\r\n \ + : \"latest\",\r\n \"exactVersion\": \"14393.3930.2009041537\"\r\n \ \ },\r\n \"osDisk\": {\r\n \"osType\": \"Windows\",\r\n \ \ \"name\": \"myVMosdisk\",\r\n \"createOption\": \"FromImage\"\ ,\r\n \"caching\": \"ReadWrite\",\r\n \"managedDisk\": {\r\n\ @@ -558,7 +542,8 @@ interactions: \ }\r\n ]\r\n },\r\n \"osProfile\": {\r\n \"computerName\"\ : \"myVM\",\r\n \"adminUsername\": \"testuser\",\r\n \"windowsConfiguration\"\ : {\r\n \"provisionVMAgent\": true,\r\n \"enableAutomaticUpdates\"\ - : true\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\"\ + : true,\r\n \"patchSettings\": {\r\n \"patchMode\": \"AutomaticByOS\"\ + \r\n }\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\"\ : true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"\ networkProfile\": {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacex15cf0eff\"\ ,\"properties\":{\"primary\":true}}]},\r\n \"provisioningState\": \"Creating\"\ @@ -567,15 +552,15 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/97b9b485-598e-40b7-8fc3-c0b31c903929?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f2d158a7-0add-4839-9db6-43fd819c7b0b?api-version=2020-06-01 cache-control: - no-cache content-length: - - '2175' + - '2317' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:32:26 GMT + - Wed, 16 Sep 2020 06:25:35 GMT expires: - '-1' pragma: @@ -588,9 +573,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/PutVM3Min;574,Microsoft.Compute/PutVM30Min;2878 + - Microsoft.Compute/PutVM3Min;239,Microsoft.Compute/PutVM30Min;1199 x-ms-ratelimit-remaining-subscription-writes: - - '1196' + - '1187' status: code: 201 message: Created @@ -604,13 +589,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/97b9b485-598e-40b7-8fc3-c0b31c903929?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f2d158a7-0add-4839-9db6-43fd819c7b0b?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:32:26.3091412+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"97b9b485-598e-40b7-8fc3-c0b31c903929\"\ + string: "{\r\n \"startTime\": \"2020-09-16T06:25:34.0252913+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"f2d158a7-0add-4839-9db6-43fd819c7b0b\"\ \r\n}" headers: cache-control: @@ -620,7 +605,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:32:37 GMT + - Wed, 16 Sep 2020 06:25:45 GMT expires: - '-1' pragma: @@ -637,7 +622,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14999,Microsoft.Compute/GetOperation30Min;29974 + - Microsoft.Compute/GetOperation3Min;14999,Microsoft.Compute/GetOperation30Min;29997 status: code: 200 message: OK @@ -651,13 +636,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/97b9b485-598e-40b7-8fc3-c0b31c903929?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f2d158a7-0add-4839-9db6-43fd819c7b0b?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:32:26.3091412+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"97b9b485-598e-40b7-8fc3-c0b31c903929\"\ + string: "{\r\n \"startTime\": \"2020-09-16T06:25:34.0252913+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"f2d158a7-0add-4839-9db6-43fd819c7b0b\"\ \r\n}" headers: cache-control: @@ -667,7 +652,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:33:27 GMT + - Wed, 16 Sep 2020 06:26:35 GMT expires: - '-1' pragma: @@ -684,7 +669,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14998,Microsoft.Compute/GetOperation30Min;29973 + - Microsoft.Compute/GetOperation3Min;14998,Microsoft.Compute/GetOperation30Min;29996 status: code: 200 message: OK @@ -698,23 +683,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/97b9b485-598e-40b7-8fc3-c0b31c903929?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f2d158a7-0add-4839-9db6-43fd819c7b0b?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:32:26.3091412+00:00\",\r\n \"\ - endTime\": \"2020-05-18T15:33:32.575151+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"97b9b485-598e-40b7-8fc3-c0b31c903929\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T06:25:34.0252913+00:00\",\r\n \"\ + endTime\": \"2020-09-16T06:26:48.2915372+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"f2d158a7-0add-4839-9db6-43fd819c7b0b\"\r\n}" headers: cache-control: - no-cache content-length: - - '183' + - '184' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:33:56 GMT + - Wed, 16 Sep 2020 06:27:05 GMT expires: - '-1' pragma: @@ -731,7 +716,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14996,Microsoft.Compute/GetOperation30Min;29971 + - Microsoft.Compute/GetOperation3Min;14996,Microsoft.Compute/GetOperation30Min;29994 status: code: 200 message: OK @@ -745,54 +730,55 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"virtualmachinex15cf0eff\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff\"\ ,\r\n \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\"\ - : \"eastus\",\r\n \"properties\": {\r\n \"vmId\": \"ab70a5c7-54fb-4278-830e-d4e3636657b2\"\ + : \"eastus\",\r\n \"properties\": {\r\n \"vmId\": \"d513c9d3-b764-446e-b2cd-7613552ca441\"\ ,\r\n \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_D2_v2\"\r\n\ \ },\r\n \"storageProfile\": {\r\n \"imageReference\": {\r\n \ \ \"publisher\": \"MicrosoftWindowsServer\",\r\n \"offer\": \"\ WindowsServer\",\r\n \"sku\": \"2016-Datacenter\",\r\n \"version\"\ - : \"latest\",\r\n \"exactVersion\": \"14393.3686.2005061700\"\r\n \ + : \"latest\",\r\n \"exactVersion\": \"14393.3930.2009041537\"\r\n \ \ },\r\n \"osDisk\": {\r\n \"osType\": \"Windows\",\r\n \ \ \"name\": \"myVMosdisk\",\r\n \"createOption\": \"FromImage\"\ ,\r\n \"caching\": \"ReadWrite\",\r\n \"managedDisk\": {\r\n\ \ \"storageAccountType\": \"Standard_LRS\",\r\n \"id\":\ - \ \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/myVMosdisk\"\ + \ \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/FAXZB4WAN4C5ZDFF2TSY6FQPLDOK5YNVP7S75Z543ONA77DLSBCJ2FIIF4EPNL6GSZTONVX7NEN/providers/Microsoft.Compute/disks/myVMosdisk\"\ \r\n },\r\n \"diskSizeGB\": 127\r\n },\r\n \"dataDisks\"\ - : [\r\n {\r\n \"lun\": 0,\r\n \"name\": \"virtualmachinex15cf0eff_disk2_f1a5fa7495ce4869939f251422bf7e5d\"\ + : [\r\n {\r\n \"lun\": 0,\r\n \"name\": \"virtualmachinex15cf0eff_disk2_361599c7f509421eadec1b2964391d52\"\ ,\r\n \"createOption\": \"Empty\",\r\n \"caching\": \"None\"\ ,\r\n \"managedDisk\": {\r\n \"storageAccountType\": \"\ - Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/virtualmachinex15cf0eff_disk2_f1a5fa7495ce4869939f251422bf7e5d\"\ + Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/FAXZB4WAN4C5ZDFF2TSY6FQPLDOK5YNVP7S75Z543ONA77DLSBCJ2FIIF4EPNL6GSZTONVX7NEN/providers/Microsoft.Compute/disks/virtualmachinex15cf0eff_disk2_361599c7f509421eadec1b2964391d52\"\ \r\n },\r\n \"diskSizeGB\": 1023,\r\n \"toBeDetached\"\ : false\r\n },\r\n {\r\n \"lun\": 1,\r\n \"\ - name\": \"virtualmachinex15cf0eff_disk3_c01d0c9587e249aa992d4b95d8674c96\"\ + name\": \"virtualmachinex15cf0eff_disk3_91f87690dd80480883677659a660dda4\"\ ,\r\n \"createOption\": \"Empty\",\r\n \"caching\": \"None\"\ ,\r\n \"managedDisk\": {\r\n \"storageAccountType\": \"\ - Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/virtualmachinex15cf0eff_disk3_c01d0c9587e249aa992d4b95d8674c96\"\ + Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/FAXZB4WAN4C5ZDFF2TSY6FQPLDOK5YNVP7S75Z543ONA77DLSBCJ2FIIF4EPNL6GSZTONVX7NEN/providers/Microsoft.Compute/disks/virtualmachinex15cf0eff_disk3_91f87690dd80480883677659a660dda4\"\ \r\n },\r\n \"diskSizeGB\": 1023,\r\n \"toBeDetached\"\ : false\r\n }\r\n ]\r\n },\r\n \"osProfile\": {\r\n \ \ \"computerName\": \"myVM\",\r\n \"adminUsername\": \"testuser\",\r\ \n \"windowsConfiguration\": {\r\n \"provisionVMAgent\": true,\r\ - \n \"enableAutomaticUpdates\": true\r\n },\r\n \"secrets\"\ - : [],\r\n \"allowExtensionOperations\": true,\r\n \"requireGuestProvisionSignal\"\ - : true\r\n },\r\n \"networkProfile\": {\"networkInterfaces\":[{\"id\"\ - :\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacex15cf0eff\"\ + \n \"enableAutomaticUpdates\": true,\r\n \"patchSettings\":\ + \ {\r\n \"patchMode\": \"AutomaticByOS\"\r\n }\r\n },\r\ + \n \"secrets\": [],\r\n \"allowExtensionOperations\": true,\r\n\ + \ \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\"\ + : {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacex15cf0eff\"\ ,\"properties\":{\"primary\":true}}]},\r\n \"provisioningState\": \"Succeeded\"\ \r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '2985' + - '3220' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:33:56 GMT + - Wed, 16 Sep 2020 06:27:06 GMT expires: - '-1' pragma: @@ -809,7 +795,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;3997,Microsoft.Compute/LowCostGet30Min;31985 + - Microsoft.Compute/LowCostGet3Min;3997,Microsoft.Compute/LowCostGet30Min;31993 status: code: 200 message: OK @@ -829,9 +815,9 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/extensions/virtualmachineextensionx15cf0eff?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/extensions/virtualmachineextensionx15cf0eff?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"virtualmachineextensionx15cf0eff\",\r\n \"id\"\ @@ -845,15 +831,15 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4768f234-dd33-4c85-bb81-a7016f4a7855?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/979aa4e9-da8b-4ec2-99ee-e69f10affeec?api-version=2020-06-01 cache-control: - no-cache content-length: - - '599' + - '630' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:34:01 GMT + - Wed, 16 Sep 2020 06:27:13 GMT expires: - '-1' pragma: @@ -868,7 +854,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/UpdateVM3Min;239,Microsoft.Compute/UpdateVM30Min;1199 x-ms-ratelimit-remaining-subscription-writes: - - '1195' + - '1186' status: code: 201 message: Created @@ -882,13 +868,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4768f234-dd33-4c85-bb81-a7016f4a7855?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/979aa4e9-da8b-4ec2-99ee-e69f10affeec?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:34:00.4034358+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"4768f234-dd33-4c85-bb81-a7016f4a7855\"\ + string: "{\r\n \"startTime\": \"2020-09-16T06:27:12.9948556+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"979aa4e9-da8b-4ec2-99ee-e69f10affeec\"\ \r\n}" headers: cache-control: @@ -898,7 +884,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:34:31 GMT + - Wed, 16 Sep 2020 06:27:44 GMT expires: - '-1' pragma: @@ -915,7 +901,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14995,Microsoft.Compute/GetOperation30Min;29970 + - Microsoft.Compute/GetOperation3Min;14995,Microsoft.Compute/GetOperation30Min;29993 status: code: 200 message: OK @@ -929,13 +915,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4768f234-dd33-4c85-bb81-a7016f4a7855?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/979aa4e9-da8b-4ec2-99ee-e69f10affeec?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:34:00.4034358+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"4768f234-dd33-4c85-bb81-a7016f4a7855\"\ + string: "{\r\n \"startTime\": \"2020-09-16T06:27:12.9948556+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"979aa4e9-da8b-4ec2-99ee-e69f10affeec\"\ \r\n}" headers: cache-control: @@ -945,7 +931,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:35:01 GMT + - Wed, 16 Sep 2020 06:28:14 GMT expires: - '-1' pragma: @@ -962,7 +948,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14994,Microsoft.Compute/GetOperation30Min;29978 + - Microsoft.Compute/GetOperation3Min;14994,Microsoft.Compute/GetOperation30Min;29992 status: code: 200 message: OK @@ -976,14 +962,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4768f234-dd33-4c85-bb81-a7016f4a7855?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/979aa4e9-da8b-4ec2-99ee-e69f10affeec?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:34:00.4034358+00:00\",\r\n \"\ - endTime\": \"2020-05-18T15:35:27.5133178+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"4768f234-dd33-4c85-bb81-a7016f4a7855\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T06:27:12.9948556+00:00\",\r\n \"\ + endTime\": \"2020-09-16T06:28:41.1985743+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"979aa4e9-da8b-4ec2-99ee-e69f10affeec\"\r\n}" headers: cache-control: - no-cache @@ -992,7 +978,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:35:31 GMT + - Wed, 16 Sep 2020 06:28:44 GMT expires: - '-1' pragma: @@ -1009,7 +995,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29976 + - Microsoft.Compute/GetOperation3Min;14994,Microsoft.Compute/GetOperation30Min;29991 status: code: 200 message: OK @@ -1023,9 +1009,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/extensions/virtualmachineextensionx15cf0eff?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/extensions/virtualmachineextensionx15cf0eff?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"virtualmachineextensionx15cf0eff\",\r\n \"id\"\ @@ -1039,11 +1025,11 @@ interactions: cache-control: - no-cache content-length: - - '600' + - '631' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:35:31 GMT + - Wed, 16 Sep 2020 06:28:45 GMT expires: - '-1' pragma: @@ -1060,7 +1046,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;3995,Microsoft.Compute/LowCostGet30Min;31983 + - Microsoft.Compute/LowCostGet3Min;3996,Microsoft.Compute/LowCostGet30Min;31992 status: code: 200 message: OK @@ -1074,59 +1060,59 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/instanceView?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/instanceView?api-version=2020-06-01 response: body: string: "{\r\n \"computerName\": \"myVM\",\r\n \"osName\": \"Windows Server\ \ 2016 Datacenter\",\r\n \"osVersion\": \"Microsoft Windows NT 10.0.14393.0\"\ - ,\r\n \"vmAgent\": {\r\n \"vmAgentVersion\": \"2.7.41491.963\",\r\n \ + ,\r\n \"vmAgent\": {\r\n \"vmAgentVersion\": \"2.7.41491.992\",\r\n \ \ \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\"\ ,\r\n \"level\": \"Info\",\r\n \"displayStatus\": \"Ready\"\ - ,\r\n \"message\": \"GuestAgent is running and accepting new configurations.\"\ - ,\r\n \"time\": \"2020-05-18T15:35:19+00:00\"\r\n }\r\n ],\r\ + ,\r\n \"message\": \"GuestAgent is running and processing the extensions.\"\ + ,\r\n \"time\": \"2020-09-16T06:28:38+00:00\"\r\n }\r\n ],\r\ \n \"extensionHandlers\": [\r\n {\r\n \"type\": \"Microsoft.Azure.NetworkWatcher.NetworkWatcherAgentWindows\"\ - ,\r\n \"typeHandlerVersion\": \"1.4.1421.1\",\r\n \"status\"\ + ,\r\n \"typeHandlerVersion\": \"1.4.1587.1\",\r\n \"status\"\ : {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n \"\ level\": \"Info\",\r\n \"displayStatus\": \"Ready\",\r\n \ \ \"message\": \"Plugin enabled (handler name: Microsoft.Azure.NetworkWatcher.NetworkWatcherAgentWindows,\ - \ extension name: , version: 1.4.1421.1).\"\r\n }\r\n }\r\n \ + \ extension name: , version: 1.4.1587.1).\"\r\n }\r\n }\r\n \ \ ]\r\n },\r\n \"disks\": [\r\n {\r\n \"name\": \"myVMosdisk\"\ ,\r\n \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\"\ ,\r\n \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning\ - \ succeeded\",\r\n \"time\": \"2020-05-18T15:32:28.2779015+00:00\"\ - \r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"virtualmachinex15cf0eff_disk2_f1a5fa7495ce4869939f251422bf7e5d\"\ + \ succeeded\",\r\n \"time\": \"2020-09-16T06:25:35.9159962+00:00\"\ + \r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"virtualmachinex15cf0eff_disk2_361599c7f509421eadec1b2964391d52\"\ ,\r\n \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\"\ ,\r\n \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning\ - \ succeeded\",\r\n \"time\": \"2020-05-18T15:32:28.2779015+00:00\"\ - \r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"virtualmachinex15cf0eff_disk3_c01d0c9587e249aa992d4b95d8674c96\"\ + \ succeeded\",\r\n \"time\": \"2020-09-16T06:25:35.9159962+00:00\"\ + \r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"virtualmachinex15cf0eff_disk3_91f87690dd80480883677659a660dda4\"\ ,\r\n \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\"\ ,\r\n \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning\ - \ succeeded\",\r\n \"time\": \"2020-05-18T15:32:28.2779015+00:00\"\ + \ succeeded\",\r\n \"time\": \"2020-09-16T06:25:35.9159962+00:00\"\ \r\n }\r\n ]\r\n }\r\n ],\r\n \"extensions\": [\r\n {\r\ \n \"name\": \"virtualmachineextensionx15cf0eff\",\r\n \"type\"\ : \"Microsoft.Azure.NetworkWatcher.NetworkWatcherAgentWindows\",\r\n \ - \ \"typeHandlerVersion\": \"1.4.1421.1\",\r\n \"statuses\": [\r\n \ + \ \"typeHandlerVersion\": \"1.4.1587.1\",\r\n \"statuses\": [\r\n \ \ {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n \ \ \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning succeeded\"\ ,\r\n \"message\": \"Plugin enabled (handler name: Microsoft.Azure.NetworkWatcher.NetworkWatcherAgentWindows,\ - \ extension name: , version: 1.4.1421.1).\"\r\n }\r\n ]\r\n \ + \ extension name: , version: 1.4.1587.1).\"\r\n }\r\n ]\r\n \ \ }\r\n ],\r\n \"hyperVGeneration\": \"V1\",\r\n \"statuses\": [\r\n \ \ {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n \"level\"\ : \"Info\",\r\n \"displayStatus\": \"Provisioning succeeded\",\r\n \ - \ \"time\": \"2020-05-18T15:35:27.4977117+00:00\"\r\n },\r\n {\r\n\ + \ \"time\": \"2020-09-16T06:28:41.1829637+00:00\"\r\n },\r\n {\r\n\ \ \"code\": \"PowerState/running\",\r\n \"level\": \"Info\",\r\n\ \ \"displayStatus\": \"VM running\"\r\n }\r\n ]\r\n}" headers: cache-control: - no-cache content-length: - - '2814' + - '2811' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:35:31 GMT + - Wed, 16 Sep 2020 06:28:45 GMT expires: - '-1' pragma: @@ -1143,7 +1129,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;3994,Microsoft.Compute/LowCostGet30Min;31982 + - Microsoft.Compute/LowCostGet3Min;3995,Microsoft.Compute/LowCostGet30Min;31991 status: code: 200 message: OK @@ -1157,9 +1143,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/extensions/virtualmachineextensionx15cf0eff?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/extensions/virtualmachineextensionx15cf0eff?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"virtualmachineextensionx15cf0eff\",\r\n \"id\"\ @@ -1173,11 +1159,11 @@ interactions: cache-control: - no-cache content-length: - - '600' + - '631' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:35:31 GMT + - Wed, 16 Sep 2020 06:28:45 GMT expires: - '-1' pragma: @@ -1194,7 +1180,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;3993,Microsoft.Compute/LowCostGet30Min;31981 + - Microsoft.Compute/LowCostGet3Min;3993,Microsoft.Compute/LowCostGet30Min;31989 status: code: 200 message: OK @@ -1202,15 +1188,15 @@ interactions: body: null headers: Accept: - - application/json + - application/json, text/json Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/runCommands/RunPowerShellScript?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/runCommands/RunPowerShellScript?api-version=2020-06-01 response: body: string: "{\r\n \"script\": [\r\n \"param(\",\r\n \" [string]$arg1,\"\ @@ -1232,7 +1218,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:35:32 GMT + - Wed, 16 Sep 2020 06:28:46 GMT expires: - '-1' pragma: @@ -1263,9 +1249,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/extensions?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/extensions?api-version=2020-06-01 response: body: string: "{\r\n \"value\": [\r\n {\r\n \"name\": \"virtualmachineextensionx15cf0eff\"\ @@ -1280,11 +1266,11 @@ interactions: cache-control: - no-cache content-length: - - '677' + - '708' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:35:32 GMT + - Wed, 16 Sep 2020 06:28:48 GMT expires: - '-1' pragma: @@ -1301,7 +1287,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;3992,Microsoft.Compute/LowCostGet30Min;31980 + - Microsoft.Compute/LowCostGet3Min;3992,Microsoft.Compute/LowCostGet30Min;31988 status: code: 200 message: OK @@ -1315,88 +1301,89 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff?$expand=instanceView&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff?$expand=instanceView&api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"virtualmachinex15cf0eff\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff\"\ ,\r\n \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\"\ - : \"eastus\",\r\n \"properties\": {\r\n \"vmId\": \"ab70a5c7-54fb-4278-830e-d4e3636657b2\"\ + : \"eastus\",\r\n \"properties\": {\r\n \"vmId\": \"d513c9d3-b764-446e-b2cd-7613552ca441\"\ ,\r\n \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_D2_v2\"\r\n\ \ },\r\n \"storageProfile\": {\r\n \"imageReference\": {\r\n \ \ \"publisher\": \"MicrosoftWindowsServer\",\r\n \"offer\": \"\ WindowsServer\",\r\n \"sku\": \"2016-Datacenter\",\r\n \"version\"\ - : \"latest\",\r\n \"exactVersion\": \"14393.3686.2005061700\"\r\n \ + : \"latest\",\r\n \"exactVersion\": \"14393.3930.2009041537\"\r\n \ \ },\r\n \"osDisk\": {\r\n \"osType\": \"Windows\",\r\n \ \ \"name\": \"myVMosdisk\",\r\n \"createOption\": \"FromImage\"\ ,\r\n \"caching\": \"ReadWrite\",\r\n \"managedDisk\": {\r\n\ \ \"storageAccountType\": \"Standard_LRS\",\r\n \"id\":\ - \ \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/myVMosdisk\"\ + \ \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/FAXZB4WAN4C5ZDFF2TSY6FQPLDOK5YNVP7S75Z543ONA77DLSBCJ2FIIF4EPNL6GSZTONVX7NEN/providers/Microsoft.Compute/disks/myVMosdisk\"\ \r\n },\r\n \"diskSizeGB\": 127\r\n },\r\n \"dataDisks\"\ - : [\r\n {\r\n \"lun\": 0,\r\n \"name\": \"virtualmachinex15cf0eff_disk2_f1a5fa7495ce4869939f251422bf7e5d\"\ + : [\r\n {\r\n \"lun\": 0,\r\n \"name\": \"virtualmachinex15cf0eff_disk2_361599c7f509421eadec1b2964391d52\"\ ,\r\n \"createOption\": \"Empty\",\r\n \"caching\": \"None\"\ ,\r\n \"managedDisk\": {\r\n \"storageAccountType\": \"\ - Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/virtualmachinex15cf0eff_disk2_f1a5fa7495ce4869939f251422bf7e5d\"\ + Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/FAXZB4WAN4C5ZDFF2TSY6FQPLDOK5YNVP7S75Z543ONA77DLSBCJ2FIIF4EPNL6GSZTONVX7NEN/providers/Microsoft.Compute/disks/virtualmachinex15cf0eff_disk2_361599c7f509421eadec1b2964391d52\"\ \r\n },\r\n \"diskSizeGB\": 1023,\r\n \"toBeDetached\"\ : false\r\n },\r\n {\r\n \"lun\": 1,\r\n \"\ - name\": \"virtualmachinex15cf0eff_disk3_c01d0c9587e249aa992d4b95d8674c96\"\ + name\": \"virtualmachinex15cf0eff_disk3_91f87690dd80480883677659a660dda4\"\ ,\r\n \"createOption\": \"Empty\",\r\n \"caching\": \"None\"\ ,\r\n \"managedDisk\": {\r\n \"storageAccountType\": \"\ - Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/virtualmachinex15cf0eff_disk3_c01d0c9587e249aa992d4b95d8674c96\"\ + Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/FAXZB4WAN4C5ZDFF2TSY6FQPLDOK5YNVP7S75Z543ONA77DLSBCJ2FIIF4EPNL6GSZTONVX7NEN/providers/Microsoft.Compute/disks/virtualmachinex15cf0eff_disk3_91f87690dd80480883677659a660dda4\"\ \r\n },\r\n \"diskSizeGB\": 1023,\r\n \"toBeDetached\"\ : false\r\n }\r\n ]\r\n },\r\n \"osProfile\": {\r\n \ \ \"computerName\": \"myVM\",\r\n \"adminUsername\": \"testuser\",\r\ \n \"windowsConfiguration\": {\r\n \"provisionVMAgent\": true,\r\ - \n \"enableAutomaticUpdates\": true\r\n },\r\n \"secrets\"\ - : [],\r\n \"allowExtensionOperations\": true,\r\n \"requireGuestProvisionSignal\"\ - : true\r\n },\r\n \"networkProfile\": {\"networkInterfaces\":[{\"id\"\ - :\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacex15cf0eff\"\ + \n \"enableAutomaticUpdates\": true,\r\n \"patchSettings\":\ + \ {\r\n \"patchMode\": \"AutomaticByOS\"\r\n }\r\n },\r\ + \n \"secrets\": [],\r\n \"allowExtensionOperations\": true,\r\n\ + \ \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\"\ + : {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacex15cf0eff\"\ ,\"properties\":{\"primary\":true}}]},\r\n \"provisioningState\": \"Succeeded\"\ ,\r\n \"instanceView\": {\r\n \"computerName\": \"myVM\",\r\n \ \ \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"osVersion\"\ : \"Microsoft Windows NT 10.0.14393.0\",\r\n \"vmAgent\": {\r\n \ - \ \"vmAgentVersion\": \"2.7.41491.963\",\r\n \"statuses\": [\r\n\ + \ \"vmAgentVersion\": \"2.7.41491.992\",\r\n \"statuses\": [\r\n\ \ {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n\ \ \"level\": \"Info\",\r\n \"displayStatus\": \"Ready\"\ - ,\r\n \"message\": \"GuestAgent is running and accepting new configurations.\"\ - ,\r\n \"time\": \"2020-05-18T15:35:19+00:00\"\r\n }\r\n\ + ,\r\n \"message\": \"GuestAgent is running and processing the extensions.\"\ + ,\r\n \"time\": \"2020-09-16T06:28:38+00:00\"\r\n }\r\n\ \ ],\r\n \"extensionHandlers\": [\r\n {\r\n \ \ \"type\": \"Microsoft.Azure.NetworkWatcher.NetworkWatcherAgentWindows\"\ - ,\r\n \"typeHandlerVersion\": \"1.4.1421.1\",\r\n \"\ + ,\r\n \"typeHandlerVersion\": \"1.4.1587.1\",\r\n \"\ status\": {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n\ \ \"level\": \"Info\",\r\n \"displayStatus\": \"\ Ready\",\r\n \"message\": \"Plugin enabled (handler name: Microsoft.Azure.NetworkWatcher.NetworkWatcherAgentWindows,\ - \ extension name: , version: 1.4.1421.1).\"\r\n }\r\n \ + \ extension name: , version: 1.4.1587.1).\"\r\n }\r\n \ \ }\r\n ]\r\n },\r\n \"disks\": [\r\n {\r\n \ \ \"name\": \"myVMosdisk\",\r\n \"statuses\": [\r\n \ \ {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n \ \ \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning\ - \ succeeded\",\r\n \"time\": \"2020-05-18T15:32:28.2779015+00:00\"\ + \ succeeded\",\r\n \"time\": \"2020-09-16T06:25:35.9159962+00:00\"\ \r\n }\r\n ]\r\n },\r\n {\r\n \"\ - name\": \"virtualmachinex15cf0eff_disk2_f1a5fa7495ce4869939f251422bf7e5d\"\ + name\": \"virtualmachinex15cf0eff_disk2_361599c7f509421eadec1b2964391d52\"\ ,\r\n \"statuses\": [\r\n {\r\n \"code\"\ : \"ProvisioningState/succeeded\",\r\n \"level\": \"Info\",\r\ \n \"displayStatus\": \"Provisioning succeeded\",\r\n \ - \ \"time\": \"2020-05-18T15:32:28.2779015+00:00\"\r\n }\r\ - \n ]\r\n },\r\n {\r\n \"name\": \"virtualmachinex15cf0eff_disk3_c01d0c9587e249aa992d4b95d8674c96\"\ + \ \"time\": \"2020-09-16T06:25:35.9159962+00:00\"\r\n }\r\ + \n ]\r\n },\r\n {\r\n \"name\": \"virtualmachinex15cf0eff_disk3_91f87690dd80480883677659a660dda4\"\ ,\r\n \"statuses\": [\r\n {\r\n \"code\"\ : \"ProvisioningState/succeeded\",\r\n \"level\": \"Info\",\r\ \n \"displayStatus\": \"Provisioning succeeded\",\r\n \ - \ \"time\": \"2020-05-18T15:32:28.2779015+00:00\"\r\n }\r\ + \ \"time\": \"2020-09-16T06:25:35.9159962+00:00\"\r\n }\r\ \n ]\r\n }\r\n ],\r\n \"extensions\": [\r\n \ \ {\r\n \"name\": \"virtualmachineextensionx15cf0eff\",\r\n \ \ \"type\": \"Microsoft.Azure.NetworkWatcher.NetworkWatcherAgentWindows\"\ - ,\r\n \"typeHandlerVersion\": \"1.4.1421.1\",\r\n \"statuses\"\ + ,\r\n \"typeHandlerVersion\": \"1.4.1587.1\",\r\n \"statuses\"\ : [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\"\ ,\r\n \"level\": \"Info\",\r\n \"displayStatus\"\ : \"Provisioning succeeded\",\r\n \"message\": \"Plugin enabled\ \ (handler name: Microsoft.Azure.NetworkWatcher.NetworkWatcherAgentWindows,\ - \ extension name: , version: 1.4.1421.1).\"\r\n }\r\n \ + \ extension name: , version: 1.4.1587.1).\"\r\n }\r\n \ \ ]\r\n }\r\n ],\r\n \"hyperVGeneration\": \"V1\",\r\n \ \ \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\"\ ,\r\n \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning\ - \ succeeded\",\r\n \"time\": \"2020-05-18T15:35:27.4977117+00:00\"\ + \ succeeded\",\r\n \"time\": \"2020-09-16T06:28:41.1829637+00:00\"\ \r\n },\r\n {\r\n \"code\": \"PowerState/running\"\ ,\r\n \"level\": \"Info\",\r\n \"displayStatus\": \"VM running\"\ \r\n }\r\n ]\r\n }\r\n },\r\n \"resources\": [\r\n {\r\ @@ -1412,11 +1399,11 @@ interactions: cache-control: - no-cache content-length: - - '6868' + - '7131' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:35:32 GMT + - Wed, 16 Sep 2020 06:28:48 GMT expires: - '-1' pragma: @@ -1433,7 +1420,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;3991,Microsoft.Compute/LowCostGet30Min;31979 + - Microsoft.Compute/LowCostGet3Min;3991,Microsoft.Compute/LowCostGet30Min;31987 status: code: 200 message: OK @@ -1441,7 +1428,7 @@ interactions: body: '{"commandId": "RunPowerShellScript"}' headers: Accept: - - application/json + - application/json, text/json Accept-Encoding: - gzip, deflate Connection: @@ -1451,25 +1438,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/runCommand?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/runCommand?api-version=2020-06-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2c6fe158-f580-4a61-95f3-465dfa7ac949?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1ebb8542-b09d-4f2a-a6d1-02dad95e71f3?api-version=2020-06-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 18 May 2020 15:35:33 GMT + - Wed, 16 Sep 2020 06:28:49 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2c6fe158-f580-4a61-95f3-465dfa7ac949?monitor=true&api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1ebb8542-b09d-4f2a-a6d1-02dad95e71f3?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -1482,7 +1469,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/UpdateVM3Min;238,Microsoft.Compute/UpdateVM30Min;1198 x-ms-ratelimit-remaining-subscription-writes: - - '1195' + - '1196' status: code: 202 message: Accepted @@ -1496,60 +1483,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2c6fe158-f580-4a61-95f3-465dfa7ac949?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-05-18T15:35:33.8571095+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"2c6fe158-f580-4a61-95f3-465dfa7ac949\"\ - \r\n}" - headers: - cache-control: - - no-cache - content-length: - - '134' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 18 May 2020 15:36:04 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14992,Microsoft.Compute/GetOperation30Min;29974 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2c6fe158-f580-4a61-95f3-465dfa7ac949?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1ebb8542-b09d-4f2a-a6d1-02dad95e71f3?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:35:33.8571095+00:00\",\r\n \"\ - endTime\": \"2020-05-18T15:36:24.716781+00:00\",\r\n \"status\": \"Succeeded\"\ + string: "{\r\n \"startTime\": \"2020-09-16T06:28:49.6830116+00:00\",\r\n \"\ + endTime\": \"2020-09-16T06:29:20.1207628+00:00\",\r\n \"status\": \"Succeeded\"\ ,\r\n \"properties\": {\r\n \"output\": {\r\n \"value\": [\r\n {\r\ \n \"code\": \"ComponentStatus/StdOut/succeeded\",\r\n \"level\"\ : \"Info\",\r\n \"displayStatus\": \"Provisioning succeeded\",\r\n \ @@ -1557,16 +1497,16 @@ interactions: \n {\r\n \"code\": \"ComponentStatus/StdErr/succeeded\",\r\n \ \ \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning succeeded\"\ ,\r\n \"message\": \"\"\r\n }\r\n ]\r\n}\r\n },\r\n \"name\": \"\ - 2c6fe158-f580-4a61-95f3-465dfa7ac949\"\r\n}" + 1ebb8542-b09d-4f2a-a6d1-02dad95e71f3\"\r\n}" headers: cache-control: - no-cache content-length: - - '609' + - '610' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:36:34 GMT + - Wed, 16 Sep 2020 06:29:20 GMT expires: - '-1' pragma: @@ -1583,7 +1523,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14991,Microsoft.Compute/GetOperation30Min;29971 + - Microsoft.Compute/GetOperation3Min;14991,Microsoft.Compute/GetOperation30Min;29988 status: code: 200 message: OK @@ -1597,9 +1537,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2c6fe158-f580-4a61-95f3-465dfa7ac949?monitor=true&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1ebb8542-b09d-4f2a-a6d1-02dad95e71f3?monitor=true&api-version=2020-06-01 response: body: string: '{"value":[{"code":"ComponentStatus/StdOut/succeeded","level":"Info","displayStatus":"Provisioning @@ -1613,7 +1553,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:36:34 GMT + - Wed, 16 Sep 2020 06:29:20 GMT expires: - '-1' pragma: @@ -1630,7 +1570,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14990,Microsoft.Compute/GetOperation30Min;29970 + - Microsoft.Compute/GetOperation3Min;14990,Microsoft.Compute/GetOperation30Min;29987 status: code: 200 message: OK @@ -1646,25 +1586,25 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/restart?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/restart?api-version=2020-06-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4ce7da0e-8b9e-41bd-afda-06d4ba7c94b4?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c80b26a4-473b-4194-9a60-eaa99f169a93?api-version=2020-06-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 18 May 2020 15:36:34 GMT + - Wed, 16 Sep 2020 06:29:20 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4ce7da0e-8b9e-41bd-afda-06d4ba7c94b4?monitor=true&api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c80b26a4-473b-4194-9a60-eaa99f169a93?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -1677,7 +1617,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/UpdateVM3Min;237,Microsoft.Compute/UpdateVM30Min;1197 x-ms-ratelimit-remaining-subscription-writes: - - '1194' + - '1195' status: code: 202 message: Accepted @@ -1691,14 +1631,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4ce7da0e-8b9e-41bd-afda-06d4ba7c94b4?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c80b26a4-473b-4194-9a60-eaa99f169a93?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:36:35.3261997+00:00\",\r\n \"\ - endTime\": \"2020-05-18T15:36:35.6387079+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"4ce7da0e-8b9e-41bd-afda-06d4ba7c94b4\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T06:29:20.8551366+00:00\",\r\n \"\ + endTime\": \"2020-09-16T06:29:21.1520132+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"c80b26a4-473b-4194-9a60-eaa99f169a93\"\r\n}" headers: cache-control: - no-cache @@ -1707,7 +1647,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:37:05 GMT + - Wed, 16 Sep 2020 06:29:51 GMT expires: - '-1' pragma: @@ -1724,7 +1664,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14987,Microsoft.Compute/GetOperation30Min;29967 + - Microsoft.Compute/GetOperation3Min;14989,Microsoft.Compute/GetOperation30Min;29984 status: code: 200 message: OK @@ -1738,9 +1678,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4ce7da0e-8b9e-41bd-afda-06d4ba7c94b4?monitor=true&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c80b26a4-473b-4194-9a60-eaa99f169a93?monitor=true&api-version=2020-06-01 response: body: string: '' @@ -1750,7 +1690,7 @@ interactions: content-length: - '0' date: - - Mon, 18 May 2020 15:37:05 GMT + - Wed, 16 Sep 2020 06:29:51 GMT expires: - '-1' pragma: @@ -1763,7 +1703,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29966 + - Microsoft.Compute/GetOperation3Min;14988,Microsoft.Compute/GetOperation30Min;29983 status: code: 200 message: OK @@ -1779,25 +1719,25 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/powerOff?skipShutdown=false&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/powerOff?skipShutdown=false&api-version=2020-06-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/fbd17527-c0d0-4668-aceb-c1c032ef443d?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/6c4b76d2-449a-4752-9364-1fa87298fe58?api-version=2020-06-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 18 May 2020 15:37:06 GMT + - Wed, 16 Sep 2020 06:29:51 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/fbd17527-c0d0-4668-aceb-c1c032ef443d?monitor=true&api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/6c4b76d2-449a-4752-9364-1fa87298fe58?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -1808,9 +1748,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/UpdateVM3Min;237,Microsoft.Compute/UpdateVM30Min;1196 + - Microsoft.Compute/UpdateVM3Min;236,Microsoft.Compute/UpdateVM30Min;1196 x-ms-ratelimit-remaining-subscription-writes: - - '1193' + - '1194' status: code: 202 message: Accepted @@ -1824,14 +1764,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/fbd17527-c0d0-4668-aceb-c1c032ef443d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/6c4b76d2-449a-4752-9364-1fa87298fe58?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:37:06.2327213+00:00\",\r\n \"\ - endTime\": \"2020-05-18T15:37:17.9827227+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"fbd17527-c0d0-4668-aceb-c1c032ef443d\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T06:29:51.9647037+00:00\",\r\n \"\ + endTime\": \"2020-09-16T06:30:12.8554837+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"6c4b76d2-449a-4752-9364-1fa87298fe58\"\r\n}" headers: cache-control: - no-cache @@ -1840,7 +1780,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:37:36 GMT + - Wed, 16 Sep 2020 06:30:21 GMT expires: - '-1' pragma: @@ -1857,7 +1797,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29964 + - Microsoft.Compute/GetOperation3Min;14987,Microsoft.Compute/GetOperation30Min;29983 status: code: 200 message: OK @@ -1871,9 +1811,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/fbd17527-c0d0-4668-aceb-c1c032ef443d?monitor=true&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/6c4b76d2-449a-4752-9364-1fa87298fe58?monitor=true&api-version=2020-06-01 response: body: string: '' @@ -1883,7 +1823,7 @@ interactions: content-length: - '0' date: - - Mon, 18 May 2020 15:37:36 GMT + - Wed, 16 Sep 2020 06:30:22 GMT expires: - '-1' pragma: @@ -1896,7 +1836,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29963 + - Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29982 status: code: 200 message: OK @@ -1912,25 +1852,25 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/start?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/start?api-version=2020-06-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/75c6c6b2-ebcf-440d-a84c-acec5744f28e?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2b582f7e-3cf4-4afb-aba7-1522c4d5dba2?api-version=2020-06-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 18 May 2020 15:37:37 GMT + - Wed, 16 Sep 2020 06:30:22 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/75c6c6b2-ebcf-440d-a84c-acec5744f28e?monitor=true&api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2b582f7e-3cf4-4afb-aba7-1522c4d5dba2?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -1943,7 +1883,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/UpdateVM3Min;236,Microsoft.Compute/UpdateVM30Min;1195 x-ms-ratelimit-remaining-subscription-writes: - - '1192' + - '1193' status: code: 202 message: Accepted @@ -1957,23 +1897,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/75c6c6b2-ebcf-440d-a84c-acec5744f28e?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2b582f7e-3cf4-4afb-aba7-1522c4d5dba2?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:37:37.154724+00:00\",\r\n \"\ - endTime\": \"2020-05-18T15:37:40.4203702+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"75c6c6b2-ebcf-440d-a84c-acec5744f28e\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T06:30:23.1055379+00:00\",\r\n \"\ + endTime\": \"2020-09-16T06:30:28.05872+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"2b582f7e-3cf4-4afb-aba7-1522c4d5dba2\"\r\n}" headers: cache-control: - no-cache content-length: - - '183' + - '182' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:37:47 GMT + - Wed, 16 Sep 2020 06:30:33 GMT expires: - '-1' pragma: @@ -1990,7 +1930,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29962 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29979 status: code: 200 message: OK @@ -2004,9 +1944,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/75c6c6b2-ebcf-440d-a84c-acec5744f28e?monitor=true&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2b582f7e-3cf4-4afb-aba7-1522c4d5dba2?monitor=true&api-version=2020-06-01 response: body: string: '' @@ -2016,7 +1956,7 @@ interactions: content-length: - '0' date: - - Mon, 18 May 2020 15:37:47 GMT + - Wed, 16 Sep 2020 06:30:35 GMT expires: - '-1' pragma: @@ -2029,7 +1969,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29961 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29978 status: code: 200 message: OK @@ -2047,9 +1987,9 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/extensions/virtualmachineextensionx15cf0eff?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/extensions/virtualmachineextensionx15cf0eff?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"virtualmachineextensionx15cf0eff\",\r\n \"id\"\ @@ -2061,15 +2001,15 @@ interactions: ,\r\n \"typeHandlerVersion\": \"1.4\"\r\n }\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c3ae7cad-be34-4cd9-a07f-41f2004e6142?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f6fcfbb7-03f0-4437-8b48-7f8782141e0e?api-version=2020-06-01 cache-control: - no-cache content-length: - - '599' + - '630' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:37:48 GMT + - Wed, 16 Sep 2020 06:30:35 GMT expires: - '-1' pragma: @@ -2088,7 +2028,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/UpdateVM3Min;235,Microsoft.Compute/UpdateVM30Min;1194 x-ms-ratelimit-remaining-subscription-writes: - - '1194' + - '1185' status: code: 200 message: OK @@ -2102,14 +2042,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c3ae7cad-be34-4cd9-a07f-41f2004e6142?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f6fcfbb7-03f0-4437-8b48-7f8782141e0e?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:37:48.4204077+00:00\",\r\n \"\ - endTime\": \"2020-05-18T15:37:48.6079558+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"c3ae7cad-be34-4cd9-a07f-41f2004e6142\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T06:30:36.0899754+00:00\",\r\n \"\ + endTime\": \"2020-09-16T06:30:36.4337379+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"f6fcfbb7-03f0-4437-8b48-7f8782141e0e\"\r\n}" headers: cache-control: - no-cache @@ -2118,7 +2058,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:38:18 GMT + - Wed, 16 Sep 2020 06:31:08 GMT expires: - '-1' pragma: @@ -2135,7 +2075,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29959 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29977 status: code: 200 message: OK @@ -2149,9 +2089,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/extensions/virtualmachineextensionx15cf0eff?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/extensions/virtualmachineextensionx15cf0eff?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"virtualmachineextensionx15cf0eff\",\r\n \"id\"\ @@ -2165,11 +2105,11 @@ interactions: cache-control: - no-cache content-length: - - '600' + - '631' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:38:18 GMT + - Wed, 16 Sep 2020 06:31:08 GMT expires: - '-1' pragma: @@ -2186,7 +2126,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;3993,Microsoft.Compute/LowCostGet30Min;31978 + - Microsoft.Compute/LowCostGet3Min;3993,Microsoft.Compute/LowCostGet30Min;31990 status: code: 200 message: OK @@ -2202,9 +2142,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/extensions/virtualmachineextensionx15cf0eff?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/extensions/virtualmachineextensionx15cf0eff?api-version=2020-06-01 response: body: string: '' @@ -2212,17 +2152,17 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4838e561-91e6-4915-a22d-b3a777d69e71?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/27555e7f-108e-40c0-84e6-cab9621cc029?api-version=2020-06-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 18 May 2020 15:38:19 GMT + - Wed, 16 Sep 2020 06:31:09 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4838e561-91e6-4915-a22d-b3a777d69e71?monitor=true&api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/27555e7f-108e-40c0-84e6-cab9621cc029?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -2235,7 +2175,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/UpdateVM3Min;234,Microsoft.Compute/UpdateVM30Min;1193 x-ms-ratelimit-remaining-subscription-deletes: - - '14997' + - '14993' status: code: 202 message: Accepted @@ -2249,70 +2189,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4838e561-91e6-4915-a22d-b3a777d69e71?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/27555e7f-108e-40c0-84e6-cab9621cc029?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:38:19.904996+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"4838e561-91e6-4915-a22d-b3a777d69e71\"\ - \r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T06:31:09.4652045+00:00\",\r\n \"\ + endTime\": \"2020-09-16T06:31:39.8716594+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"27555e7f-108e-40c0-84e6-cab9621cc029\"\r\n}" headers: cache-control: - no-cache content-length: - - '133' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 18 May 2020 15:38:50 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29958 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4838e561-91e6-4915-a22d-b3a777d69e71?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-05-18T15:38:19.904996+00:00\",\r\n \"\ - endTime\": \"2020-05-18T15:39:05.1865087+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"4838e561-91e6-4915-a22d-b3a777d69e71\"\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '183' + - '184' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:39:19 GMT + - Wed, 16 Sep 2020 06:31:40 GMT expires: - '-1' pragma: @@ -2329,7 +2222,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29956 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29976 status: code: 200 message: OK @@ -2345,25 +2238,25 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/powerOff?skipShutdown=false&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/powerOff?skipShutdown=false&api-version=2020-06-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/28ced419-8cd1-4ddc-899d-9b4ee00b33c2?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c790e5ee-a09a-44d0-a51f-b028af9e2b14?api-version=2020-06-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 18 May 2020 15:39:20 GMT + - Wed, 16 Sep 2020 06:31:40 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/28ced419-8cd1-4ddc-899d-9b4ee00b33c2?monitor=true&api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c790e5ee-a09a-44d0-a51f-b028af9e2b14?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -2376,7 +2269,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/UpdateVM3Min;234,Microsoft.Compute/UpdateVM30Min;1192 x-ms-ratelimit-remaining-subscription-writes: - - '1191' + - '1192' status: code: 202 message: Accepted @@ -2390,14 +2283,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/28ced419-8cd1-4ddc-899d-9b4ee00b33c2?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c790e5ee-a09a-44d0-a51f-b028af9e2b14?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:39:20.8740717+00:00\",\r\n \"\ - endTime\": \"2020-05-18T15:39:30.9991474+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"28ced419-8cd1-4ddc-899d-9b4ee00b33c2\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T06:31:40.9497759+00:00\",\r\n \"\ + endTime\": \"2020-09-16T06:31:53.0592369+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"c790e5ee-a09a-44d0-a51f-b028af9e2b14\"\r\n}" headers: cache-control: - no-cache @@ -2406,7 +2299,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:39:50 GMT + - Wed, 16 Sep 2020 06:32:11 GMT expires: - '-1' pragma: @@ -2423,7 +2316,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29954 + - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29973 status: code: 200 message: OK @@ -2437,9 +2330,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/28ced419-8cd1-4ddc-899d-9b4ee00b33c2?monitor=true&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c790e5ee-a09a-44d0-a51f-b028af9e2b14?monitor=true&api-version=2020-06-01 response: body: string: '' @@ -2449,7 +2342,7 @@ interactions: content-length: - '0' date: - - Mon, 18 May 2020 15:39:51 GMT + - Wed, 16 Sep 2020 06:32:11 GMT expires: - '-1' pragma: @@ -2462,7 +2355,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29953 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29972 status: code: 200 message: OK @@ -2470,7 +2363,7 @@ interactions: body: null headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate Connection: @@ -2478,25 +2371,25 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/reapply?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/reapply?api-version=2020-06-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/bbb51092-aff6-4730-850a-b5c47fe256af?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/539e65e0-4d01-4f4f-afc2-6c01968e4512?api-version=2020-06-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 18 May 2020 15:39:51 GMT + - Wed, 16 Sep 2020 06:32:12 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/bbb51092-aff6-4730-850a-b5c47fe256af?monitor=true&api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/539e65e0-4d01-4f4f-afc2-6c01968e4512?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -2509,7 +2402,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/UpdateVM3Min;234,Microsoft.Compute/UpdateVM30Min;1191 x-ms-ratelimit-remaining-subscription-writes: - - '1190' + - '1191' status: code: 202 message: Accepted @@ -2523,14 +2416,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/bbb51092-aff6-4730-850a-b5c47fe256af?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/539e65e0-4d01-4f4f-afc2-6c01968e4512?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:39:52.2180262+00:00\",\r\n \"\ - endTime\": \"2020-05-18T15:39:54.3898757+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"bbb51092-aff6-4730-850a-b5c47fe256af\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T06:32:12.8562728+00:00\",\r\n \"\ + endTime\": \"2020-09-16T06:32:14.5750222+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"539e65e0-4d01-4f4f-afc2-6c01968e4512\"\r\n}" headers: cache-control: - no-cache @@ -2539,7 +2432,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:40:22 GMT + - Wed, 16 Sep 2020 06:32:43 GMT expires: - '-1' pragma: @@ -2556,7 +2449,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29963 + - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29970 status: code: 200 message: OK @@ -2570,9 +2463,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/bbb51092-aff6-4730-850a-b5c47fe256af?monitor=true&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/539e65e0-4d01-4f4f-afc2-6c01968e4512?monitor=true&api-version=2020-06-01 response: body: string: '' @@ -2582,7 +2475,7 @@ interactions: content-length: - '0' date: - - Mon, 18 May 2020 15:40:22 GMT + - Wed, 16 Sep 2020 06:32:43 GMT expires: - '-1' pragma: @@ -2595,7 +2488,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29962 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29969 status: code: 200 message: OK @@ -2611,25 +2504,25 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/redeploy?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/redeploy?api-version=2020-06-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/637a2b72-ad94-4fc1-a35a-d4e7bae2750e?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/cc6a8a16-ed53-4a77-a62a-e00d08ab36c1?api-version=2020-06-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 18 May 2020 15:40:23 GMT + - Wed, 16 Sep 2020 06:32:43 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/637a2b72-ad94-4fc1-a35a-d4e7bae2750e?monitor=true&api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/cc6a8a16-ed53-4a77-a62a-e00d08ab36c1?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -2642,7 +2535,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/UpdateVM3Min;234,Microsoft.Compute/UpdateVM30Min;1190 x-ms-ratelimit-remaining-subscription-writes: - - '1189' + - '1190' status: code: 202 message: Accepted @@ -2656,13 +2549,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/637a2b72-ad94-4fc1-a35a-d4e7bae2750e?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/cc6a8a16-ed53-4a77-a62a-e00d08ab36c1?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:40:23.4057739+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"637a2b72-ad94-4fc1-a35a-d4e7bae2750e\"\ + string: "{\r\n \"startTime\": \"2020-09-16T06:32:43.9955538+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"cc6a8a16-ed53-4a77-a62a-e00d08ab36c1\"\ \r\n}" headers: cache-control: @@ -2672,7 +2565,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:40:52 GMT + - Wed, 16 Sep 2020 06:33:14 GMT expires: - '-1' pragma: @@ -2689,7 +2582,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14988,Microsoft.Compute/GetOperation30Min;29960 + - Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29967 status: code: 200 message: OK @@ -2703,14 +2596,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/637a2b72-ad94-4fc1-a35a-d4e7bae2750e?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/cc6a8a16-ed53-4a77-a62a-e00d08ab36c1?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:40:23.4057739+00:00\",\r\n \"\ - endTime\": \"2020-05-18T15:41:05.9684561+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"637a2b72-ad94-4fc1-a35a-d4e7bae2750e\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T06:32:43.9955538+00:00\",\r\n \"\ + endTime\": \"2020-09-16T06:33:26.4658875+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"cc6a8a16-ed53-4a77-a62a-e00d08ab36c1\"\r\n}" headers: cache-control: - no-cache @@ -2719,7 +2612,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:41:23 GMT + - Wed, 16 Sep 2020 06:33:44 GMT expires: - '-1' pragma: @@ -2736,7 +2629,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29957 + - Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29964 status: code: 200 message: OK @@ -2750,9 +2643,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/637a2b72-ad94-4fc1-a35a-d4e7bae2750e?monitor=true&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/cc6a8a16-ed53-4a77-a62a-e00d08ab36c1?monitor=true&api-version=2020-06-01 response: body: string: '' @@ -2762,7 +2655,7 @@ interactions: content-length: - '0' date: - - Mon, 18 May 2020 15:41:23 GMT + - Wed, 16 Sep 2020 06:33:44 GMT expires: - '-1' pragma: @@ -2775,13 +2668,14 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29956 + - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29963 status: code: 200 message: OK - request: - body: 'b''{"properties": {"networkProfile": {"networkInterfaces": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacex15cf0eff", - "properties": {"primary": true}}]}}}''' + body: 'b''b\''{"properties": {"networkProfile": {"networkInterfaces": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacex15cf0eff", + "properties": {"primary": true}}]}}}\''''' headers: Accept: - application/json @@ -2790,62 +2684,63 @@ interactions: Connection: - keep-alive Content-Length: - - '280' + - '311' Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"virtualmachinex15cf0eff\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff\"\ ,\r\n \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\"\ - : \"eastus\",\r\n \"properties\": {\r\n \"vmId\": \"ab70a5c7-54fb-4278-830e-d4e3636657b2\"\ + : \"eastus\",\r\n \"properties\": {\r\n \"vmId\": \"d513c9d3-b764-446e-b2cd-7613552ca441\"\ ,\r\n \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_D2_v2\"\r\n\ \ },\r\n \"storageProfile\": {\r\n \"imageReference\": {\r\n \ \ \"publisher\": \"MicrosoftWindowsServer\",\r\n \"offer\": \"\ WindowsServer\",\r\n \"sku\": \"2016-Datacenter\",\r\n \"version\"\ - : \"latest\",\r\n \"exactVersion\": \"14393.3686.2005061700\"\r\n \ + : \"latest\",\r\n \"exactVersion\": \"14393.3930.2009041537\"\r\n \ \ },\r\n \"osDisk\": {\r\n \"osType\": \"Windows\",\r\n \ \ \"name\": \"myVMosdisk\",\r\n \"createOption\": \"FromImage\"\ ,\r\n \"caching\": \"ReadWrite\",\r\n \"managedDisk\": {\r\n\ \ \"storageAccountType\": \"Standard_LRS\",\r\n \"id\":\ - \ \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/myVMosdisk\"\ + \ \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/FAXZB4WAN4C5ZDFF2TSY6FQPLDOK5YNVP7S75Z543ONA77DLSBCJ2FIIF4EPNL6GSZTONVX7NEN/providers/Microsoft.Compute/disks/myVMosdisk\"\ \r\n },\r\n \"diskSizeGB\": 127\r\n },\r\n \"dataDisks\"\ - : [\r\n {\r\n \"lun\": 0,\r\n \"name\": \"virtualmachinex15cf0eff_disk2_f1a5fa7495ce4869939f251422bf7e5d\"\ + : [\r\n {\r\n \"lun\": 0,\r\n \"name\": \"virtualmachinex15cf0eff_disk2_361599c7f509421eadec1b2964391d52\"\ ,\r\n \"createOption\": \"Empty\",\r\n \"caching\": \"None\"\ ,\r\n \"managedDisk\": {\r\n \"storageAccountType\": \"\ - Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/virtualmachinex15cf0eff_disk2_f1a5fa7495ce4869939f251422bf7e5d\"\ + Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/FAXZB4WAN4C5ZDFF2TSY6FQPLDOK5YNVP7S75Z543ONA77DLSBCJ2FIIF4EPNL6GSZTONVX7NEN/providers/Microsoft.Compute/disks/virtualmachinex15cf0eff_disk2_361599c7f509421eadec1b2964391d52\"\ \r\n },\r\n \"diskSizeGB\": 1023,\r\n \"toBeDetached\"\ : false\r\n },\r\n {\r\n \"lun\": 1,\r\n \"\ - name\": \"virtualmachinex15cf0eff_disk3_c01d0c9587e249aa992d4b95d8674c96\"\ + name\": \"virtualmachinex15cf0eff_disk3_91f87690dd80480883677659a660dda4\"\ ,\r\n \"createOption\": \"Empty\",\r\n \"caching\": \"None\"\ ,\r\n \"managedDisk\": {\r\n \"storageAccountType\": \"\ - Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/virtualmachinex15cf0eff_disk3_c01d0c9587e249aa992d4b95d8674c96\"\ + Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/FAXZB4WAN4C5ZDFF2TSY6FQPLDOK5YNVP7S75Z543ONA77DLSBCJ2FIIF4EPNL6GSZTONVX7NEN/providers/Microsoft.Compute/disks/virtualmachinex15cf0eff_disk3_91f87690dd80480883677659a660dda4\"\ \r\n },\r\n \"diskSizeGB\": 1023,\r\n \"toBeDetached\"\ : false\r\n }\r\n ]\r\n },\r\n \"osProfile\": {\r\n \ \ \"computerName\": \"myVM\",\r\n \"adminUsername\": \"testuser\",\r\ \n \"windowsConfiguration\": {\r\n \"provisionVMAgent\": true,\r\ - \n \"enableAutomaticUpdates\": true\r\n },\r\n \"secrets\"\ - : [],\r\n \"allowExtensionOperations\": true,\r\n \"requireGuestProvisionSignal\"\ - : true\r\n },\r\n \"networkProfile\": {\"networkInterfaces\":[{\"id\"\ - :\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacex15cf0eff\"\ + \n \"enableAutomaticUpdates\": true,\r\n \"patchSettings\":\ + \ {\r\n \"patchMode\": \"AutomaticByOS\"\r\n }\r\n },\r\ + \n \"secrets\": [],\r\n \"allowExtensionOperations\": true,\r\n\ + \ \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\"\ + : {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacex15cf0eff\"\ ,\"properties\":{\"primary\":true}}]},\r\n \"provisioningState\": \"Updating\"\ \r\n }\r\n}" headers: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2858a509-3d91-4dc4-b837-c1ca4d3ff07b?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/675929d3-2e03-413b-9bbf-40c207974b3b?api-version=2020-06-01 cache-control: - no-cache content-length: - - '2984' + - '3219' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:41:26 GMT + - Wed, 16 Sep 2020 06:33:49 GMT expires: - '-1' pragma: @@ -2862,9 +2757,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/PutVM3Min;572,Microsoft.Compute/PutVM30Min;2864 + - Microsoft.Compute/PutVM3Min;239,Microsoft.Compute/PutVM30Min;1198 x-ms-ratelimit-remaining-subscription-writes: - - '1193' + - '1184' status: code: 200 message: OK @@ -2878,14 +2773,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2858a509-3d91-4dc4-b837-c1ca4d3ff07b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/675929d3-2e03-413b-9bbf-40c207974b3b?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:41:25.6873522+00:00\",\r\n \"\ - endTime\": \"2020-05-18T15:41:25.8435865+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"2858a509-3d91-4dc4-b837-c1ca4d3ff07b\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T06:33:47.0442644+00:00\",\r\n \"\ + endTime\": \"2020-09-16T06:33:47.2010165+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"675929d3-2e03-413b-9bbf-40c207974b3b\"\r\n}" headers: cache-control: - no-cache @@ -2894,7 +2789,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:41:57 GMT + - Wed, 16 Sep 2020 06:34:20 GMT expires: - '-1' pragma: @@ -2911,7 +2806,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29954 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29961 status: code: 200 message: OK @@ -2925,54 +2820,55 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"virtualmachinex15cf0eff\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff\"\ ,\r\n \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\"\ - : \"eastus\",\r\n \"properties\": {\r\n \"vmId\": \"ab70a5c7-54fb-4278-830e-d4e3636657b2\"\ + : \"eastus\",\r\n \"properties\": {\r\n \"vmId\": \"d513c9d3-b764-446e-b2cd-7613552ca441\"\ ,\r\n \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_D2_v2\"\r\n\ \ },\r\n \"storageProfile\": {\r\n \"imageReference\": {\r\n \ \ \"publisher\": \"MicrosoftWindowsServer\",\r\n \"offer\": \"\ WindowsServer\",\r\n \"sku\": \"2016-Datacenter\",\r\n \"version\"\ - : \"latest\",\r\n \"exactVersion\": \"14393.3686.2005061700\"\r\n \ + : \"latest\",\r\n \"exactVersion\": \"14393.3930.2009041537\"\r\n \ \ },\r\n \"osDisk\": {\r\n \"osType\": \"Windows\",\r\n \ \ \"name\": \"myVMosdisk\",\r\n \"createOption\": \"FromImage\"\ ,\r\n \"caching\": \"ReadWrite\",\r\n \"managedDisk\": {\r\n\ \ \"storageAccountType\": \"Standard_LRS\",\r\n \"id\":\ - \ \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/myVMosdisk\"\ + \ \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/FAXZB4WAN4C5ZDFF2TSY6FQPLDOK5YNVP7S75Z543ONA77DLSBCJ2FIIF4EPNL6GSZTONVX7NEN/providers/Microsoft.Compute/disks/myVMosdisk\"\ \r\n },\r\n \"diskSizeGB\": 127\r\n },\r\n \"dataDisks\"\ - : [\r\n {\r\n \"lun\": 0,\r\n \"name\": \"virtualmachinex15cf0eff_disk2_f1a5fa7495ce4869939f251422bf7e5d\"\ + : [\r\n {\r\n \"lun\": 0,\r\n \"name\": \"virtualmachinex15cf0eff_disk2_361599c7f509421eadec1b2964391d52\"\ ,\r\n \"createOption\": \"Empty\",\r\n \"caching\": \"None\"\ ,\r\n \"managedDisk\": {\r\n \"storageAccountType\": \"\ - Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/virtualmachinex15cf0eff_disk2_f1a5fa7495ce4869939f251422bf7e5d\"\ + Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/FAXZB4WAN4C5ZDFF2TSY6FQPLDOK5YNVP7S75Z543ONA77DLSBCJ2FIIF4EPNL6GSZTONVX7NEN/providers/Microsoft.Compute/disks/virtualmachinex15cf0eff_disk2_361599c7f509421eadec1b2964391d52\"\ \r\n },\r\n \"diskSizeGB\": 1023,\r\n \"toBeDetached\"\ : false\r\n },\r\n {\r\n \"lun\": 1,\r\n \"\ - name\": \"virtualmachinex15cf0eff_disk3_c01d0c9587e249aa992d4b95d8674c96\"\ + name\": \"virtualmachinex15cf0eff_disk3_91f87690dd80480883677659a660dda4\"\ ,\r\n \"createOption\": \"Empty\",\r\n \"caching\": \"None\"\ ,\r\n \"managedDisk\": {\r\n \"storageAccountType\": \"\ - Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/virtualmachinex15cf0eff_disk3_c01d0c9587e249aa992d4b95d8674c96\"\ + Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/FAXZB4WAN4C5ZDFF2TSY6FQPLDOK5YNVP7S75Z543ONA77DLSBCJ2FIIF4EPNL6GSZTONVX7NEN/providers/Microsoft.Compute/disks/virtualmachinex15cf0eff_disk3_91f87690dd80480883677659a660dda4\"\ \r\n },\r\n \"diskSizeGB\": 1023,\r\n \"toBeDetached\"\ : false\r\n }\r\n ]\r\n },\r\n \"osProfile\": {\r\n \ \ \"computerName\": \"myVM\",\r\n \"adminUsername\": \"testuser\",\r\ \n \"windowsConfiguration\": {\r\n \"provisionVMAgent\": true,\r\ - \n \"enableAutomaticUpdates\": true\r\n },\r\n \"secrets\"\ - : [],\r\n \"allowExtensionOperations\": true,\r\n \"requireGuestProvisionSignal\"\ - : true\r\n },\r\n \"networkProfile\": {\"networkInterfaces\":[{\"id\"\ - :\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacex15cf0eff\"\ + \n \"enableAutomaticUpdates\": true,\r\n \"patchSettings\":\ + \ {\r\n \"patchMode\": \"AutomaticByOS\"\r\n }\r\n },\r\ + \n \"secrets\": [],\r\n \"allowExtensionOperations\": true,\r\n\ + \ \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\"\ + : {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacex15cf0eff\"\ ,\"properties\":{\"primary\":true}}]},\r\n \"provisioningState\": \"Succeeded\"\ \r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '2985' + - '3220' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:41:57 GMT + - Wed, 16 Sep 2020 06:34:21 GMT expires: - '-1' pragma: @@ -2989,7 +2885,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;3995,Microsoft.Compute/LowCostGet30Min;31981 + - Microsoft.Compute/LowCostGet3Min;3995,Microsoft.Compute/LowCostGet30Min;31985 status: code: 200 message: OK @@ -3005,9 +2901,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/generalize?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/generalize?api-version=2020-06-01 response: body: string: '' @@ -3017,7 +2913,7 @@ interactions: content-length: - '0' date: - - Mon, 18 May 2020 15:41:58 GMT + - Wed, 16 Sep 2020 06:34:21 GMT expires: - '-1' pragma: @@ -3032,7 +2928,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/UpdateVM3Min;236,Microsoft.Compute/UpdateVM30Min;1189 x-ms-ratelimit-remaining-subscription-writes: - - '1188' + - '1189' status: code: 200 message: OK @@ -3048,25 +2944,25 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/deallocate?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/deallocate?api-version=2020-06-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/547a379f-9dc4-4717-ae51-9e83fed1fc22?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efd9795b-d31a-4f0f-84e3-50d596a20c93?api-version=2020-06-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 18 May 2020 15:41:58 GMT + - Wed, 16 Sep 2020 06:34:22 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/547a379f-9dc4-4717-ae51-9e83fed1fc22?monitor=true&api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efd9795b-d31a-4f0f-84e3-50d596a20c93?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -3079,7 +2975,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/DeleteVM3Min;239,Microsoft.Compute/DeleteVM30Min;1199 x-ms-ratelimit-remaining-subscription-writes: - - '1187' + - '1188' status: code: 202 message: Accepted @@ -3093,13 +2989,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/547a379f-9dc4-4717-ae51-9e83fed1fc22?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efd9795b-d31a-4f0f-84e3-50d596a20c93?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:41:58.9375261+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"547a379f-9dc4-4717-ae51-9e83fed1fc22\"\ + string: "{\r\n \"startTime\": \"2020-09-16T06:34:22.0914429+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"efd9795b-d31a-4f0f-84e3-50d596a20c93\"\ \r\n}" headers: cache-control: @@ -3109,7 +3005,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:42:08 GMT + - Wed, 16 Sep 2020 06:34:32 GMT expires: - '-1' pragma: @@ -3126,7 +3022,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29953 + - Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29960 status: code: 200 message: OK @@ -3140,14 +3036,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/547a379f-9dc4-4717-ae51-9e83fed1fc22?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efd9795b-d31a-4f0f-84e3-50d596a20c93?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:41:58.9375261+00:00\",\r\n \"\ - endTime\": \"2020-05-18T15:42:41.8126617+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"547a379f-9dc4-4717-ae51-9e83fed1fc22\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T06:34:22.0914429+00:00\",\r\n \"\ + endTime\": \"2020-09-16T06:34:50.4822763+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"efd9795b-d31a-4f0f-84e3-50d596a20c93\"\r\n}" headers: cache-control: - no-cache @@ -3156,7 +3052,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:42:45 GMT + - Wed, 16 Sep 2020 06:35:08 GMT expires: - '-1' pragma: @@ -3173,7 +3069,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29949 + - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29956 status: code: 200 message: OK @@ -3187,9 +3083,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/547a379f-9dc4-4717-ae51-9e83fed1fc22?monitor=true&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efd9795b-d31a-4f0f-84e3-50d596a20c93?monitor=true&api-version=2020-06-01 response: body: string: '' @@ -3199,7 +3095,7 @@ interactions: content-length: - '0' date: - - Mon, 18 May 2020 15:42:45 GMT + - Wed, 16 Sep 2020 06:35:08 GMT expires: - '-1' pragma: @@ -3212,7 +3108,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29948 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29955 status: code: 200 message: OK @@ -3228,9 +3124,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff?api-version=2020-06-01 response: body: string: '' @@ -3238,17 +3134,17 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/02e22ab6-5127-40d4-9a64-26d81e14fc7c?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/faab8e63-e05f-4029-81db-b1b9a1cc6917?api-version=2020-06-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 18 May 2020 15:42:46 GMT + - Wed, 16 Sep 2020 06:35:09 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/02e22ab6-5127-40d4-9a64-26d81e14fc7c?monitor=true&api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/faab8e63-e05f-4029-81db-b1b9a1cc6917?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -3261,7 +3157,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/DeleteVM3Min;238,Microsoft.Compute/DeleteVM30Min;1198 x-ms-ratelimit-remaining-subscription-deletes: - - '14996' + - '14992' status: code: 202 message: Accepted @@ -3275,14 +3171,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/02e22ab6-5127-40d4-9a64-26d81e14fc7c?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/faab8e63-e05f-4029-81db-b1b9a1cc6917?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:42:46.5158015+00:00\",\r\n \"\ - endTime\": \"2020-05-18T15:42:47.0314283+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"02e22ab6-5127-40d4-9a64-26d81e14fc7c\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T06:35:09.8261516+00:00\",\r\n \"\ + endTime\": \"2020-09-16T06:35:10.3886556+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"faab8e63-e05f-4029-81db-b1b9a1cc6917\"\r\n}" headers: cache-control: - no-cache @@ -3291,7 +3187,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:42:56 GMT + - Wed, 16 Sep 2020 06:35:19 GMT expires: - '-1' pragma: @@ -3308,7 +3204,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29946 + - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29953 status: code: 200 message: OK diff --git a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vm.test_compute_vm_2.yaml b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vm.test_compute_vm_2.yaml index 15eb2b5d6d4b..3342cb270b62 100644 --- a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vm.test_compute_vm_2.yaml +++ b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vm.test_compute_vm_2.yaml @@ -12,21 +12,18 @@ interactions: Content-Length: - '92' Content-Type: - - application/json; charset=utf-8 + - application/json User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex34bd0f90?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex34bd0f90?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"networknamex34bd0f90\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex34bd0f90\"\ - ,\r\n \"etag\": \"W/\\\"7b5b5f5a-bf01-4541-ba27-0418adc0e907\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"cd0bde1b-9c71-42ae-bc35-078b87b954d0\\\"\",\r\n \ \ \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \ - \ \"resourceGuid\": \"afc352ae-94c1-401f-bedf-88f6771c5787\",\r\n \"\ + \ \"resourceGuid\": \"93e9b02a-d76f-41c8-9fa7-e02c4bd0951d\",\r\n \"\ addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\ \r\n ]\r\n },\r\n \"subnets\": [],\r\n \"virtualNetworkPeerings\"\ : [],\r\n \"enableDdosProtection\": false,\r\n \"enableVmProtection\"\ @@ -35,15 +32,15 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/5632903c-88ac-4b00-832f-fe284ca6df66?api-version=2020-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/60fafc3b-c9e9-4c55-b5a0-951bf223db0e?api-version=2020-06-01 cache-control: - no-cache content-length: - - '698' + - '727' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:43:06 GMT + - Wed, 16 Sep 2020 06:35:38 GMT expires: - '-1' pragma: @@ -56,9 +53,9 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 35c3e7db-9257-4e54-9010-b11de50a6be7 + - 6b64fbfd-d976-4f0c-9b2a-8a8478aeaadc x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1198' status: code: 201 message: Created @@ -66,16 +63,15 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/5632903c-88ac-4b00-832f-fe284ca6df66?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/60fafc3b-c9e9-4c55-b5a0-951bf223db0e?api-version=2020-06-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -87,7 +83,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:43:10 GMT + - Wed, 16 Sep 2020 06:35:42 GMT expires: - '-1' pragma: @@ -104,7 +100,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 77639672-22e4-4ab2-971e-3b7198778961 + - 42b45fc5-8ab4-4413-b300-3a0646043508 status: code: 200 message: OK @@ -112,23 +108,22 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex34bd0f90?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex34bd0f90?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"networknamex34bd0f90\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex34bd0f90\"\ - ,\r\n \"etag\": \"W/\\\"7ec7ac87-1be2-4bfd-9c9a-58926a6b469a\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"12e97bd2-6d9f-4916-9498-cfc987bec8f2\\\"\",\r\n \ \ \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n\ - \ \"resourceGuid\": \"afc352ae-94c1-401f-bedf-88f6771c5787\",\r\n \"\ + \ \"resourceGuid\": \"93e9b02a-d76f-41c8-9fa7-e02c4bd0951d\",\r\n \"\ addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\ \r\n ]\r\n },\r\n \"subnets\": [],\r\n \"virtualNetworkPeerings\"\ : [],\r\n \"enableDdosProtection\": false,\r\n \"enableVmProtection\"\ @@ -137,13 +132,13 @@ interactions: cache-control: - no-cache content-length: - - '699' + - '728' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:43:10 GMT + - Wed, 16 Sep 2020 06:35:43 GMT etag: - - W/"7ec7ac87-1be2-4bfd-9c9a-58926a6b469a" + - W/"12e97bd2-6d9f-4916-9498-cfc987bec8f2" expires: - '-1' pragma: @@ -160,7 +155,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 089134df-2f5e-4ff4-9925-eb5dce254579 + - 9fa9e469-15b7-402c-9b58-3f254b13cd7b status: code: 200 message: OK @@ -176,33 +171,30 @@ interactions: Content-Length: - '48' Content-Type: - - application/json; charset=utf-8 + - application/json User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex34bd0f90/subnets/subnetx34bd0f90?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex34bd0f90/subnets/subnetx34bd0f90?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"subnetx34bd0f90\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex34bd0f90/subnets/subnetx34bd0f90\"\ - ,\r\n \"etag\": \"W/\\\"d61c209a-1dbe-493a-9925-12c6db36e41c\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"1b501770-8d37-401b-ad4f-2cea5b479a9e\\\"\",\r\n \ \ \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"\ addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\"\ : \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\ \n },\r\n \"type\": \"Microsoft.Network/virtualNetworks/subnets\"\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/7ce0a395-8bed-4a16-980d-ad6633fe32b0?api-version=2020-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/f1d8b010-cc3c-42ed-bc1b-350c4cad3c65?api-version=2020-06-01 cache-control: - no-cache content-length: - - '587' + - '616' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:43:11 GMT + - Wed, 16 Sep 2020 06:35:44 GMT expires: - '-1' pragma: @@ -215,9 +207,9 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - fb764a5b-c5ea-41b6-810f-17dc8e351832 + - 4911a72d-9724-4e3f-a61e-3d6b762700e0 x-ms-ratelimit-remaining-subscription-writes: - - '1194' + - '1197' status: code: 201 message: Created @@ -225,16 +217,15 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/7ce0a395-8bed-4a16-980d-ad6633fe32b0?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/f1d8b010-cc3c-42ed-bc1b-350c4cad3c65?api-version=2020-06-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -246,7 +237,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:43:15 GMT + - Wed, 16 Sep 2020 06:35:47 GMT expires: - '-1' pragma: @@ -263,7 +254,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - ea4c6142-13e7-4ea1-bba4-18d1ef0a4f0b + - d0de511c-d2a9-43f2-ac91-d4d691abe244 status: code: 200 message: OK @@ -271,20 +262,19 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex34bd0f90/subnets/subnetx34bd0f90?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex34bd0f90/subnets/subnetx34bd0f90?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"subnetx34bd0f90\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex34bd0f90/subnets/subnetx34bd0f90\"\ - ,\r\n \"etag\": \"W/\\\"93722ec3-cd97-4962-8af4-25e95a8bf99d\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"0926d9e3-3169-4053-a5cd-9dd73591c037\\\"\",\r\n \ \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"\ addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\"\ : \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\ @@ -293,13 +283,13 @@ interactions: cache-control: - no-cache content-length: - - '588' + - '617' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:43:15 GMT + - Wed, 16 Sep 2020 06:35:48 GMT etag: - - W/"93722ec3-cd97-4962-8af4-25e95a8bf99d" + - W/"0926d9e3-3169-4053-a5cd-9dd73591c037" expires: - '-1' pragma: @@ -316,14 +306,13 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - d3df10bc-d4a3-443b-a57c-601eaac01970 + - dfbf4f26-1fbd-4891-b1c6-f8beda9835d5 status: code: 200 message: OK - request: - body: 'b''{"location": "eastus", "properties": {"ipConfigurations": [{"properties": - {"subnet": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex34bd0f90/subnets/subnetx34bd0f90"}}, - "name": "MyIpConfig"}]}}''' + body: 'b''b\''{"location": "eastus", "properties": {"ipConfigurations": [{"name": + "MyIpConfig", "properties": {"subnet": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex34bd0f90/subnets/subnetx34bd0f90"}}}]}}\''''' headers: Accept: - application/json @@ -332,25 +321,22 @@ interactions: Connection: - keep-alive Content-Length: - - '324' + - '353' Content-Type: - - application/json; charset=utf-8 + - application/json User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacex34bd0f90?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacex34bd0f90?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"interfacex34bd0f90\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacex34bd0f90\"\ - ,\r\n \"etag\": \"W/\\\"9d9ad449-a546-4b34-985e-6c7719c079fa\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"fd0654b8-83e6-4230-aa55-12e61d943784\\\"\",\r\n \ \ \"location\": \"eastus\",\r\n \"properties\": {\r\n \"provisioningState\"\ - : \"Succeeded\",\r\n \"resourceGuid\": \"f67470fd-98f0-46a2-8bf2-d5e001fe45fc\"\ + : \"Succeeded\",\r\n \"resourceGuid\": \"d881b0b4-54cb-4899-b312-d166b914205a\"\ ,\r\n \"ipConfigurations\": [\r\n {\r\n \"name\": \"MyIpConfig\"\ ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacex34bd0f90/ipConfigurations/MyIpConfig\"\ - ,\r\n \"etag\": \"W/\\\"9d9ad449-a546-4b34-985e-6c7719c079fa\\\"\"\ + ,\r\n \"etag\": \"W/\\\"fd0654b8-83e6-4230-aa55-12e61d943784\\\"\"\ ,\r\n \"type\": \"Microsoft.Network/networkInterfaces/ipConfigurations\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\ ,\r\n \"privateIPAddress\": \"10.0.0.4\",\r\n \"privateIPAllocationMethod\"\ @@ -358,7 +344,7 @@ interactions: \r\n },\r\n \"primary\": true,\r\n \"privateIPAddressVersion\"\ : \"IPv4\"\r\n }\r\n }\r\n ],\r\n \"dnsSettings\": {\r\n\ \ \"dnsServers\": [],\r\n \"appliedDnsServers\": [],\r\n \"\ - internalDomainNameSuffix\": \"vzjmhl4bsqpubpw5rd1hohcxqh.bx.internal.cloudapp.net\"\ + internalDomainNameSuffix\": \"fkyote1p05eedh3h2awexuevdf.bx.internal.cloudapp.net\"\ \r\n },\r\n \"enableAcceleratedNetworking\": false,\r\n \"enableIPForwarding\"\ : false,\r\n \"hostedWorkloads\": [],\r\n \"tapConfigurations\": [],\r\ \n \"nicType\": \"Standard\"\r\n },\r\n \"type\": \"Microsoft.Network/networkInterfaces\"\ @@ -367,15 +353,15 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/ee38956f-9d20-44e2-81da-1ef619394b03?api-version=2020-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/aa1e86e2-9441-4bb3-a263-7fb979d4c48e?api-version=2020-06-01 cache-control: - no-cache content-length: - - '1776' + - '1863' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:43:17 GMT + - Wed, 16 Sep 2020 06:35:52 GMT expires: - '-1' pragma: @@ -388,9 +374,9 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - b5efcd62-2dea-470c-a714-6d8ff7ca4b74 + - 874b9c81-b6a1-4bee-a7dd-69f73b98464e x-ms-ratelimit-remaining-subscription-writes: - - '1193' + - '1196' status: code: 201 message: Created @@ -398,16 +384,15 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/ee38956f-9d20-44e2-81da-1ef619394b03?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/aa1e86e2-9441-4bb3-a263-7fb979d4c48e?api-version=2020-06-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -419,7 +404,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:43:48 GMT + - Wed, 16 Sep 2020 06:36:23 GMT expires: - '-1' pragma: @@ -436,7 +421,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 36897815-e563-400b-8b3e-1fdcfc8aeb77 + - 4950de04-e1cb-4f6e-90a9-7081b61aea23 status: code: 200 message: OK @@ -444,25 +429,24 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacex34bd0f90?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacex34bd0f90?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"interfacex34bd0f90\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacex34bd0f90\"\ - ,\r\n \"etag\": \"W/\\\"9d9ad449-a546-4b34-985e-6c7719c079fa\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"fd0654b8-83e6-4230-aa55-12e61d943784\\\"\",\r\n \ \ \"location\": \"eastus\",\r\n \"properties\": {\r\n \"provisioningState\"\ - : \"Succeeded\",\r\n \"resourceGuid\": \"f67470fd-98f0-46a2-8bf2-d5e001fe45fc\"\ + : \"Succeeded\",\r\n \"resourceGuid\": \"d881b0b4-54cb-4899-b312-d166b914205a\"\ ,\r\n \"ipConfigurations\": [\r\n {\r\n \"name\": \"MyIpConfig\"\ ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacex34bd0f90/ipConfigurations/MyIpConfig\"\ - ,\r\n \"etag\": \"W/\\\"9d9ad449-a546-4b34-985e-6c7719c079fa\\\"\"\ + ,\r\n \"etag\": \"W/\\\"fd0654b8-83e6-4230-aa55-12e61d943784\\\"\"\ ,\r\n \"type\": \"Microsoft.Network/networkInterfaces/ipConfigurations\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\ ,\r\n \"privateIPAddress\": \"10.0.0.4\",\r\n \"privateIPAllocationMethod\"\ @@ -470,7 +454,7 @@ interactions: \r\n },\r\n \"primary\": true,\r\n \"privateIPAddressVersion\"\ : \"IPv4\"\r\n }\r\n }\r\n ],\r\n \"dnsSettings\": {\r\n\ \ \"dnsServers\": [],\r\n \"appliedDnsServers\": [],\r\n \"\ - internalDomainNameSuffix\": \"vzjmhl4bsqpubpw5rd1hohcxqh.bx.internal.cloudapp.net\"\ + internalDomainNameSuffix\": \"fkyote1p05eedh3h2awexuevdf.bx.internal.cloudapp.net\"\ \r\n },\r\n \"enableAcceleratedNetworking\": false,\r\n \"enableIPForwarding\"\ : false,\r\n \"hostedWorkloads\": [],\r\n \"tapConfigurations\": [],\r\ \n \"nicType\": \"Standard\"\r\n },\r\n \"type\": \"Microsoft.Network/networkInterfaces\"\ @@ -479,13 +463,13 @@ interactions: cache-control: - no-cache content-length: - - '1776' + - '1863' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:43:48 GMT + - Wed, 16 Sep 2020 06:36:23 GMT etag: - - W/"9d9ad449-a546-4b34-985e-6c7719c079fa" + - W/"fd0654b8-83e6-4230-aa55-12e61d943784" expires: - '-1' pragma: @@ -502,12 +486,12 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 28b91006-8565-485b-8f83-62ec20ec0b13 + - 4535d8b6-170c-4b91-9f0e-873071592ae8 status: code: 200 message: OK - request: - body: 'b''{"location": "eastus", "properties": {"hardwareProfile": {"vmSize": + body: 'b''b\''{"location": "eastus", "properties": {"hardwareProfile": {"vmSize": "Standard_D2_v2"}, "storageProfile": {"imageReference": {"publisher": "MicrosoftWindowsServer", "offer": "WindowsServer", "sku": "2016-Datacenter", "version": "latest"}, "osDisk": {"name": "myVMosdisk", "caching": "ReadWrite", "createOption": "FromImage"}}, @@ -515,7 +499,7 @@ interactions: "Aa1!zyx_", "windowsConfiguration": {"enableAutomaticUpdates": true}}, "networkProfile": {"networkInterfaces": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacex34bd0f90", "properties": {"primary": true}}]}, "priority": "Spot", "evictionPolicy": "Deallocate", - "billingProfile": {"maxPrice": 1.0}}}''' + "billingProfile": {"maxPrice": 1.0}}}\''''' headers: Accept: - application/json @@ -524,23 +508,23 @@ interactions: Connection: - keep-alive Content-Length: - - '836' + - '865' Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex34bd0f90?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex34bd0f90?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"virtualmachinex34bd0f90\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex34bd0f90\"\ ,\r\n \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\"\ - : \"eastus\",\r\n \"properties\": {\r\n \"vmId\": \"03495560-8320-4809-bb31-deafa7beaf6a\"\ + : \"eastus\",\r\n \"properties\": {\r\n \"vmId\": \"53c3fe81-2151-4b9a-8a09-e4e197c2bc7d\"\ ,\r\n \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_D2_v2\"\r\n\ \ },\r\n \"storageProfile\": {\r\n \"imageReference\": {\r\n \ \ \"publisher\": \"MicrosoftWindowsServer\",\r\n \"offer\": \"\ WindowsServer\",\r\n \"sku\": \"2016-Datacenter\",\r\n \"version\"\ - : \"latest\",\r\n \"exactVersion\": \"14393.3686.2005061700\"\r\n \ + : \"latest\",\r\n \"exactVersion\": \"14393.3930.2009041537\"\r\n \ \ },\r\n \"osDisk\": {\r\n \"osType\": \"Windows\",\r\n \ \ \"name\": \"myVMosdisk\",\r\n \"createOption\": \"FromImage\"\ ,\r\n \"caching\": \"ReadWrite\",\r\n \"managedDisk\": {\r\n\ @@ -548,10 +532,11 @@ interactions: \ \"diskSizeGB\": 127\r\n },\r\n \"dataDisks\": []\r\n },\r\ \n \"osProfile\": {\r\n \"computerName\": \"myVM\",\r\n \"adminUsername\"\ : \"testuser\",\r\n \"windowsConfiguration\": {\r\n \"provisionVMAgent\"\ - : true,\r\n \"enableAutomaticUpdates\": true\r\n },\r\n \"\ - secrets\": [],\r\n \"allowExtensionOperations\": true,\r\n \"requireGuestProvisionSignal\"\ - : true\r\n },\r\n \"networkProfile\": {\"networkInterfaces\":[{\"id\"\ - :\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacex34bd0f90\"\ + : true,\r\n \"enableAutomaticUpdates\": true,\r\n \"patchSettings\"\ + : {\r\n \"patchMode\": \"AutomaticByOS\"\r\n }\r\n },\r\ + \n \"secrets\": [],\r\n \"allowExtensionOperations\": true,\r\n\ + \ \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\"\ + : {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacex34bd0f90\"\ ,\"properties\":{\"primary\":true}}]},\r\n \"provisioningState\": \"Creating\"\ ,\r\n \"priority\": \"Spot\",\r\n \"evictionPolicy\": \"Deallocate\"\ ,\r\n \"billingProfile\": {\r\n \"maxPrice\": 1.0\r\n }\r\n }\r\ @@ -560,15 +545,15 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1d5fc1e2-29fd-46a1-a0d7-383ac6148485?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3164c9cd-649a-443c-ad65-bbc978adb14d?api-version=2020-06-01 cache-control: - no-cache content-length: - - '1758' + - '1896' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:43:55 GMT + - Wed, 16 Sep 2020 06:36:32 GMT expires: - '-1' pragma: @@ -581,9 +566,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/PutVM3Min;573,Microsoft.Compute/PutVM30Min;2876 + - Microsoft.Compute/PutVM3Min;239,Microsoft.Compute/PutVM30Min;1197 x-ms-ratelimit-remaining-subscription-writes: - - '1196' + - '1183' status: code: 201 message: Created @@ -597,13 +582,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1d5fc1e2-29fd-46a1-a0d7-383ac6148485?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3164c9cd-649a-443c-ad65-bbc978adb14d?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:43:55.2345748+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"1d5fc1e2-29fd-46a1-a0d7-383ac6148485\"\ + string: "{\r\n \"startTime\": \"2020-09-16T06:36:31.6704886+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"3164c9cd-649a-443c-ad65-bbc978adb14d\"\ \r\n}" headers: cache-control: @@ -613,7 +598,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:44:06 GMT + - Wed, 16 Sep 2020 06:36:43 GMT expires: - '-1' pragma: @@ -630,7 +615,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14990,Microsoft.Compute/GetOperation30Min;29945 + - Microsoft.Compute/GetOperation3Min;14990,Microsoft.Compute/GetOperation30Min;29952 status: code: 200 message: OK @@ -644,13 +629,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1d5fc1e2-29fd-46a1-a0d7-383ac6148485?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3164c9cd-649a-443c-ad65-bbc978adb14d?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:43:55.2345748+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"1d5fc1e2-29fd-46a1-a0d7-383ac6148485\"\ + string: "{\r\n \"startTime\": \"2020-09-16T06:36:31.6704886+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"3164c9cd-649a-443c-ad65-bbc978adb14d\"\ \r\n}" headers: cache-control: @@ -660,7 +645,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:44:56 GMT + - Wed, 16 Sep 2020 06:37:33 GMT expires: - '-1' pragma: @@ -677,7 +662,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14990,Microsoft.Compute/GetOperation30Min;29944 + - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29951 status: code: 200 message: OK @@ -691,14 +676,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1d5fc1e2-29fd-46a1-a0d7-383ac6148485?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3164c9cd-649a-443c-ad65-bbc978adb14d?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:43:55.2345748+00:00\",\r\n \"\ - endTime\": \"2020-05-18T15:44:57.2039445+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"1d5fc1e2-29fd-46a1-a0d7-383ac6148485\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T06:36:31.6704886+00:00\",\r\n \"\ + endTime\": \"2020-09-16T06:38:01.7491758+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"3164c9cd-649a-443c-ad65-bbc978adb14d\"\r\n}" headers: cache-control: - no-cache @@ -707,7 +692,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:45:26 GMT + - Wed, 16 Sep 2020 06:38:04 GMT expires: - '-1' pragma: @@ -724,7 +709,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14991,Microsoft.Compute/GetOperation30Min;29946 + - Microsoft.Compute/GetOperation3Min;14997,Microsoft.Compute/GetOperation30Min;29950 status: code: 200 message: OK @@ -738,29 +723,30 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex34bd0f90?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex34bd0f90?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"virtualmachinex34bd0f90\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex34bd0f90\"\ ,\r\n \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\"\ - : \"eastus\",\r\n \"properties\": {\r\n \"vmId\": \"03495560-8320-4809-bb31-deafa7beaf6a\"\ + : \"eastus\",\r\n \"properties\": {\r\n \"vmId\": \"53c3fe81-2151-4b9a-8a09-e4e197c2bc7d\"\ ,\r\n \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_D2_v2\"\r\n\ \ },\r\n \"storageProfile\": {\r\n \"imageReference\": {\r\n \ \ \"publisher\": \"MicrosoftWindowsServer\",\r\n \"offer\": \"\ WindowsServer\",\r\n \"sku\": \"2016-Datacenter\",\r\n \"version\"\ - : \"latest\",\r\n \"exactVersion\": \"14393.3686.2005061700\"\r\n \ + : \"latest\",\r\n \"exactVersion\": \"14393.3930.2009041537\"\r\n \ \ },\r\n \"osDisk\": {\r\n \"osType\": \"Windows\",\r\n \ \ \"name\": \"myVMosdisk\",\r\n \"createOption\": \"FromImage\"\ ,\r\n \"caching\": \"ReadWrite\",\r\n \"managedDisk\": {\r\n\ \ \"storageAccountType\": \"Standard_LRS\",\r\n \"id\":\ - \ \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/myVMosdisk\"\ + \ \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/4GHJQLWY5C5C3W44O2YUCE3RCVMTQOJJ6XDP2DOTRNESYIEYMCBMZ24MO5UI5DZP6IPOM4ZIBL4/providers/Microsoft.Compute/disks/myVMosdisk\"\ \r\n },\r\n \"diskSizeGB\": 127\r\n },\r\n \"dataDisks\"\ : []\r\n },\r\n \"osProfile\": {\r\n \"computerName\": \"myVM\"\ ,\r\n \"adminUsername\": \"testuser\",\r\n \"windowsConfiguration\"\ : {\r\n \"provisionVMAgent\": true,\r\n \"enableAutomaticUpdates\"\ - : true\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\"\ + : true,\r\n \"patchSettings\": {\r\n \"patchMode\": \"AutomaticByOS\"\ + \r\n }\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\"\ : true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"\ networkProfile\": {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacex34bd0f90\"\ ,\"properties\":{\"primary\":true}}]},\r\n \"provisioningState\": \"Succeeded\"\ @@ -771,11 +757,11 @@ interactions: cache-control: - no-cache content-length: - - '1938' + - '2105' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:45:26 GMT + - Wed, 16 Sep 2020 06:38:04 GMT expires: - '-1' pragma: @@ -792,7 +778,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;3995,Microsoft.Compute/LowCostGet30Min;31977 + - Microsoft.Compute/LowCostGet3Min;3998,Microsoft.Compute/LowCostGet30Min;31980 status: code: 200 message: OK @@ -808,9 +794,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex34bd0f90/simulateEviction?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex34bd0f90/simulateEviction?api-version=2020-06-01 response: body: string: '' @@ -818,7 +804,7 @@ interactions: cache-control: - no-cache date: - - Mon, 18 May 2020 15:45:27 GMT + - Wed, 16 Sep 2020 06:38:05 GMT expires: - '-1' pragma: @@ -831,9 +817,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/DeleteVM3Min;238,Microsoft.Compute/DeleteVM30Min;1197 + - Microsoft.Compute/DeleteVM3Min;239,Microsoft.Compute/DeleteVM30Min;1197 x-ms-ratelimit-remaining-subscription-writes: - - '1196' + - '1187' status: code: 204 message: No Content @@ -849,9 +835,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex34bd0f90/performMaintenance?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex34bd0f90/performMaintenance?api-version=2020-06-01 response: body: string: "{\r\n \"error\": {\r\n \"code\": \"OperationNotAllowed\",\r\n \ @@ -865,7 +851,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:45:27 GMT + - Wed, 16 Sep 2020 06:38:05 GMT expires: - '-1' pragma: @@ -880,7 +866,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/UpdateVM3Min;239,Microsoft.Compute/UpdateVM30Min;1188 x-ms-ratelimit-remaining-subscription-writes: - - '1195' + - '1186' status: code: 409 message: Conflict @@ -896,9 +882,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex34bd0f90/convertToManagedDisks?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex34bd0f90/convertToManagedDisks?api-version=2020-06-01 response: body: string: "{\r\n \"error\": {\r\n \"code\": \"OperationNotAllowed\",\r\n \ @@ -912,7 +898,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:45:28 GMT + - Wed, 16 Sep 2020 06:38:06 GMT expires: - '-1' pragma: @@ -927,7 +913,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/UpdateVM3Min;238,Microsoft.Compute/UpdateVM30Min;1187 x-ms-ratelimit-remaining-subscription-writes: - - '1194' + - '1185' status: code: 409 message: Conflict @@ -945,9 +931,9 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex34bd0f90/reimage?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex34bd0f90/reimage?api-version=2020-06-01 response: body: string: "{\r\n \"error\": {\r\n \"code\": \"OperationNotAllowed\",\r\n \ @@ -962,7 +948,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:45:29 GMT + - Wed, 16 Sep 2020 06:38:06 GMT expires: - '-1' pragma: @@ -977,7 +963,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/UpdateVM3Min;237,Microsoft.Compute/UpdateVM30Min;1186 x-ms-ratelimit-remaining-subscription-writes: - - '1193' + - '1184' status: code: 409 message: Conflict @@ -993,9 +979,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex34bd0f90?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex34bd0f90?api-version=2020-06-01 response: body: string: '' @@ -1003,17 +989,17 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/786aab95-17d5-4a8c-8e69-a82330924f59?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2c56791f-981b-465d-b10c-0ce1aceea384?api-version=2020-06-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 18 May 2020 15:45:30 GMT + - Wed, 16 Sep 2020 06:38:07 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/786aab95-17d5-4a8c-8e69-a82330924f59?monitor=true&api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2c56791f-981b-465d-b10c-0ce1aceea384?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -1026,7 +1012,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/DeleteVM3Min;238,Microsoft.Compute/DeleteVM30Min;1196 x-ms-ratelimit-remaining-subscription-deletes: - - '14996' + - '14991' status: code: 202 message: Accepted @@ -1040,13 +1026,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/786aab95-17d5-4a8c-8e69-a82330924f59?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2c56791f-981b-465d-b10c-0ce1aceea384?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:45:30.7820714+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"786aab95-17d5-4a8c-8e69-a82330924f59\"\ + string: "{\r\n \"startTime\": \"2020-09-16T06:38:07.0773413+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"2c56791f-981b-465d-b10c-0ce1aceea384\"\ \r\n}" headers: cache-control: @@ -1056,7 +1042,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:45:40 GMT + - Wed, 16 Sep 2020 06:38:17 GMT expires: - '-1' pragma: @@ -1073,7 +1059,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14995,Microsoft.Compute/GetOperation30Min;29945 + - Microsoft.Compute/GetOperation3Min;14995,Microsoft.Compute/GetOperation30Min;29948 status: code: 200 message: OK @@ -1087,13 +1073,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/786aab95-17d5-4a8c-8e69-a82330924f59?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2c56791f-981b-465d-b10c-0ce1aceea384?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:45:30.7820714+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"786aab95-17d5-4a8c-8e69-a82330924f59\"\ + string: "{\r\n \"startTime\": \"2020-09-16T06:38:07.0773413+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"2c56791f-981b-465d-b10c-0ce1aceea384\"\ \r\n}" headers: cache-control: @@ -1103,7 +1089,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:46:10 GMT + - Wed, 16 Sep 2020 06:38:47 GMT expires: - '-1' pragma: @@ -1120,7 +1106,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14994,Microsoft.Compute/GetOperation30Min;29944 + - Microsoft.Compute/GetOperation3Min;14994,Microsoft.Compute/GetOperation30Min;29947 status: code: 200 message: OK @@ -1134,23 +1120,446 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/786aab95-17d5-4a8c-8e69-a82330924f59?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2c56791f-981b-465d-b10c-0ce1aceea384?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T15:45:30.7820714+00:00\",\r\n \"\ - endTime\": \"2020-05-18T15:46:14.891439+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"786aab95-17d5-4a8c-8e69-a82330924f59\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T06:38:07.0773413+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"2c56791f-981b-465d-b10c-0ce1aceea384\"\ + \r\n}" headers: cache-control: - no-cache content-length: - - '183' + - '134' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 06:39:17 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29946 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2c56791f-981b-465d-b10c-0ce1aceea384?api-version=2020-06-01 + response: + body: + string: "{\r\n \"startTime\": \"2020-09-16T06:38:07.0773413+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"2c56791f-981b-465d-b10c-0ce1aceea384\"\ + \r\n}" + headers: + cache-control: + - no-cache + content-length: + - '134' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 06:39:48 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29945 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2c56791f-981b-465d-b10c-0ce1aceea384?api-version=2020-06-01 + response: + body: + string: "{\r\n \"startTime\": \"2020-09-16T06:38:07.0773413+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"2c56791f-981b-465d-b10c-0ce1aceea384\"\ + \r\n}" + headers: + cache-control: + - no-cache + content-length: + - '134' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 06:40:18 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetOperation3Min;14991,Microsoft.Compute/GetOperation30Min;29943 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2c56791f-981b-465d-b10c-0ce1aceea384?api-version=2020-06-01 + response: + body: + string: "{\r\n \"startTime\": \"2020-09-16T06:38:07.0773413+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"2c56791f-981b-465d-b10c-0ce1aceea384\"\ + \r\n}" + headers: + cache-control: + - no-cache + content-length: + - '134' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 06:40:48 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetOperation3Min;14991,Microsoft.Compute/GetOperation30Min;29942 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2c56791f-981b-465d-b10c-0ce1aceea384?api-version=2020-06-01 + response: + body: + string: "{\r\n \"startTime\": \"2020-09-16T06:38:07.0773413+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"2c56791f-981b-465d-b10c-0ce1aceea384\"\ + \r\n}" + headers: + cache-control: + - no-cache + content-length: + - '134' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 06:41:20 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29941 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2c56791f-981b-465d-b10c-0ce1aceea384?api-version=2020-06-01 + response: + body: + string: "{\r\n \"startTime\": \"2020-09-16T06:38:07.0773413+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"2c56791f-981b-465d-b10c-0ce1aceea384\"\ + \r\n}" + headers: + cache-control: + - no-cache + content-length: + - '134' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 06:41:50 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29940 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2c56791f-981b-465d-b10c-0ce1aceea384?api-version=2020-06-01 + response: + body: + string: "{\r\n \"startTime\": \"2020-09-16T06:38:07.0773413+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"2c56791f-981b-465d-b10c-0ce1aceea384\"\ + \r\n}" + headers: + cache-control: + - no-cache + content-length: + - '134' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 06:42:20 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetOperation3Min;14992,Microsoft.Compute/GetOperation30Min;29938 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2c56791f-981b-465d-b10c-0ce1aceea384?api-version=2020-06-01 + response: + body: + string: "{\r\n \"startTime\": \"2020-09-16T06:38:07.0773413+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"2c56791f-981b-465d-b10c-0ce1aceea384\"\ + \r\n}" + headers: + cache-control: + - no-cache + content-length: + - '134' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 06:42:50 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetOperation3Min;14992,Microsoft.Compute/GetOperation30Min;29937 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2c56791f-981b-465d-b10c-0ce1aceea384?api-version=2020-06-01 + response: + body: + string: "{\r\n \"startTime\": \"2020-09-16T06:38:07.0773413+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"2c56791f-981b-465d-b10c-0ce1aceea384\"\ + \r\n}" + headers: + cache-control: + - no-cache + content-length: + - '134' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 06:43:21 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29936 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2c56791f-981b-465d-b10c-0ce1aceea384?api-version=2020-06-01 + response: + body: + string: "{\r\n \"startTime\": \"2020-09-16T06:38:07.0773413+00:00\",\r\n \"\ + endTime\": \"2020-09-16T06:43:31.0954502+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"2c56791f-981b-465d-b10c-0ce1aceea384\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '184' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:46:40 GMT + - Wed, 16 Sep 2020 06:43:51 GMT expires: - '-1' pragma: @@ -1167,7 +1576,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14992,Microsoft.Compute/GetOperation30Min;29942 + - Microsoft.Compute/GetOperation3Min;14992,Microsoft.Compute/GetOperation30Min;29934 status: code: 200 message: OK diff --git a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vm.test_compute_vm_extension_image.yaml b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vm.test_compute_vm_extension_image.yaml index d50d198e232f..3cfd43439147 100644 --- a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vm.test_compute_vm_extension_image.yaml +++ b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vm.test_compute_vm_extension_image.yaml @@ -9,9 +9,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/publishers/Microsoft.Compute/artifacttypes/vmextension/types/VMAccessAgent/versions/1.0.2?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/publishers/Microsoft.Compute/artifacttypes/vmextension/types/VMAccessAgent/versions/1.0.2?api-version=2020-06-01 response: body: string: "{\r\n \"properties\": {\r\n \"operatingSystem\": \"Windows\",\r\ @@ -28,7 +28,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:46:49 GMT + - Wed, 16 Sep 2020 06:44:03 GMT expires: - '-1' pragma: @@ -57,9 +57,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/publishers/Microsoft.Compute/artifacttypes/vmextension/types?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/publishers/Microsoft.Compute/artifacttypes/vmextension/types?api-version=2020-06-01 response: body: string: "[\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"BGInfo\"\ @@ -79,7 +79,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:46:49 GMT + - Wed, 16 Sep 2020 06:44:03 GMT expires: - '-1' pragma: @@ -108,9 +108,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/publishers/Microsoft.Compute/artifacttypes/vmextension/types/VMAccessAgent/versions?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/publishers/Microsoft.Compute/artifacttypes/vmextension/types/VMAccessAgent/versions?api-version=2020-06-01 response: body: string: "[\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"1.0\"\ @@ -150,7 +150,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:46:49 GMT + - Wed, 16 Sep 2020 06:44:03 GMT expires: - '-1' pragma: diff --git a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vm.test_compute_vm_image.yaml b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vm.test_compute_vm_image.yaml index 0fdf8da2d307..96fcfcfc5863 100644 --- a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vm.test_compute_vm_image.yaml +++ b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vm.test_compute_vm_image.yaml @@ -9,9 +9,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/publishers/MicrosoftWindowsServer/artifacttypes/vmimage/offers/WindowsServer/skus/2019-Datacenter/versions/2019.0.20190115?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/publishers/MicrosoftWindowsServer/artifacttypes/vmimage/offers/WindowsServer/skus/2019-Datacenter/versions/2019.0.20190115?api-version=2020-06-01 response: body: string: "{\r\n \"properties\": {\r\n \"hyperVGeneration\": \"V1\",\r\n \ @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:46:55 GMT + - Wed, 16 Sep 2020 06:44:12 GMT expires: - '-1' pragma: @@ -60,9 +60,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/publishers/MicrosoftWindowsServer/artifacttypes/vmimage/offers/WindowsServer/skus/2019-Datacenter/versions?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/publishers/MicrosoftWindowsServer/artifacttypes/vmimage/offers/WindowsServer/skus/2019-Datacenter/versions?api-version=2020-06-01 response: body: string: "[\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"17763.1039.2002091844\"\ @@ -73,10 +73,14 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2019-Datacenter/Versions/17763.1158.2004131759\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"17763.1217.2005081535\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2019-Datacenter/Versions/17763.1217.2005081535\"\ - \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"17763.557.1907191810\"\ - ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2019-Datacenter/Versions/17763.557.1907191810\"\ - \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"17763.557.20190604\"\ - ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2019-Datacenter/Versions/17763.557.20190604\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"17763.1282.2006061952\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2019-Datacenter/Versions/17763.1282.2006061952\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"17763.1339.2007101755\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2019-Datacenter/Versions/17763.1339.2007101755\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"17763.1397.2008070242\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2019-Datacenter/Versions/17763.1397.2008070242\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"17763.1457.2009030514\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2019-Datacenter/Versions/17763.1457.2009030514\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"17763.615.1907121548\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2019-Datacenter/Versions/17763.615.1907121548\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"17763.678.1908092216\"\ @@ -105,18 +109,16 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2019-Datacenter/Versions/2019.0.20190314\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"2019.0.20190410\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2019-Datacenter/Versions/2019.0.20190410\"\ - \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"2019.0.20190603\"\ - ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2019-Datacenter/Versions/2019.0.20190603\"\ \r\n }\r\n]" headers: cache-control: - no-cache content-length: - - '6500' + - '6835' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:46:55 GMT + - Wed, 16 Sep 2020 06:44:13 GMT expires: - '-1' pragma: @@ -145,13 +147,15 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/publishers/MicrosoftWindowsServer/artifacttypes/vmimage/offers?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/publishers/MicrosoftWindowsServer/artifacttypes/vmimage/offers?api-version=2020-06-01 response: body: string: "[\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"19h1gen2servertest\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/19h1gen2servertest\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"microsoftserveroperatingsystems-previews\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/microsoftserveroperatingsystems-previews\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"servertesting\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/servertesting\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"windows-10-1607-vhd-server-prod-stage\"\ @@ -184,6 +188,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"windowsserver-gen2preview\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/windowsserver-gen2preview\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"windowsserver-previewtest\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/windowsserver-previewtest\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"windowsserverdotnet\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/windowsserverdotnet\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"WindowsServerSemiAnnual\"\ @@ -193,11 +199,11 @@ interactions: cache-control: - no-cache content-length: - - '5490' + - '6078' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:46:56 GMT + - Wed, 16 Sep 2020 06:44:14 GMT expires: - '-1' pragma: @@ -226,9 +232,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/publishers?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/publishers?api-version=2020-06-01 response: body: string: "[\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"128technology\"\ @@ -237,12 +243,16 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/1580863854728\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"1583465680865\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/1583465680865\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"1585118004523\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/1585118004523\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"1e\",\r\ \n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/1e\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"2021ai\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/2021ai\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"3cx-pbx\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/3cx-pbx\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"42crunch1580391915541\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/42crunch1580391915541\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"4psa\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/4psa\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"5nine-software-inc\"\ @@ -251,6 +261,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/7isolutions\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"a10networks\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/a10networks\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"a10networks1596136698788\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/a10networks1596136698788\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"abiquo\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/abiquo\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"accedian\"\ @@ -263,6 +275,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/accessdata-group\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"accops\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/accops\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"aciworldwide\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/aciworldwide\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Acronis\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Acronis\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Acronis.Backup\"\ @@ -295,6 +309,10 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/affinio\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"aggregion-ltd\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/aggregion-ltd\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"ahnlabinc1584495174865\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/ahnlabinc1584495174865\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"ahnlabinc1584495467593\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/ahnlabinc1584495467593\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"airalabrus\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/airalabrus\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"aiscaler-cache-control-ddos-and-url-rewriting-\"\ @@ -305,6 +323,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/akumina\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"akumo-software\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/akumo-software\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"al-tamamunitedtradingcontractingcompany\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/al-tamamunitedtradingcontractingcompany\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"alachisoft\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/alachisoft\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"alertlogic\"\ @@ -407,6 +427,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/aviatrix-systems\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"awingu\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/awingu\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"axedrasag1590581171549\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/axedrasag1590581171549\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"axsguardablenv\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/axsguardablenv\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"axshco\"\ @@ -417,12 +439,16 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/axxana\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"azul\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/azul\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"azure-dockit\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/azure-dockit\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"azurecyclecloud\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/azurecyclecloud\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"AzureDatabricks\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/AzureDatabricks\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"azureopenshift\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/azureopenshift\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"AzureRT.ManagedServices.TestExtPublisher00\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/AzureRT.ManagedServices.TestExtPublisher00\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"AzureRT.Test\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/AzureRT.Test\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"azuretesting\"\ @@ -457,6 +483,10 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/beyondtrust\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"bi-builders-as\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/bi-builders-as\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"bissantechnology1583581147809\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/bissantechnology1583581147809\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"bitdefendercybersecurity\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/bitdefendercybersecurity\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Bitnami\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Bitnami\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"bizagi\"\ @@ -501,6 +531,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/brightcomputing\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"brocade_communications\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/brocade_communications\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"bryte\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/bryte\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"bssw\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/bssw\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"bt-americas-inc\"\ @@ -515,6 +547,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/carto\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"cask\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/cask\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"castaigroupinc1595243474856\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/castaigroupinc1595243474856\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"catechnologies\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/catechnologies\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"cautelalabs\"\ @@ -533,6 +567,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/center-for-internet-security-inc\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"centeritysystems\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/centeritysystems\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"centrocomputerspa1584528117084\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/centrocomputerspa1584528117084\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"certivox\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/certivox\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"cfd-direct\"\ @@ -583,6 +619,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/cloudcover\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"cloudenablers-inc\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/cloudenablers-inc\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"cloudentity\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/cloudentity\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"cloudera\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/cloudera\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"cloudflare\"\ @@ -625,6 +663,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/cohesity\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"cohesive\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/cohesive\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"coin-sciences-ltd\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/coin-sciences-ltd\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"collabcloudlimited\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/collabcloudlimited\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"commvault\"\ @@ -663,12 +703,20 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/CoreOS\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"couchbase\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/couchbase\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"cpanel\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/cpanel\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"credativ\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/credativ\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"crunchyard\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/crunchyard\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"cryptocom1585727786636\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/cryptocom1585727786636\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"cryptzone\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/cryptzone\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"ctm.bmc.com\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/ctm.bmc.com\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"cyberark\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/cyberark\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"cybernetica-as\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/cybernetica-as\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"cyxtera\"\ @@ -691,10 +739,14 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/datacore\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Datadog.Agent\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Datadog.Agent\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"dataguiseinc\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/dataguiseinc\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"dataiku\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/dataiku\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"datalayer\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/datalayer\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"datanomers1584919038987\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/datanomers1584919038987\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"datanova\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/datanova\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"datapredsa\"\ @@ -707,6 +759,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/datasunrise\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"datavirtualitygmbh\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/datavirtualitygmbh\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"dbs-h\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/dbs-h\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"ddn-whamcloud-5345716\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/ddn-whamcloud-5345716\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Debian\"\ @@ -715,6 +769,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/dece-4446019\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"decisosalesbv\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/decisosalesbv\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"deepcognitioninc1593512758156\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/deepcognitioninc1593512758156\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"dellemc\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/dellemc\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"dell_software\"\ @@ -737,6 +793,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/devopsgroup-uk\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"dgsecure\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/dgsecure\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Dh2ico\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Dh2ico\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"dh2icompany\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/dh2icompany\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"dhi\"\ @@ -787,8 +845,12 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/dynatrace\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"dynatrace.ruxit\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/dynatrace.ruxit\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"e-magicinc1587696283171\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/e-magicinc1587696283171\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"eastwind-networks-inc\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/eastwind-networks-inc\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"easysoftwaresro1593005637384\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/easysoftwaresro1593005637384\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"ecessa\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/ecessa\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"edevtech\"\ @@ -895,6 +957,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/formpipesoftwareab\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"forscene\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/forscene\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"fortanix\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/fortanix\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"fortinet\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/fortinet\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"fortycloud\"\ @@ -925,6 +989,10 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/GitHub\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"gitlab\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/gitlab\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"gitlabinc1586447921813\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/gitlabinc1586447921813\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"glantoninc1591876792991\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/glantoninc1591876792991\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"globalscape\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/globalscape\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"gluwareinc\"\ @@ -951,6 +1019,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/hackershub\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"haivision\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/haivision\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"haivisionsystemsinc1580780591922\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/haivisionsystemsinc1580780591922\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"hanu\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/hanu\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"haproxy-technologies\"\ @@ -1005,6 +1075,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/ibm\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"iboss\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/iboss\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"iconics\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/iconics\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"icubeconsultancyservicesinc\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/icubeconsultancyservicesinc\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"iguazio-5069960\"\ @@ -1017,12 +1089,20 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/imaginecommunications\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"imperva\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/imperva\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"impetustechnologiesinc1591959591877\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/impetustechnologiesinc1591959591877\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"imprivatainc1580479939967\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/imprivatainc1580479939967\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"incorta\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/incorta\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"incredibuild\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/incredibuild\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"indexima1594300233028\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/indexima1594300233028\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"industry-weapon\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/industry-weapon\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"industryweapon1587162781833\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/industryweapon1587162781833\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"influxdata\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/influxdata\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"infoblox\"\ @@ -1059,6 +1139,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/intigua\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"iofabric\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/iofabric\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"ipinfusion1590066770520\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/ipinfusion1590066770520\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"ipswitch\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/ipswitch\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"iqsol\"\ @@ -1075,6 +1157,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/isvtestukbigcat\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"isvtestuklegacy\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/isvtestuklegacy\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"it4bizdoo\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/it4bizdoo\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"itelios\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/itelios\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"iwnamespace\"\ @@ -1137,10 +1221,14 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/konginc1581527938760\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"konsys-ltd\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/konsys-ltd\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"koverseinc1588716263110\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/koverseinc1588716263110\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"kryonsystems\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/kryonsystems\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"krypc-technologies-pvt-ltd\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/krypc-technologies-pvt-ltd\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"kyligence\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/kyligence\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"kyvos-insights-inc\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/kyvos-insights-inc\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"lancom-systems\"\ @@ -1169,12 +1257,16 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/liquidware\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"literatu\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/literatu\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"litespeedtechnologies\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/litespeedtechnologies\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"litespeed_technologies\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/litespeed_technologies\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"litionenergiegmbh1580128829115\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/litionenergiegmbh1580128829115\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"litmusautomation1582760223280\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/litmusautomation1582760223280\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"lnw-softgmbh\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/lnw-softgmbh\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"loadbalancer\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/loadbalancer\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"logsign\"\ @@ -1219,6 +1311,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/meanio\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"media3-technologies-llc\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/media3-technologies-llc\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"mediatekinc1586141563888\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/mediatekinc1586141563888\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"mendix\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/mendix\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"messagesolution\"\ @@ -1255,6 +1349,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/microsoft-dsvm\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"microsoft-hyperv\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/microsoft-hyperv\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.AdminCenter\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.AdminCenter\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.AKS\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.AKS\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.ActiveDirectory\"\ @@ -1669,18 +1765,48 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.KeyVault.Edp\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.Monitor\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Monitor\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.Monitor.Agent\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Monitor.Agent\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.Monitor.Edp\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Monitor.Edp\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.Monitor.VirtualMachines\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Monitor.VirtualMachines\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.Monitor.VirtualMachines.Dev\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Monitor.VirtualMachines.Dev\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.Monitor.VirtualMachines.Dev.INT\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Monitor.VirtualMachines.Dev.INT\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.Monitor.VirtualMachines.Dev.SCALE\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Monitor.VirtualMachines.Dev.SCALE\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.Monitor.VirtualMachines.Dev.TEST\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Monitor.VirtualMachines.Dev.TEST\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.Monitor.VirtualMachines.INT.Dev\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Monitor.VirtualMachines.INT.Dev\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.Monitor.VirtualMachines.SCALE.Dev\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Monitor.VirtualMachines.SCALE.Dev\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.Monitor.VirtualMachines.TEST.Dev\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Monitor.VirtualMachines.TEST.Dev\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.Monitor.WorkloadInsights.Test\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Monitor.WorkloadInsights.Test\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.Monitor.WorkloadInsightsTest.newnamespace\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Monitor.WorkloadInsightsTest.newnamespace\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.Monitor.Workloads\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Monitor.Workloads\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.Monitoring.DependencyAgent\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Monitoring.DependencyAgent\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.Monitoring.DependencyAgent.Edp\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Monitoring.DependencyAgent.Edp\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.Networking.SDN\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Networking.SDN\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.NetworkWatcher\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.NetworkWatcher\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.NetworkWatcher.Test\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.NetworkWatcher.Test\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.OpenSSH\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.OpenSSH\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.Performance.Diagnostics\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Performance.Diagnostics\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.Performance.Diagnostics.Edp\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Performance.Diagnostics.Edp\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.RecoveryServices\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.RecoveryServices\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.RecoveryServices.Edp\"\ @@ -1701,6 +1827,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Security.AntimalwareSignature.Edp\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.Security.Dsms\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Security.Dsms\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.Security.Dsms.Edp\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Security.Dsms.Edp\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.Security.Edp\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Security.Edp\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.Security.LinuxAttestation\"\ @@ -1715,6 +1843,12 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Security.Test\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.Security.TestWindowsAttestation\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Security.TestWindowsAttestation\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.Security.WindowsAttestation\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Security.WindowsAttestation\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.Security.WinTestAttestation\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Security.WinTestAttestation\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.ServiceFabric.MC\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.ServiceFabric.MC\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.ServiceFabric.MC.Test\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.ServiceFabric.MC.Test\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.SiteRecovery.Stage\"\ @@ -1727,6 +1861,12 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Test.Identity\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.WindowsFabric.Test\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.WindowsFabric.Test\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.WorkloadInsights.Linux.ReleasePipeTest\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.WorkloadInsights.Linux.ReleasePipeTest\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.WorkloadInsights.Linux.ReleasePipeTest.INT\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.WorkloadInsights.Linux.ReleasePipeTest.INT\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.WorkloadInsights.Linux.ReleasePipeTest.TEST\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.WorkloadInsights.Linux.ReleasePipeTest.TEST\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.WorkloadInsights.Linux.Test1\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.WorkloadInsights.Linux.Test1\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.WorkloadInsights.Linux.Test2\"\ @@ -1735,8 +1875,32 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.WorkloadInsights.Linux.Test3\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.WorkloadInsights.Linux.Test4\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.WorkloadInsights.Linux.Test4\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.WorkloadInsights.Linux.Test5\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.WorkloadInsights.Linux.Test5\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.WorkloadInsights.Linux.Test5.INT\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.WorkloadInsights.Linux.Test5.INT\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.WorkloadInsights.Linux.Test5.TEST\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.WorkloadInsights.Linux.Test5.TEST\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.WorkloadInsights.Linux.VincentTest\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.WorkloadInsights.Linux.VincentTest\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.WorkloadInsights.Linux.VincentTest2\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.WorkloadInsights.Linux.VincentTest2\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.WorkloadInsights.Linux.VincentTest3\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.WorkloadInsights.Linux.VincentTest3\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.WorkloadInsights.Linux.VincentTest4\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.WorkloadInsights.Linux.VincentTest4\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.WorkloadInsights.Test\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.WorkloadInsights.Test\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.WorkloadInsights.TestTest\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.WorkloadInsights.TestTest\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.WorkloadInsights.TestTest.INT\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.WorkloadInsights.TestTest.INT\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.WorkloadInsights.TestTest.TEST\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.WorkloadInsights.TestTest.TEST\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.WorkloadInsights.Windows.ReleasePipeTest.INT\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.WorkloadInsights.Windows.ReleasePipeTest.INT\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.WorkloadInsights.Windows.ReleasePipeTest.TEST\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.WorkloadInsights.Windows.ReleasePipeTest.TEST\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.AzureCAT.AzureEnhancedMonitoring\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.AzureCAT.AzureEnhancedMonitoring\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.AzureCAT.AzureEnhancedMonitoringTest\"\ @@ -1767,6 +1931,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.CloudBackup.Workload.Extension.Edp\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Compute\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Compute\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Compute.Test\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Compute.Test\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.CPlat.Core\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.CPlat.Core\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.CPlat.Core.Edp\"\ @@ -1783,6 +1949,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.GuestConfig.Test\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.GuestConfiguration\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.GuestConfiguration\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.GuestConfiguration.Edp\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.GuestConfiguration.Edp\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.GuestConfiguration.Test\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.GuestConfiguration.Test\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.HpcCompute\"\ @@ -1797,6 +1965,10 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.ManagedIdentity\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.ManagedServices\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.ManagedServices\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.ManagedServices.Edp\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.ManagedServices.Edp\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.MonitoringAgent.Extension\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.MonitoringAgent.Extension\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.OSTCExtensions\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.OSTCExtensions\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.OSTCExtensions.Edp\"\ @@ -1811,12 +1983,16 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Powershell.Test\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Powershell.Test01\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Powershell.Test01\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.SecurityManagement.Kevlar\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.SecurityManagement.Kevlar\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.SoftwareUpdateManagement.Test\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.SoftwareUpdateManagement.Test\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.SqlServer.Managability.IaaS.Test\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.SqlServer.Managability.IaaS.Test\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.SqlServer.Management\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.SqlServer.Management\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.SqlServer.Management.Test\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.SqlServer.Management.Test\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.SystemCenter\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.SystemCenter\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.TestSqlServer.Edp\"\ @@ -1865,6 +2041,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftHybridCloudStorage\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"MicrosoftOSTC\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftOSTC\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"MicrosoftPowerBI\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftPowerBI\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"MicrosoftRServer\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftRServer\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"MicrosoftSharePoint\"\ @@ -1939,6 +2117,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/nebbiolo-technologies-inc\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"nec-technologies\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/nec-technologies\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"nefelinetworks1591201080882\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/nefelinetworks1591201080882\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"neo4j\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/neo4j\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"neowaybusinesssolutions-4956350\"\ @@ -1973,22 +2153,30 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/netx\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"neusoft-neteye\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/neusoft-neteye\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"NewRelic.Infrastructure.Extensions\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/NewRelic.Infrastructure.Extensions\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"nextronic-5290868\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/nextronic-5290868\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"nginxinc\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/nginxinc\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"nice-it-management-solutions\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/nice-it-management-solutions\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"nicepeopleatwork\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/nicepeopleatwork\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"niolabs-5229713\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/niolabs-5229713\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"nodejsapi\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/nodejsapi\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"nokiaofamericacorporation1591716055441\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/nokiaofamericacorporation1591716055441\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"norcominformationtechnologygmbhcokgaa\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/norcominformationtechnologygmbhcokgaa\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"norsync\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/norsync\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"northbridge-secure\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/northbridge-secure\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"nozominetworks1582208017986\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/nozominetworks1582208017986\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"nri\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/nri\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"ntt-data-intellilink-corporation\"\ @@ -2075,6 +2263,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/pacteratechnologiesinc\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"paloaltonetworks\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/paloaltonetworks\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"panopta\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/panopta\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"panorama-necto\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/panorama-necto\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"panzura-file-system\"\ @@ -2095,6 +2285,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/penta-security-systems-inc\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"percona\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/percona\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"piolinkinc1582849368309\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/piolinkinc1582849368309\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"pivotal\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/pivotal\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"plesk\"\ @@ -2107,6 +2299,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/portsysinc\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"postgres-pro\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/postgres-pro\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"powerbireach\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/powerbireach\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"prestashop\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/prestashop\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"prestige_informatique-1090178\"\ @@ -2123,6 +2317,10 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/process-one\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"processgold\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/processgold\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"procomputers\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/procomputers\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"procomputerssrl1594239153814\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/procomputerssrl1594239153814\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"profecia\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/profecia\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Profiler.AgentOrchestrationRefactor.Test\"\ @@ -2131,6 +2329,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Profiler.Master.Test\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"profisee\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/profisee\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"progresssoftwarecorporation\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/progresssoftwarecorporation\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"protiviti\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/protiviti\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"ptc\"\ @@ -2209,10 +2409,14 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/res\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"resco\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/resco\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"resemblesystems1582780358300\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/resemblesystems1582780358300\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"responder-corp\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/responder-corp\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"revolution-analytics\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/revolution-analytics\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"rhcsolutions1586957910818\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/rhcsolutions1586957910818\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"ribboncommunications\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/ribboncommunications\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"RightScaleLinux\"\ @@ -2267,6 +2471,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/saltstack\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"samsungsds-cello\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/samsungsds-cello\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"samsungsds_sdbe\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/samsungsds_sdbe\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"sap\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/sap\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"scaidata\"\ @@ -2283,6 +2489,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/sci\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"scientiamobile\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/scientiamobile\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"seaqserviciossas1579029207572\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/seaqserviciossas1579029207572\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"secureworks\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/secureworks\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"securosis\"\ @@ -2317,6 +2525,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/silver-peak-systems\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"simmachinesinc\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/simmachinesinc\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"simontelephonics\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/simontelephonics\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"simplifierag\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/simplifierag\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"simpligov\"\ @@ -2381,6 +2591,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/sphere3d\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"splunk\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/splunk\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"sproutenetworks1593456311717\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/sproutenetworks1593456311717\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"sqlstream\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/sqlstream\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"squaredup\"\ @@ -2409,6 +2621,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/stonebondtechnologies\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"stonefly\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/stonefly\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"storage_made_easy\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/storage_made_easy\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"stormshield\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/stormshield\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"storreduce\"\ @@ -2419,8 +2633,12 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/streamsets\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"striim\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/striim\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"strongboxitllc1594816423884\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/strongboxitllc1594816423884\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"su\",\r\ \n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/su\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"subscription.test.krsh\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/subscription.test.krsh\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"sumologic\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/sumologic\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"sunatogmbh\"\ @@ -2429,6 +2647,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/SUSE\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"swoopanalytics\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/swoopanalytics\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"sycompatechnologycompanyinc1588192103892\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/sycompatechnologycompanyinc1588192103892\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Symantec\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Symantec\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Symantec.CloudWorkloadProtection\"\ @@ -2443,6 +2663,10 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Symantec.staging\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Symantec.test\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Symantec.test\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Symantec.test.ru2.latest\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Symantec.test.ru2.latest\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Symantec.test.ru2final\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Symantec.test.ru2final\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Symantec.test.ru4mp1\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Symantec.test.ru4mp1\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Symantec.test.ru4mp1.latest\"\ @@ -2535,10 +2759,14 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/test_test_pmc2pc1\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"thales-vormetric\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/thales-vormetric\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"thedatavaluefactoryltd1589348815922\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/thedatavaluefactoryltd1589348815922\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"thefreebsdfoundation\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/thefreebsdfoundation\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"things-board\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/things-board\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"thingscareinc\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/thingscareinc\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"thinprintgmbh\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/thinprintgmbh\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"thorntechnologiesllc\"\ @@ -2625,6 +2853,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/usp\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"valtix\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/valtix\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"varmournetworks\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/varmournetworks\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"varnish\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/varnish\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"vatacommunicationsinc1581644208717\"\ @@ -2667,6 +2897,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/vizixiotplatformretail001\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"vmturbo\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/vmturbo\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"vmware-inc\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/vmware-inc\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"vnomicinc\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/vnomicinc\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"voiceelements\"\ @@ -2713,6 +2945,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/wherescapesoftware\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"winmagic_securedoc_cloudvm\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/winmagic_securedoc_cloudvm\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"witfooinc1590167223060\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/witfooinc1590167223060\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"wmspanel\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/wmspanel\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"workshare-technology\"\ @@ -2729,6 +2963,8 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/xendata-inc\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"xfinityinc\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/xfinityinc\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"xilinx\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/xilinx\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"xoriantsolutionspvtltd\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/xoriantsolutionspvtltd\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"xtremedata\"\ @@ -2757,20 +2993,24 @@ interactions: ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/zettalane_systems-5254599\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"zevenet\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/zevenet\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"zilliz\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/zilliz\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"zoomdata\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/zoomdata\"\ \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"zscaler\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/zscaler\"\ + \r\n },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"zultysinc1596831546163\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/zultysinc1596831546163\"\ \r\n }\r\n]" headers: cache-control: - no-cache content-length: - - '287232' + - '314609' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:46:56 GMT + - Wed, 16 Sep 2020 06:44:15 GMT expires: - '-1' pragma: @@ -2799,9 +3039,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/publishers/MicrosoftWindowsServer/artifacttypes/vmimage/offers/WindowsServer/skus?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/publishers/MicrosoftWindowsServer/artifacttypes/vmimage/offers/WindowsServer/skus?api-version=2020-06-01 response: body: string: "[\r\n {\r\n \"properties\": {\r\n \"automaticOSUpgradeProperties\"\ @@ -3040,16 +3280,24 @@ interactions: : {\r\n \"automaticOSUpgradeSupported\": false\r\n }\r\n },\r\ \n \"location\": \"eastus\",\r\n \"name\": \"datacenter-core-1909-with-containers-smalldisk-g2\"\ ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/datacenter-core-1909-with-containers-smalldisk-g2\"\ + \r\n },\r\n {\r\n \"properties\": {\r\n \"automaticOSUpgradeProperties\"\ + : {\r\n \"automaticOSUpgradeSupported\": false\r\n }\r\n },\r\ + \n \"location\": \"eastus\",\r\n \"name\": \"datacenter-core-2004-with-containers-smalldisk\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/datacenter-core-2004-with-containers-smalldisk\"\ + \r\n },\r\n {\r\n \"properties\": {\r\n \"automaticOSUpgradeProperties\"\ + : {\r\n \"automaticOSUpgradeSupported\": false\r\n }\r\n },\r\ + \n \"location\": \"eastus\",\r\n \"name\": \"datacenter-core-2004-with-containers-smalldisk-g2\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/datacenter-core-2004-with-containers-smalldisk-g2\"\ \r\n }\r\n]" headers: cache-control: - no-cache content-length: - - '25589' + - '26525' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 15:46:57 GMT + - Wed, 16 Sep 2020 06:44:17 GMT expires: - '-1' pragma: diff --git a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vmss.test_compute.yaml b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vmss.test_compute.yaml index beff4f83d994..9a5dba0e8a09 100644 --- a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vmss.test_compute.yaml +++ b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vmss.test_compute.yaml @@ -12,21 +12,18 @@ interactions: Content-Length: - '92' Content-Type: - - application/json; charset=utf-8 + - application/json User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex80f0ea3?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex80f0ea3?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"networknamex80f0ea3\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex80f0ea3\"\ - ,\r\n \"etag\": \"W/\\\"02e67346-1db6-450f-831d-bfe1b40556f1\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"88cb5336-666f-4ce3-a321-aba94931abb0\\\"\",\r\n \ \ \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \ - \ \"resourceGuid\": \"48c0e179-1c39-41c4-8db0-8207ea120f95\",\r\n \"\ + \ \"resourceGuid\": \"421cee4a-b1e4-4459-972f-75b6b4a26ead\",\r\n \"\ addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\ \r\n ]\r\n },\r\n \"subnets\": [],\r\n \"virtualNetworkPeerings\"\ : [],\r\n \"enableDdosProtection\": false,\r\n \"enableVmProtection\"\ @@ -35,15 +32,15 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/fa51cef0-bfb8-40b5-aeb1-468969cf21d4?api-version=2020-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/24bc308e-4c21-4fda-9c21-859324645d3b?api-version=2020-06-01 cache-control: - no-cache content-length: - - '692' + - '725' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:32:02 GMT + - Thu, 17 Sep 2020 02:23:55 GMT expires: - '-1' pragma: @@ -56,9 +53,9 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 6df04418-a7e6-47e1-b42b-2a443bfe221a + - 104afc07-3141-4e46-905b-175116f569e9 x-ms-ratelimit-remaining-subscription-writes: - - '1196' + - '1199' status: code: 201 message: Created @@ -66,16 +63,15 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/fa51cef0-bfb8-40b5-aeb1-468969cf21d4?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/24bc308e-4c21-4fda-9c21-859324645d3b?api-version=2020-06-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -87,7 +83,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:32:08 GMT + - Thu, 17 Sep 2020 02:23:59 GMT expires: - '-1' pragma: @@ -104,7 +100,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 0cd68c64-9d0c-48ad-b37d-789832d6a6e6 + - 0e0b5e17-4d9a-42a3-9666-3af911785b4b status: code: 200 message: OK @@ -112,23 +108,22 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex80f0ea3?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex80f0ea3?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"networknamex80f0ea3\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex80f0ea3\"\ - ,\r\n \"etag\": \"W/\\\"a3f898e4-476b-4931-a888-46e36564c054\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"5497db44-7ecd-4b4b-9a9b-e05e928e27bc\\\"\",\r\n \ \ \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n\ - \ \"resourceGuid\": \"48c0e179-1c39-41c4-8db0-8207ea120f95\",\r\n \"\ + \ \"resourceGuid\": \"421cee4a-b1e4-4459-972f-75b6b4a26ead\",\r\n \"\ addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\ \r\n ]\r\n },\r\n \"subnets\": [],\r\n \"virtualNetworkPeerings\"\ : [],\r\n \"enableDdosProtection\": false,\r\n \"enableVmProtection\"\ @@ -137,13 +132,13 @@ interactions: cache-control: - no-cache content-length: - - '693' + - '726' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:32:08 GMT + - Thu, 17 Sep 2020 02:24:00 GMT etag: - - W/"a3f898e4-476b-4931-a888-46e36564c054" + - W/"5497db44-7ecd-4b4b-9a9b-e05e928e27bc" expires: - '-1' pragma: @@ -160,7 +155,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 12502054-b2ca-4f11-a4ea-37431e65c667 + - 79cc4567-4e88-42d0-8e16-82f648bfb0e6 status: code: 200 message: OK @@ -176,33 +171,30 @@ interactions: Content-Length: - '48' Content-Type: - - application/json; charset=utf-8 + - application/json User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex80f0ea3/subnets/subnetnamex80f0ea3?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex80f0ea3/subnets/subnetnamex80f0ea3?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"subnetnamex80f0ea3\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex80f0ea3/subnets/subnetnamex80f0ea3\"\ - ,\r\n \"etag\": \"W/\\\"2125b98b-9042-4720-8b31-0f5e077fd5d0\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"2cc022fc-2149-47cb-b362-ee4b7bf1e345\\\"\",\r\n \ \ \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"\ addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\"\ : \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\ \n },\r\n \"type\": \"Microsoft.Network/virtualNetworks/subnets\"\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/f279bff7-70d3-4038-bf85-f576c2eb82a5?api-version=2020-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/326502cc-1c71-47fe-b070-a3a3281a3182?api-version=2020-06-01 cache-control: - no-cache content-length: - - '588' + - '621' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:32:08 GMT + - Thu, 17 Sep 2020 02:24:00 GMT expires: - '-1' pragma: @@ -215,9 +207,9 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 97ddb155-2b83-408c-962b-78747c84a828 + - 25b88c3c-0c4e-4544-970e-157666a6ebd9 x-ms-ratelimit-remaining-subscription-writes: - - '1195' + - '1198' status: code: 201 message: Created @@ -225,16 +217,15 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/f279bff7-70d3-4038-bf85-f576c2eb82a5?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/326502cc-1c71-47fe-b070-a3a3281a3182?api-version=2020-06-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -246,7 +237,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:32:12 GMT + - Thu, 17 Sep 2020 02:24:04 GMT expires: - '-1' pragma: @@ -263,7 +254,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - af5a80ee-3453-43a9-9706-7078e8b8c1e6 + - a00da990-5305-48ef-961f-9a133b84e81b status: code: 200 message: OK @@ -271,20 +262,19 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex80f0ea3/subnets/subnetnamex80f0ea3?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex80f0ea3/subnets/subnetnamex80f0ea3?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"subnetnamex80f0ea3\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex80f0ea3/subnets/subnetnamex80f0ea3\"\ - ,\r\n \"etag\": \"W/\\\"11a08aaf-03e6-46dd-bb72-0c7757ec8b8b\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"fdb7dbab-63f1-4986-8707-dd6c79ffad7b\\\"\",\r\n \ \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"\ addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\"\ : \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\ @@ -293,13 +283,13 @@ interactions: cache-control: - no-cache content-length: - - '589' + - '622' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:32:12 GMT + - Thu, 17 Sep 2020 02:24:04 GMT etag: - - W/"11a08aaf-03e6-46dd-bb72-0c7757ec8b8b" + - W/"fdb7dbab-63f1-4986-8707-dd6c79ffad7b" expires: - '-1' pragma: @@ -316,22 +306,22 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 80e1126e-30aa-4a3b-91f4-2bf03cd8b3a3 + - 931d628a-25b1-4500-854c-1d73a060d5ca status: code: 200 message: OK - request: - body: 'b''{"location": "eastus", "sku": {"name": "Standard_D1_v2", "tier": "Standard", - "capacity": 2}, "properties": {"upgradePolicy": {"mode": "Manual"}, "virtualMachineProfile": - {"osProfile": {"computerNamePrefix": "testPC", "adminUsername": "testuser", - "adminPassword": "Aa!1()-xyz"}, "storageProfile": {"imageReference": {"publisher": - "Canonical", "offer": "UbuntuServer", "sku": "18.04-LTS", "version": "latest"}, - "osDisk": {"caching": "ReadWrite", "createOption": "FromImage", "diskSizeGB": + body: 'b''b\''{"location": "eastus", "sku": {"name": "Standard_D1_v2", "tier": + "Standard", "capacity": 2}, "properties": {"upgradePolicy": {"mode": "Manual"}, + "virtualMachineProfile": {"osProfile": {"computerNamePrefix": "testPC", "adminUsername": + "testuser", "adminPassword": "Aa!1()-xyz"}, "storageProfile": {"imageReference": + {"publisher": "Canonical", "offer": "UbuntuServer", "sku": "18.04-LTS", "version": + "latest"}, "osDisk": {"caching": "ReadWrite", "createOption": "FromImage", "diskSizeGB": 512, "managedDisk": {"storageAccountType": "Standard_LRS"}}}, "networkProfile": {"networkInterfaceConfigurations": [{"name": "testPC", "properties": {"primary": true, "ipConfigurations": [{"name": "testPC", "properties": {"subnet": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex80f0ea3/subnets/subnetnamex80f0ea3"}}}]}}]}}, - "overprovision": true}}''' + "overprovision": true}}\''''' headers: Accept: - application/json @@ -340,13 +330,13 @@ interactions: Connection: - keep-alive Content-Length: - - '962' + - '995' Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"virtualmachinescaleset80f0ea3\",\r\n \"id\": \"\ @@ -375,21 +365,21 @@ interactions: :\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex80f0ea3/subnets/subnetnamex80f0ea3\"\ },\"privateIPAddressVersion\":\"IPv4\"}}]}}]}\r\n },\r\n \"provisioningState\"\ : \"Creating\",\r\n \"overprovision\": true,\r\n \"doNotRunExtensionsOnOverprovisionedVMs\"\ - : false,\r\n \"uniqueId\": \"d9c74afe-68c7-4cd0-96b9-7078d54daf36\"\r\n\ + : false,\r\n \"uniqueId\": \"06e379e6-983d-4f98-8634-fbaef3793187\"\r\n\ \ }\r\n}" headers: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/46c451fd-cae4-4b08-ac22-5246150ac7be?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/9e9aa61b-6607-47c8-98f9-59d08f86a2d6?api-version=2020-06-01 cache-control: - no-cache content-length: - - '2064' + - '2130' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:32:19 GMT + - Thu, 17 Sep 2020 02:24:15 GMT expires: - '-1' pragma: @@ -402,7 +392,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/CreateVMScaleSet3Min;144,Microsoft.Compute/CreateVMScaleSet30Min;723,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;2903,Microsoft.Compute/VmssQueuedVMOperations;4796 + - Microsoft.Compute/CreateVMScaleSet3Min;59,Microsoft.Compute/CreateVMScaleSet30Min;299,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;1196,Microsoft.Compute/VmssQueuedVMOperations;4796 x-ms-ratelimit-remaining-subscription-writes: - '1199' x-ms-request-charge: @@ -420,23 +410,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/46c451fd-cae4-4b08-ac22-5246150ac7be?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/9e9aa61b-6607-47c8-98f9-59d08f86a2d6?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:32:19.2197672+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"46c451fd-cae4-4b08-ac22-5246150ac7be\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:24:14.18403+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"9e9aa61b-6607-47c8-98f9-59d08f86a2d6\"\ \r\n}" headers: cache-control: - no-cache content-length: - - '134' + - '132' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:32:30 GMT + - Thu, 17 Sep 2020 02:24:25 GMT expires: - '-1' pragma: @@ -453,7 +443,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14988,Microsoft.Compute/GetOperation30Min;29913 + - Microsoft.Compute/GetOperation3Min;14999,Microsoft.Compute/GetOperation30Min;29995 status: code: 200 message: OK @@ -467,23 +457,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/46c451fd-cae4-4b08-ac22-5246150ac7be?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/9e9aa61b-6607-47c8-98f9-59d08f86a2d6?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:32:19.2197672+00:00\",\r\n \"\ - endTime\": \"2020-05-18T20:33:26.5815272+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"46c451fd-cae4-4b08-ac22-5246150ac7be\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-17T02:24:14.18403+00:00\",\r\n \"\ + endTime\": \"2020-09-17T02:25:18.075003+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"9e9aa61b-6607-47c8-98f9-59d08f86a2d6\"\r\n}" headers: cache-control: - no-cache content-length: - - '184' + - '181' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:33:31 GMT + - Thu, 17 Sep 2020 02:25:26 GMT expires: - '-1' pragma: @@ -500,7 +490,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14987,Microsoft.Compute/GetOperation30Min;29908 + - Microsoft.Compute/GetOperation3Min;14997,Microsoft.Compute/GetOperation30Min;29993 status: code: 200 message: OK @@ -514,9 +504,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"virtualmachinescaleset80f0ea3\",\r\n \"id\": \"\ @@ -545,17 +535,17 @@ interactions: :\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex80f0ea3/subnets/subnetnamex80f0ea3\"\ },\"privateIPAddressVersion\":\"IPv4\"}}]}}]}\r\n },\r\n \"provisioningState\"\ : \"Succeeded\",\r\n \"overprovision\": true,\r\n \"doNotRunExtensionsOnOverprovisionedVMs\"\ - : false,\r\n \"uniqueId\": \"d9c74afe-68c7-4cd0-96b9-7078d54daf36\"\r\n\ + : false,\r\n \"uniqueId\": \"06e379e6-983d-4f98-8634-fbaef3793187\"\r\n\ \ }\r\n}" headers: cache-control: - no-cache content-length: - - '2065' + - '2131' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:33:31 GMT + - Thu, 17 Sep 2020 02:25:27 GMT expires: - '-1' pragma: @@ -572,7 +562,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetVMScaleSet3Min;396,Microsoft.Compute/GetVMScaleSet30Min;2563 + - Microsoft.Compute/GetVMScaleSet3Min;398,Microsoft.Compute/GetVMScaleSet30Min;2598 status: code: 200 message: OK @@ -592,9 +582,9 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3/extensions/vmssextensionx80f0ea3?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3/extensions/vmssextensionx80f0ea3?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"vmssextensionx80f0ea3\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3/extensions/vmssextensionx80f0ea3\"\ @@ -605,15 +595,15 @@ interactions: : \"1.4\"\r\n }\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/94a474d4-8ca6-44f6-9041-746d32090bc9?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/ce2f27b6-4496-4772-96af-4ae1a9b17984?api-version=2020-06-01 cache-control: - no-cache content-length: - - '573' + - '606' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:33:32 GMT + - Thu, 17 Sep 2020 02:25:27 GMT expires: - '-1' pragma: @@ -626,7 +616,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/VMScaleSetActions3Min;238,Microsoft.Compute/VMScaleSetActions30Min;1195,Microsoft.Compute/VmssQueuedVMOperations;4800 + - Microsoft.Compute/VMScaleSetActions3Min;239,Microsoft.Compute/VMScaleSetActions30Min;1199,Microsoft.Compute/VmssQueuedVMOperations;4800 x-ms-ratelimit-remaining-subscription-writes: - '1198' x-ms-request-charge: @@ -644,23 +634,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/94a474d4-8ca6-44f6-9041-746d32090bc9?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/ce2f27b6-4496-4772-96af-4ae1a9b17984?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:33:33.032359+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"94a474d4-8ca6-44f6-9041-746d32090bc9\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:25:28.3250724+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"ce2f27b6-4496-4772-96af-4ae1a9b17984\"\ \r\n}" headers: cache-control: - no-cache content-length: - - '133' + - '134' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:33:42 GMT + - Thu, 17 Sep 2020 02:25:38 GMT expires: - '-1' pragma: @@ -677,7 +667,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29906 + - Microsoft.Compute/GetOperation3Min;14996,Microsoft.Compute/GetOperation30Min;29992 status: code: 200 message: OK @@ -691,23 +681,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/94a474d4-8ca6-44f6-9041-746d32090bc9?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/ce2f27b6-4496-4772-96af-4ae1a9b17984?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:33:33.032359+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"94a474d4-8ca6-44f6-9041-746d32090bc9\"\ - \r\n}" + string: "{\r\n \"startTime\": \"2020-09-17T02:25:28.3250724+00:00\",\r\n \"\ + endTime\": \"2020-09-17T02:25:49.9970922+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"ce2f27b6-4496-4772-96af-4ae1a9b17984\"\r\n}" headers: cache-control: - no-cache content-length: - - '133' + - '184' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:34:20 GMT + - Thu, 17 Sep 2020 02:26:15 GMT expires: - '-1' pragma: @@ -724,7 +714,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29902 + - Microsoft.Compute/GetOperation3Min;14995,Microsoft.Compute/GetOperation30Min;29991 status: code: 200 message: OK @@ -738,23 +728,26 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/94a474d4-8ca6-44f6-9041-746d32090bc9?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3/extensions/vmssextensionx80f0ea3?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:33:33.032359+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"94a474d4-8ca6-44f6-9041-746d32090bc9\"\ - \r\n}" + string: "{\r\n \"name\": \"vmssextensionx80f0ea3\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3/extensions/vmssextensionx80f0ea3\"\ + ,\r\n \"type\": \"Microsoft.Compute/virtualMachineScaleSets/extensions\"\ + ,\r\n \"properties\": {\r\n \"provisioningState\": \"Creating\",\r\n \ + \ \"autoUpgradeMinorVersion\": true,\r\n \"publisher\": \"Microsoft.Azure.NetworkWatcher\"\ + ,\r\n \"type\": \"NetworkWatcherAgentWindows\",\r\n \"typeHandlerVersion\"\ + : \"1.4\"\r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '133' + - '605' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:34:50 GMT + - Thu, 17 Sep 2020 02:26:16 GMT expires: - '-1' pragma: @@ -771,7 +764,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29900 + - Microsoft.Compute/LowCostGet3Min;3999,Microsoft.Compute/LowCostGet30Min;31999 status: code: 200 message: OK @@ -779,29 +772,60 @@ interactions: body: null headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/94a474d4-8ca6-44f6-9041-746d32090bc9?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:33:33.032359+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"94a474d4-8ca6-44f6-9041-746d32090bc9\"\ - \r\n}" + string: "{\r\n \"name\": \"virtualmachinescaleset80f0ea3\",\r\n \"id\": \"\ + /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3\"\ + ,\r\n \"type\": \"Microsoft.Compute/virtualMachineScaleSets\",\r\n \"location\"\ + : \"eastus\",\r\n \"sku\": {\r\n \"name\": \"Standard_D1_v2\",\r\n \ + \ \"tier\": \"Standard\",\r\n \"capacity\": 2\r\n },\r\n \"properties\"\ + : {\r\n \"singlePlacementGroup\": true,\r\n \"upgradePolicy\": {\r\n\ + \ \"mode\": \"Manual\"\r\n },\r\n \"virtualMachineProfile\": {\r\ + \n \"osProfile\": {\r\n \"computerNamePrefix\": \"testPC\",\r\n\ + \ \"adminUsername\": \"testuser\",\r\n \"linuxConfiguration\"\ + : {\r\n \"disablePasswordAuthentication\": false,\r\n \"\ + provisionVMAgent\": true\r\n },\r\n \"secrets\": [],\r\n \ + \ \"allowExtensionOperations\": true,\r\n \"requireGuestProvisionSignal\"\ + : true\r\n },\r\n \"storageProfile\": {\r\n \"osDisk\": {\r\ + \n \"createOption\": \"FromImage\",\r\n \"caching\": \"\ + ReadWrite\",\r\n \"managedDisk\": {\r\n \"storageAccountType\"\ + : \"Standard_LRS\"\r\n },\r\n \"diskSizeGB\": 512\r\n \ + \ },\r\n \"imageReference\": {\r\n \"publisher\": \"\ + Canonical\",\r\n \"offer\": \"UbuntuServer\",\r\n \"sku\"\ + : \"18.04-LTS\",\r\n \"version\": \"latest\"\r\n }\r\n \ + \ },\r\n \"networkProfile\": {\"networkInterfaceConfigurations\":[{\"\ + name\":\"testPC\",\"properties\":{\"primary\":true,\"enableAcceleratedNetworking\"\ + :false,\"dnsSettings\":{\"dnsServers\":[]},\"enableIPForwarding\":false,\"\ + ipConfigurations\":[{\"name\":\"testPC\",\"properties\":{\"subnet\":{\"id\"\ + :\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex80f0ea3/subnets/subnetnamex80f0ea3\"\ + },\"privateIPAddressVersion\":\"IPv4\"}}]}}]},\r\n \"extensionProfile\"\ + : {\r\n \"extensions\": [\r\n {\r\n \"name\": \"\ + vmssextensionx80f0ea3\",\r\n \"properties\": {\r\n \ + \ \"autoUpgradeMinorVersion\": true,\r\n \"publisher\": \"Microsoft.Azure.NetworkWatcher\"\ + ,\r\n \"type\": \"NetworkWatcherAgentWindows\",\r\n \ + \ \"typeHandlerVersion\": \"1.4\"\r\n }\r\n }\r\n\ + \ ]\r\n }\r\n },\r\n \"provisioningState\": \"Succeeded\"\ + ,\r\n \"overprovision\": true,\r\n \"doNotRunExtensionsOnOverprovisionedVMs\"\ + : false,\r\n \"uniqueId\": \"06e379e6-983d-4f98-8634-fbaef3793187\"\r\n\ + \ }\r\n}" headers: cache-control: - no-cache content-length: - - '133' + - '2528' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:35:20 GMT + - Thu, 17 Sep 2020 02:26:16 GMT expires: - '-1' pragma: @@ -818,7 +842,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29915 + - Microsoft.Compute/GetVMScaleSet3Min;395,Microsoft.Compute/GetVMScaleSet30Min;2595 status: code: 200 message: OK @@ -826,29 +850,32 @@ interactions: body: null headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/94a474d4-8ca6-44f6-9041-746d32090bc9?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3/extensions/vmssextensionx80f0ea3?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:33:33.032359+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"94a474d4-8ca6-44f6-9041-746d32090bc9\"\ - \r\n}" + string: "{\r\n \"name\": \"vmssextensionx80f0ea3\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3/extensions/vmssextensionx80f0ea3\"\ + ,\r\n \"type\": \"Microsoft.Compute/virtualMachineScaleSets/extensions\"\ + ,\r\n \"properties\": {\r\n \"provisioningState\": \"Creating\",\r\n \ + \ \"autoUpgradeMinorVersion\": true,\r\n \"publisher\": \"Microsoft.Azure.NetworkWatcher\"\ + ,\r\n \"type\": \"NetworkWatcherAgentWindows\",\r\n \"typeHandlerVersion\"\ + : \"1.4\"\r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '133' + - '605' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:35:51 GMT + - Thu, 17 Sep 2020 02:26:16 GMT expires: - '-1' pragma: @@ -865,7 +892,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29911 + - Microsoft.Compute/LowCostGet3Min;3998,Microsoft.Compute/LowCostGet30Min;31998 status: code: 200 message: OK @@ -873,29 +900,36 @@ interactions: body: null headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/94a474d4-8ca6-44f6-9041-746d32090bc9?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3/instanceView?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:33:33.032359+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"94a474d4-8ca6-44f6-9041-746d32090bc9\"\ - \r\n}" + string: "{\r\n \"virtualMachine\": {\r\n \"statusesSummary\": [\r\n \ + \ {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n \"count\"\ + : 2\r\n }\r\n ]\r\n },\r\n \"extensions\": [\r\n {\r\n \"\ + name\": \"vmssextensionx80f0ea3\",\r\n \"statusesSummary\": [\r\n \ + \ {\r\n \"code\": \"ProvisioningState/creating\",\r\n \ + \ \"count\": 2\r\n }\r\n ]\r\n }\r\n ],\r\n \"statuses\"\ + : [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n \ + \ \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning succeeded\"\ + ,\r\n \"time\": \"2020-09-17T02:25:49.9658406+00:00\"\r\n }\r\n ]\r\ + \n}" headers: cache-control: - no-cache content-length: - - '133' + - '568' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:36:21 GMT + - Thu, 17 Sep 2020 02:26:17 GMT expires: - '-1' pragma: @@ -912,7 +946,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14980,Microsoft.Compute/GetOperation30Min;29908 + - Microsoft.Compute/HighCostGetVMScaleSet3Min;178,Microsoft.Compute/HighCostGetVMScaleSet30Min;898 status: code: 200 message: OK @@ -925,26 +959,28 @@ interactions: - gzip, deflate Connection: - keep-alive + Content-Length: + - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/94a474d4-8ca6-44f6-9041-746d32090bc9?api-version=2019-12-01 + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3/extensionRollingUpgrade?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:33:33.032359+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"94a474d4-8ca6-44f6-9041-746d32090bc9\"\ - \r\n}" + string: '' headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 cache-control: - no-cache content-length: - - '133' - content-type: - - application/json; charset=utf-8 + - '0' date: - - Mon, 18 May 2020 20:36:51 GMT + - Thu, 17 Sep 2020 02:26:17 GMT expires: - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -952,17 +988,17 @@ interactions: - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29905 + - Microsoft.Compute/VMScaleSetActions3Min;238,Microsoft.Compute/VMScaleSetActions30Min;1198,Microsoft.Compute/VmssQueuedVMOperations;4800 + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-ms-request-charge: + - '0' status: - code: 200 - message: OK + code: 202 + message: Accepted - request: body: null headers: @@ -973,23 +1009,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/94a474d4-8ca6-44f6-9041-746d32090bc9?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:33:33.032359+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"94a474d4-8ca6-44f6-9041-746d32090bc9\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: - no-cache content-length: - - '133' + - '134' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:37:21 GMT + - Thu, 17 Sep 2020 02:26:47 GMT expires: - '-1' pragma: @@ -1006,7 +1042,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29902 + - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29989 status: code: 200 message: OK @@ -1020,23 +1056,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/94a474d4-8ca6-44f6-9041-746d32090bc9?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:33:33.032359+00:00\",\r\n \"\ - endTime\": \"2020-05-18T20:37:37.861619+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"94a474d4-8ca6-44f6-9041-746d32090bc9\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ + \r\n}" headers: cache-control: - no-cache content-length: - - '182' + - '134' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:37:51 GMT + - Thu, 17 Sep 2020 02:27:17 GMT expires: - '-1' pragma: @@ -1053,7 +1089,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29901 + - Microsoft.Compute/GetOperation3Min;14991,Microsoft.Compute/GetOperation30Min;29986 status: code: 200 message: OK @@ -1067,26 +1103,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3/extensions/vmssextensionx80f0ea3?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"name\": \"vmssextensionx80f0ea3\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3/extensions/vmssextensionx80f0ea3\"\ - ,\r\n \"type\": \"Microsoft.Compute/virtualMachineScaleSets/extensions\"\ - ,\r\n \"properties\": {\r\n \"provisioningState\": \"Creating\",\r\n \ - \ \"autoUpgradeMinorVersion\": true,\r\n \"publisher\": \"Microsoft.Azure.NetworkWatcher\"\ - ,\r\n \"type\": \"NetworkWatcherAgentWindows\",\r\n \"typeHandlerVersion\"\ - : \"1.4\"\r\n }\r\n}" + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ + \r\n}" headers: cache-control: - no-cache content-length: - - '572' + - '134' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:37:51 GMT + - Thu, 17 Sep 2020 02:27:48 GMT expires: - '-1' pragma: @@ -1103,7 +1136,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;3996,Microsoft.Compute/LowCostGet30Min;31974 + - Microsoft.Compute/GetOperation3Min;14988,Microsoft.Compute/GetOperation30Min;29983 status: code: 200 message: OK @@ -1111,60 +1144,29 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"name\": \"virtualmachinescaleset80f0ea3\",\r\n \"id\": \"\ - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3\"\ - ,\r\n \"type\": \"Microsoft.Compute/virtualMachineScaleSets\",\r\n \"location\"\ - : \"eastus\",\r\n \"sku\": {\r\n \"name\": \"Standard_D1_v2\",\r\n \ - \ \"tier\": \"Standard\",\r\n \"capacity\": 2\r\n },\r\n \"properties\"\ - : {\r\n \"singlePlacementGroup\": true,\r\n \"upgradePolicy\": {\r\n\ - \ \"mode\": \"Manual\"\r\n },\r\n \"virtualMachineProfile\": {\r\ - \n \"osProfile\": {\r\n \"computerNamePrefix\": \"testPC\",\r\n\ - \ \"adminUsername\": \"testuser\",\r\n \"linuxConfiguration\"\ - : {\r\n \"disablePasswordAuthentication\": false,\r\n \"\ - provisionVMAgent\": true\r\n },\r\n \"secrets\": [],\r\n \ - \ \"allowExtensionOperations\": true,\r\n \"requireGuestProvisionSignal\"\ - : true\r\n },\r\n \"storageProfile\": {\r\n \"osDisk\": {\r\ - \n \"createOption\": \"FromImage\",\r\n \"caching\": \"\ - ReadWrite\",\r\n \"managedDisk\": {\r\n \"storageAccountType\"\ - : \"Standard_LRS\"\r\n },\r\n \"diskSizeGB\": 512\r\n \ - \ },\r\n \"imageReference\": {\r\n \"publisher\": \"\ - Canonical\",\r\n \"offer\": \"UbuntuServer\",\r\n \"sku\"\ - : \"18.04-LTS\",\r\n \"version\": \"latest\"\r\n }\r\n \ - \ },\r\n \"networkProfile\": {\"networkInterfaceConfigurations\":[{\"\ - name\":\"testPC\",\"properties\":{\"primary\":true,\"enableAcceleratedNetworking\"\ - :false,\"dnsSettings\":{\"dnsServers\":[]},\"enableIPForwarding\":false,\"\ - ipConfigurations\":[{\"name\":\"testPC\",\"properties\":{\"subnet\":{\"id\"\ - :\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex80f0ea3/subnets/subnetnamex80f0ea3\"\ - },\"privateIPAddressVersion\":\"IPv4\"}}]}}]},\r\n \"extensionProfile\"\ - : {\r\n \"extensions\": [\r\n {\r\n \"name\": \"\ - vmssextensionx80f0ea3\",\r\n \"properties\": {\r\n \ - \ \"autoUpgradeMinorVersion\": true,\r\n \"publisher\": \"Microsoft.Azure.NetworkWatcher\"\ - ,\r\n \"type\": \"NetworkWatcherAgentWindows\",\r\n \ - \ \"typeHandlerVersion\": \"1.4\"\r\n }\r\n }\r\n\ - \ ]\r\n }\r\n },\r\n \"provisioningState\": \"Succeeded\"\ - ,\r\n \"overprovision\": true,\r\n \"doNotRunExtensionsOnOverprovisionedVMs\"\ - : false,\r\n \"uniqueId\": \"d9c74afe-68c7-4cd0-96b9-7078d54daf36\"\r\n\ - \ }\r\n}" + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ + \r\n}" headers: cache-control: - no-cache content-length: - - '2462' + - '134' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:37:51 GMT + - Thu, 17 Sep 2020 02:28:20 GMT expires: - '-1' pragma: @@ -1181,7 +1183,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetVMScaleSet3Min;394,Microsoft.Compute/GetVMScaleSet30Min;2560 + - Microsoft.Compute/GetOperation3Min;14987,Microsoft.Compute/GetOperation30Min;29980 status: code: 200 message: OK @@ -1189,32 +1191,29 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3/extensions/vmssextensionx80f0ea3?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"name\": \"vmssextensionx80f0ea3\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3/extensions/vmssextensionx80f0ea3\"\ - ,\r\n \"type\": \"Microsoft.Compute/virtualMachineScaleSets/extensions\"\ - ,\r\n \"properties\": {\r\n \"provisioningState\": \"Creating\",\r\n \ - \ \"autoUpgradeMinorVersion\": true,\r\n \"publisher\": \"Microsoft.Azure.NetworkWatcher\"\ - ,\r\n \"type\": \"NetworkWatcherAgentWindows\",\r\n \"typeHandlerVersion\"\ - : \"1.4\"\r\n }\r\n}" + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ + \r\n}" headers: cache-control: - no-cache content-length: - - '572' + - '134' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:37:51 GMT + - Thu, 17 Sep 2020 02:28:50 GMT expires: - '-1' pragma: @@ -1231,7 +1230,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;3995,Microsoft.Compute/LowCostGet30Min;31973 + - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29977 status: code: 200 message: OK @@ -1239,36 +1238,29 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3/instanceView?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"virtualMachine\": {\r\n \"statusesSummary\": [\r\n \ - \ {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n \"count\"\ - : 2\r\n }\r\n ]\r\n },\r\n \"extensions\": [\r\n {\r\n \"\ - name\": \"vmssextensionx80f0ea3\",\r\n \"statusesSummary\": [\r\n \ - \ {\r\n \"code\": \"ProvisioningState/creating\",\r\n \ - \ \"count\": 2\r\n }\r\n ]\r\n }\r\n ],\r\n \"statuses\"\ - : [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n \ - \ \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning succeeded\"\ - ,\r\n \"time\": \"2020-05-18T20:37:37.8459759+00:00\"\r\n }\r\n ]\r\ - \n}" + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ + \r\n}" headers: cache-control: - no-cache content-length: - - '568' + - '134' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:37:52 GMT + - Thu, 17 Sep 2020 02:29:21 GMT expires: - '-1' pragma: @@ -1285,7 +1277,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/HighCostGetVMScaleSet3Min;176,Microsoft.Compute/HighCostGetVMScaleSet30Min;889 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29974 status: code: 200 message: OK @@ -1298,28 +1290,26 @@ interactions: - gzip, deflate Connection: - keep-alive - Content-Length: - - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3/extensionRollingUpgrade?api-version=2019-12-01 + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: '' + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ + \r\n}" headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 cache-control: - no-cache content-length: - - '0' + - '134' + content-type: + - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:37:52 GMT + - Thu, 17 Sep 2020 02:29:51 GMT expires: - '-1' - location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?monitor=true&api-version=2019-12-01 pragma: - no-cache server: @@ -1327,17 +1317,17 @@ interactions: - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/VMScaleSetActions3Min;239,Microsoft.Compute/VMScaleSetActions30Min;1194,Microsoft.Compute/VmssQueuedVMOperations;4800 - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - x-ms-request-charge: - - '0' + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29971 status: - code: 202 - message: Accepted + code: 200 + message: OK - request: body: null headers: @@ -1348,13 +1338,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:37:53.2210656+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -1364,7 +1354,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:38:23 GMT + - Thu, 17 Sep 2020 02:30:21 GMT expires: - '-1' pragma: @@ -1381,7 +1371,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29899 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29968 status: code: 200 message: OK @@ -1395,13 +1385,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:37:53.2210656+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -1411,7 +1401,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:38:53 GMT + - Thu, 17 Sep 2020 02:30:52 GMT expires: - '-1' pragma: @@ -1428,7 +1418,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29896 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29966 status: code: 200 message: OK @@ -1442,13 +1432,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:37:53.2210656+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -1458,7 +1448,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:39:23 GMT + - Thu, 17 Sep 2020 02:31:22 GMT expires: - '-1' pragma: @@ -1475,7 +1465,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29893 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29963 status: code: 200 message: OK @@ -1489,13 +1479,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:37:53.2210656+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -1505,7 +1495,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:39:53 GMT + - Thu, 17 Sep 2020 02:31:52 GMT expires: - '-1' pragma: @@ -1522,7 +1512,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29890 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29960 status: code: 200 message: OK @@ -1536,13 +1526,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:37:53.2210656+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -1552,7 +1542,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:40:24 GMT + - Thu, 17 Sep 2020 02:32:23 GMT expires: - '-1' pragma: @@ -1569,7 +1559,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29897 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29957 status: code: 200 message: OK @@ -1583,13 +1573,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:37:53.2210656+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -1599,7 +1589,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:40:53 GMT + - Thu, 17 Sep 2020 02:32:53 GMT expires: - '-1' pragma: @@ -1616,7 +1606,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29894 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29954 status: code: 200 message: OK @@ -1630,13 +1620,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:37:53.2210656+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -1646,7 +1636,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:41:24 GMT + - Thu, 17 Sep 2020 02:33:24 GMT expires: - '-1' pragma: @@ -1663,7 +1653,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29891 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29951 status: code: 200 message: OK @@ -1677,13 +1667,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:37:53.2210656+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -1693,7 +1683,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:41:54 GMT + - Thu, 17 Sep 2020 02:33:54 GMT expires: - '-1' pragma: @@ -1710,7 +1700,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29888 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29948 status: code: 200 message: OK @@ -1724,13 +1714,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:37:53.2210656+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -1740,7 +1730,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:42:24 GMT + - Thu, 17 Sep 2020 02:34:24 GMT expires: - '-1' pragma: @@ -1757,7 +1747,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14980,Microsoft.Compute/GetOperation30Min;29884 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29945 status: code: 200 message: OK @@ -1771,13 +1761,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:37:53.2210656+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -1787,7 +1777,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:42:54 GMT + - Thu, 17 Sep 2020 02:34:55 GMT expires: - '-1' pragma: @@ -1804,7 +1794,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14980,Microsoft.Compute/GetOperation30Min;29881 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29943 status: code: 200 message: OK @@ -1818,13 +1808,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:37:53.2210656+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -1834,7 +1824,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:43:25 GMT + - Thu, 17 Sep 2020 02:35:25 GMT expires: - '-1' pragma: @@ -1851,7 +1841,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29878 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29940 status: code: 200 message: OK @@ -1865,13 +1855,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:37:53.2210656+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -1881,7 +1871,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:43:55 GMT + - Thu, 17 Sep 2020 02:35:56 GMT expires: - '-1' pragma: @@ -1898,7 +1888,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29876 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29937 status: code: 200 message: OK @@ -1912,13 +1902,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:37:53.2210656+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -1928,7 +1918,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:44:25 GMT + - Thu, 17 Sep 2020 02:36:30 GMT expires: - '-1' pragma: @@ -1945,7 +1935,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29872 + - Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29934 status: code: 200 message: OK @@ -1959,13 +1949,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:37:53.2210656+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -1975,7 +1965,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:44:55 GMT + - Thu, 17 Sep 2020 02:37:00 GMT expires: - '-1' pragma: @@ -1992,7 +1982,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14980,Microsoft.Compute/GetOperation30Min;29868 + - Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29931 status: code: 200 message: OK @@ -2006,13 +1996,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:37:53.2210656+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -2022,7 +2012,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:45:26 GMT + - Thu, 17 Sep 2020 02:37:30 GMT expires: - '-1' pragma: @@ -2039,7 +2029,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29875 + - Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29928 status: code: 200 message: OK @@ -2053,13 +2043,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:37:53.2210656+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -2069,7 +2059,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:45:55 GMT + - Thu, 17 Sep 2020 02:38:01 GMT expires: - '-1' pragma: @@ -2086,7 +2076,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29872 + - Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29925 status: code: 200 message: OK @@ -2100,13 +2090,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:37:53.2210656+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -2116,7 +2106,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:46:26 GMT + - Thu, 17 Sep 2020 02:38:31 GMT expires: - '-1' pragma: @@ -2133,7 +2123,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29869 + - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29922 status: code: 200 message: OK @@ -2147,13 +2137,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:37:53.2210656+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -2163,7 +2153,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:46:56 GMT + - Thu, 17 Sep 2020 02:39:01 GMT expires: - '-1' pragma: @@ -2180,7 +2170,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29867 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29919 status: code: 200 message: OK @@ -2194,13 +2184,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:37:53.2210656+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -2210,7 +2200,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:47:26 GMT + - Thu, 17 Sep 2020 02:39:31 GMT expires: - '-1' pragma: @@ -2227,7 +2217,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29864 + - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29917 status: code: 200 message: OK @@ -2241,13 +2231,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -2257,7 +2247,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:47:56 GMT + - Thu, 17 Sep 2020 02:40:02 GMT expires: - '-1' pragma: @@ -2274,7 +2264,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29861 + - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29918 status: code: 200 message: OK @@ -2288,13 +2278,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -2304,7 +2294,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:48:26 GMT + - Thu, 17 Sep 2020 02:40:33 GMT expires: - '-1' pragma: @@ -2321,7 +2311,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29858 + - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29915 status: code: 200 message: OK @@ -2335,13 +2325,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -2351,7 +2341,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:48:57 GMT + - Thu, 17 Sep 2020 02:41:03 GMT expires: - '-1' pragma: @@ -2368,7 +2358,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29854 + - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29912 status: code: 200 message: OK @@ -2382,13 +2372,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -2398,7 +2388,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:49:27 GMT + - Thu, 17 Sep 2020 02:41:33 GMT expires: - '-1' pragma: @@ -2415,7 +2405,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29850 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29909 status: code: 200 message: OK @@ -2429,13 +2419,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -2445,7 +2435,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:49:57 GMT + - Thu, 17 Sep 2020 02:42:03 GMT expires: - '-1' pragma: @@ -2462,7 +2452,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14980,Microsoft.Compute/GetOperation30Min;29847 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29906 status: code: 200 message: OK @@ -2476,13 +2466,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -2492,7 +2482,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:50:27 GMT + - Thu, 17 Sep 2020 02:42:35 GMT expires: - '-1' pragma: @@ -2509,7 +2499,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14980,Microsoft.Compute/GetOperation30Min;29860 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29903 status: code: 200 message: OK @@ -2523,13 +2513,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -2539,7 +2529,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:50:57 GMT + - Thu, 17 Sep 2020 02:43:05 GMT expires: - '-1' pragma: @@ -2556,7 +2546,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14980,Microsoft.Compute/GetOperation30Min;29857 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29900 status: code: 200 message: OK @@ -2570,13 +2560,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -2586,7 +2576,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:51:27 GMT + - Thu, 17 Sep 2020 02:43:35 GMT expires: - '-1' pragma: @@ -2603,7 +2593,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14980,Microsoft.Compute/GetOperation30Min;29854 + - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29898 status: code: 200 message: OK @@ -2617,13 +2607,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -2633,7 +2623,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:51:58 GMT + - Thu, 17 Sep 2020 02:44:06 GMT expires: - '-1' pragma: @@ -2650,7 +2640,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29851 + - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29895 status: code: 200 message: OK @@ -2664,13 +2654,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -2680,7 +2670,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:52:28 GMT + - Thu, 17 Sep 2020 02:44:38 GMT expires: - '-1' pragma: @@ -2697,7 +2687,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29849 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29892 status: code: 200 message: OK @@ -2711,13 +2701,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -2727,7 +2717,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:52:58 GMT + - Thu, 17 Sep 2020 02:45:08 GMT expires: - '-1' pragma: @@ -2744,7 +2734,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29846 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29889 status: code: 200 message: OK @@ -2758,13 +2748,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -2774,7 +2764,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:53:28 GMT + - Thu, 17 Sep 2020 02:45:38 GMT expires: - '-1' pragma: @@ -2791,7 +2781,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29843 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29886 status: code: 200 message: OK @@ -2805,13 +2795,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -2821,7 +2811,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:53:58 GMT + - Thu, 17 Sep 2020 02:46:09 GMT expires: - '-1' pragma: @@ -2838,7 +2828,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29840 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29883 status: code: 200 message: OK @@ -2852,13 +2842,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -2868,7 +2858,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:54:28 GMT + - Thu, 17 Sep 2020 02:46:40 GMT expires: - '-1' pragma: @@ -2885,7 +2875,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29837 + - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29881 status: code: 200 message: OK @@ -2899,13 +2889,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -2915,7 +2905,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:54:59 GMT + - Thu, 17 Sep 2020 02:47:10 GMT expires: - '-1' pragma: @@ -2932,7 +2922,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29834 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29878 status: code: 200 message: OK @@ -2946,13 +2936,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -2962,7 +2952,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:55:29 GMT + - Thu, 17 Sep 2020 02:47:40 GMT expires: - '-1' pragma: @@ -2979,7 +2969,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29849 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29875 status: code: 200 message: OK @@ -2993,13 +2983,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -3009,7 +2999,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:55:59 GMT + - Thu, 17 Sep 2020 02:48:10 GMT expires: - '-1' pragma: @@ -3026,7 +3016,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29845 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29872 status: code: 200 message: OK @@ -3040,13 +3030,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -3056,7 +3046,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:56:30 GMT + - Thu, 17 Sep 2020 02:48:41 GMT expires: - '-1' pragma: @@ -3073,7 +3063,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29842 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29869 status: code: 200 message: OK @@ -3087,13 +3077,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -3103,7 +3093,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:57:00 GMT + - Thu, 17 Sep 2020 02:49:12 GMT expires: - '-1' pragma: @@ -3120,7 +3110,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29840 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29866 status: code: 200 message: OK @@ -3134,13 +3124,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -3150,7 +3140,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:57:30 GMT + - Thu, 17 Sep 2020 02:49:43 GMT expires: - '-1' pragma: @@ -3167,7 +3157,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29836 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29863 status: code: 200 message: OK @@ -3181,13 +3171,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -3197,7 +3187,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:58:00 GMT + - Thu, 17 Sep 2020 02:50:13 GMT expires: - '-1' pragma: @@ -3214,7 +3204,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29833 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29862 status: code: 200 message: OK @@ -3228,13 +3218,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -3244,7 +3234,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:58:31 GMT + - Thu, 17 Sep 2020 02:50:43 GMT expires: - '-1' pragma: @@ -3261,7 +3251,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29830 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29859 status: code: 200 message: OK @@ -3275,13 +3265,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -3291,7 +3281,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:59:00 GMT + - Thu, 17 Sep 2020 02:51:13 GMT expires: - '-1' pragma: @@ -3308,7 +3298,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29827 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29856 status: code: 200 message: OK @@ -3322,13 +3312,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -3338,7 +3328,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 20:59:30 GMT + - Thu, 17 Sep 2020 02:51:44 GMT expires: - '-1' pragma: @@ -3355,7 +3345,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29824 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29853 status: code: 200 message: OK @@ -3369,13 +3359,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -3385,7 +3375,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:00:01 GMT + - Thu, 17 Sep 2020 02:52:15 GMT expires: - '-1' pragma: @@ -3402,7 +3392,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29848 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29850 status: code: 200 message: OK @@ -3416,13 +3406,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -3432,7 +3422,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:00:31 GMT + - Thu, 17 Sep 2020 02:52:44 GMT expires: - '-1' pragma: @@ -3449,7 +3439,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29845 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29847 status: code: 200 message: OK @@ -3463,13 +3453,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -3479,7 +3469,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:01:01 GMT + - Thu, 17 Sep 2020 02:53:14 GMT expires: - '-1' pragma: @@ -3496,7 +3486,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29842 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29844 status: code: 200 message: OK @@ -3510,13 +3500,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -3526,7 +3516,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:01:31 GMT + - Thu, 17 Sep 2020 02:53:46 GMT expires: - '-1' pragma: @@ -3543,7 +3533,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29839 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29841 status: code: 200 message: OK @@ -3557,13 +3547,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -3573,7 +3563,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:02:01 GMT + - Thu, 17 Sep 2020 02:54:16 GMT expires: - '-1' pragma: @@ -3590,7 +3580,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29836 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29838 status: code: 200 message: OK @@ -3604,13 +3594,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -3620,7 +3610,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:02:32 GMT + - Thu, 17 Sep 2020 02:54:46 GMT expires: - '-1' pragma: @@ -3637,7 +3627,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29832 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29835 status: code: 200 message: OK @@ -3651,13 +3641,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -3667,7 +3657,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:03:02 GMT + - Thu, 17 Sep 2020 02:55:17 GMT expires: - '-1' pragma: @@ -3684,7 +3674,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29829 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29857 status: code: 200 message: OK @@ -3698,13 +3688,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -3714,7 +3704,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:03:33 GMT + - Thu, 17 Sep 2020 02:55:48 GMT expires: - '-1' pragma: @@ -3731,7 +3721,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29826 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29854 status: code: 200 message: OK @@ -3745,13 +3735,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -3761,7 +3751,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:04:02 GMT + - Thu, 17 Sep 2020 02:56:18 GMT expires: - '-1' pragma: @@ -3778,7 +3768,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29823 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29851 status: code: 200 message: OK @@ -3792,13 +3782,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -3808,7 +3798,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:04:32 GMT + - Thu, 17 Sep 2020 02:56:48 GMT expires: - '-1' pragma: @@ -3825,7 +3815,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29821 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29848 status: code: 200 message: OK @@ -3839,13 +3829,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -3855,7 +3845,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:05:04 GMT + - Thu, 17 Sep 2020 02:57:18 GMT expires: - '-1' pragma: @@ -3872,7 +3862,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29845 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29845 status: code: 200 message: OK @@ -3886,13 +3876,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -3902,7 +3892,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:05:33 GMT + - Thu, 17 Sep 2020 02:57:49 GMT expires: - '-1' pragma: @@ -3919,7 +3909,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29842 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29842 status: code: 200 message: OK @@ -3933,13 +3923,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -3949,7 +3939,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:06:03 GMT + - Thu, 17 Sep 2020 02:58:19 GMT expires: - '-1' pragma: @@ -3966,7 +3956,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29839 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29840 status: code: 200 message: OK @@ -3980,13 +3970,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -3996,7 +3986,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:06:34 GMT + - Thu, 17 Sep 2020 02:58:50 GMT expires: - '-1' pragma: @@ -4013,7 +4003,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29836 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29837 status: code: 200 message: OK @@ -4027,13 +4017,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -4043,7 +4033,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:07:04 GMT + - Thu, 17 Sep 2020 02:59:20 GMT expires: - '-1' pragma: @@ -4060,7 +4050,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29833 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29834 status: code: 200 message: OK @@ -4074,13 +4064,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -4090,7 +4080,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:07:34 GMT + - Thu, 17 Sep 2020 02:59:51 GMT expires: - '-1' pragma: @@ -4107,7 +4097,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29830 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29831 status: code: 200 message: OK @@ -4121,13 +4111,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -4137,7 +4127,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:08:04 GMT + - Thu, 17 Sep 2020 03:00:21 GMT expires: - '-1' pragma: @@ -4154,7 +4144,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29827 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29857 status: code: 200 message: OK @@ -4168,13 +4158,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -4184,7 +4174,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:08:34 GMT + - Thu, 17 Sep 2020 03:00:51 GMT expires: - '-1' pragma: @@ -4201,7 +4191,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29823 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29854 status: code: 200 message: OK @@ -4215,13 +4205,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -4231,7 +4221,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:09:05 GMT + - Thu, 17 Sep 2020 03:01:22 GMT expires: - '-1' pragma: @@ -4248,7 +4238,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29820 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29851 status: code: 200 message: OK @@ -4262,13 +4252,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -4278,7 +4268,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:09:35 GMT + - Thu, 17 Sep 2020 03:01:54 GMT expires: - '-1' pragma: @@ -4295,7 +4285,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29816 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29849 status: code: 200 message: OK @@ -4309,13 +4299,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -4325,7 +4315,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:10:05 GMT + - Thu, 17 Sep 2020 03:02:24 GMT expires: - '-1' pragma: @@ -4342,7 +4332,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29846 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29846 status: code: 200 message: OK @@ -4356,13 +4346,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -4372,7 +4362,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:10:35 GMT + - Thu, 17 Sep 2020 03:02:54 GMT expires: - '-1' pragma: @@ -4389,7 +4379,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29843 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29843 status: code: 200 message: OK @@ -4403,13 +4393,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -4419,7 +4409,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:11:05 GMT + - Thu, 17 Sep 2020 03:03:24 GMT expires: - '-1' pragma: @@ -4436,7 +4426,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29840 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29840 status: code: 200 message: OK @@ -4450,13 +4440,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -4466,7 +4456,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:11:36 GMT + - Thu, 17 Sep 2020 03:03:55 GMT expires: - '-1' pragma: @@ -4497,13 +4487,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -4513,7 +4503,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:12:05 GMT + - Thu, 17 Sep 2020 03:04:25 GMT expires: - '-1' pragma: @@ -4530,7 +4520,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29834 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29834 status: code: 200 message: OK @@ -4544,13 +4534,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -4560,7 +4550,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:12:36 GMT + - Thu, 17 Sep 2020 03:04:55 GMT expires: - '-1' pragma: @@ -4577,7 +4567,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29831 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29831 status: code: 200 message: OK @@ -4591,13 +4581,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -4607,7 +4597,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:13:07 GMT + - Thu, 17 Sep 2020 03:05:26 GMT expires: - '-1' pragma: @@ -4624,7 +4614,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29829 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29856 status: code: 200 message: OK @@ -4638,13 +4628,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -4654,7 +4644,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:13:37 GMT + - Thu, 17 Sep 2020 03:05:57 GMT expires: - '-1' pragma: @@ -4671,7 +4661,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29826 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29853 status: code: 200 message: OK @@ -4685,13 +4675,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -4701,7 +4691,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:14:07 GMT + - Thu, 17 Sep 2020 03:06:28 GMT expires: - '-1' pragma: @@ -4718,7 +4708,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29822 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29850 status: code: 200 message: OK @@ -4732,13 +4722,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -4748,7 +4738,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:14:36 GMT + - Thu, 17 Sep 2020 03:06:58 GMT expires: - '-1' pragma: @@ -4765,7 +4755,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29818 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29847 status: code: 200 message: OK @@ -4779,13 +4769,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -4795,7 +4785,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:15:07 GMT + - Thu, 17 Sep 2020 03:07:28 GMT expires: - '-1' pragma: @@ -4812,7 +4802,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29846 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29844 status: code: 200 message: OK @@ -4826,13 +4816,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -4842,7 +4832,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:15:37 GMT + - Thu, 17 Sep 2020 03:07:58 GMT expires: - '-1' pragma: @@ -4859,7 +4849,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29843 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29841 status: code: 200 message: OK @@ -4873,13 +4863,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -4889,7 +4879,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:16:07 GMT + - Thu, 17 Sep 2020 03:08:30 GMT expires: - '-1' pragma: @@ -4906,7 +4896,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29841 + - Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29838 status: code: 200 message: OK @@ -4920,13 +4910,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -4936,7 +4926,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:16:37 GMT + - Thu, 17 Sep 2020 03:09:00 GMT expires: - '-1' pragma: @@ -4953,7 +4943,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29838 + - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29835 status: code: 200 message: OK @@ -4967,13 +4957,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -4983,7 +4973,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:17:08 GMT + - Thu, 17 Sep 2020 03:09:31 GMT expires: - '-1' pragma: @@ -5000,7 +4990,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29835 + - Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29833 status: code: 200 message: OK @@ -5014,13 +5004,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -5030,7 +5020,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:17:38 GMT + - Thu, 17 Sep 2020 03:10:01 GMT expires: - '-1' pragma: @@ -5047,7 +5037,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29832 + - Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29858 status: code: 200 message: OK @@ -5061,13 +5051,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -5077,7 +5067,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:18:08 GMT + - Thu, 17 Sep 2020 03:10:31 GMT expires: - '-1' pragma: @@ -5094,7 +5084,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29829 + - Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29855 status: code: 200 message: OK @@ -5108,13 +5098,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -5124,7 +5114,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:18:38 GMT + - Thu, 17 Sep 2020 03:11:02 GMT expires: - '-1' pragma: @@ -5141,7 +5131,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29826 + - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29852 status: code: 200 message: OK @@ -5155,13 +5145,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -5171,7 +5161,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:19:09 GMT + - Thu, 17 Sep 2020 03:11:32 GMT expires: - '-1' pragma: @@ -5188,7 +5178,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29823 + - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29849 status: code: 200 message: OK @@ -5202,13 +5192,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -5218,7 +5208,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:19:38 GMT + - Thu, 17 Sep 2020 03:12:02 GMT expires: - '-1' pragma: @@ -5235,7 +5225,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29821 + - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29847 status: code: 200 message: OK @@ -5249,13 +5239,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -5265,7 +5255,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:20:09 GMT + - Thu, 17 Sep 2020 03:12:33 GMT expires: - '-1' pragma: @@ -5282,7 +5272,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29846 + - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29844 status: code: 200 message: OK @@ -5296,13 +5286,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -5312,7 +5302,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:20:39 GMT + - Thu, 17 Sep 2020 03:13:03 GMT expires: - '-1' pragma: @@ -5329,7 +5319,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29843 + - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29841 status: code: 200 message: OK @@ -5343,13 +5333,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -5359,7 +5349,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:21:09 GMT + - Thu, 17 Sep 2020 03:13:34 GMT expires: - '-1' pragma: @@ -5376,7 +5366,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29839 + - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29838 status: code: 200 message: OK @@ -5390,13 +5380,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -5406,7 +5396,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:21:39 GMT + - Thu, 17 Sep 2020 03:14:04 GMT expires: - '-1' pragma: @@ -5423,7 +5413,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29835 + - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29835 status: code: 200 message: OK @@ -5437,13 +5427,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -5453,7 +5443,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:22:09 GMT + - Thu, 17 Sep 2020 03:14:34 GMT expires: - '-1' pragma: @@ -5470,7 +5460,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29832 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29832 status: code: 200 message: OK @@ -5484,13 +5474,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -5500,7 +5490,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:22:39 GMT + - Thu, 17 Sep 2020 03:15:05 GMT expires: - '-1' pragma: @@ -5517,7 +5507,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29830 + - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29859 status: code: 200 message: OK @@ -5531,13 +5521,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -5547,7 +5537,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:23:10 GMT + - Thu, 17 Sep 2020 03:15:35 GMT expires: - '-1' pragma: @@ -5564,7 +5554,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29826 + - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29856 status: code: 200 message: OK @@ -5578,13 +5568,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\ \r\n}" headers: cache-control: @@ -5594,7 +5584,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:23:40 GMT + - Thu, 17 Sep 2020 03:16:05 GMT expires: - '-1' pragma: @@ -5611,7 +5601,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29823 + - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29853 status: code: 200 message: OK @@ -5625,23 +5615,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ - \r\n}" + string: "{\r\n \"startTime\": \"2020-09-17T02:26:17.8254135+00:00\",\r\n \"\ + endTime\": \"2020-09-17T03:16:18.2837158+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"c0f7350c-cda0-4633-ace4-efdc92ce52ab\"\r\n}" headers: cache-control: - no-cache content-length: - - '134' + - '184' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:24:11 GMT + - Thu, 17 Sep 2020 03:16:36 GMT expires: - '-1' pragma: @@ -5658,7 +5648,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29820 + - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29850 status: code: 200 message: OK @@ -5672,23 +5662,19 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0f7350c-cda0-4633-ace4-efdc92ce52ab?monitor=true&api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ - \r\n}" + string: '' headers: cache-control: - no-cache content-length: - - '134' - content-type: - - application/json; charset=utf-8 + - '0' date: - - Mon, 18 May 2020 21:24:41 GMT + - Thu, 17 Sep 2020 03:16:36 GMT expires: - '-1' pragma: @@ -5698,816 +5684,80 @@ interactions: - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29816 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29849 status: code: 200 message: OK - request: - body: null + body: '{"sku": {"name": "Standard_D1_v2", "tier": "Standard", "capacity": 2}, + "properties": {"upgradePolicy": {"mode": "Manual"}}}' headers: Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ - \r\n}" - headers: - cache-control: - - no-cache - content-length: - - '134' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 18 May 2020 21:25:11 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29843 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ - \r\n}" - headers: - cache-control: - - no-cache - content-length: - - '134' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 18 May 2020 21:25:41 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29841 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ - \r\n}" - headers: - cache-control: - - no-cache - content-length: - - '134' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 18 May 2020 21:26:11 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29838 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ - \r\n}" - headers: - cache-control: - - no-cache - content-length: - - '134' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 18 May 2020 21:26:41 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29835 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ - \r\n}" - headers: - cache-control: - - no-cache - content-length: - - '134' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 18 May 2020 21:27:12 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29832 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-05-18T20:47:53.4902632+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\ - \r\n}" - headers: - cache-control: - - no-cache - content-length: - - '134' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 18 May 2020 21:27:41 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29829 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-05-18T21:27:53.7372778+00:00\",\r\n \"\ - endTime\": \"2020-05-18T21:27:53.7529384+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"efc05faf-98bd-4326-aa6e-4cdc86f6947b\"\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '184' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 18 May 2020 21:28:11 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29827 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/efc05faf-98bd-4326-aa6e-4cdc86f6947b?monitor=true&api-version=2019-12-01 - response: - body: - string: '' - headers: - cache-control: - - no-cache - content-length: - - '0' - date: - - Mon, 18 May 2020 21:28:11 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29826 - status: - code: 200 - message: OK -- request: - body: '{"sku": {"name": "Standard_D1_v2", "tier": "Standard", "capacity": 2}, - "properties": {"upgradePolicy": {"mode": "Manual"}}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '123' - Content-Type: - - application/json - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3?api-version=2019-12-01 - response: - body: - string: "{\r\n \"name\": \"virtualmachinescaleset80f0ea3\",\r\n \"id\": \"\ - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3\"\ - ,\r\n \"type\": \"Microsoft.Compute/virtualMachineScaleSets\",\r\n \"location\"\ - : \"eastus\",\r\n \"sku\": {\r\n \"name\": \"Standard_D1_v2\",\r\n \ - \ \"tier\": \"Standard\",\r\n \"capacity\": 2\r\n },\r\n \"properties\"\ - : {\r\n \"singlePlacementGroup\": true,\r\n \"upgradePolicy\": {\r\n\ - \ \"mode\": \"Manual\"\r\n },\r\n \"virtualMachineProfile\": {\r\ - \n \"osProfile\": {\r\n \"computerNamePrefix\": \"testPC\",\r\n\ - \ \"adminUsername\": \"testuser\",\r\n \"linuxConfiguration\"\ - : {\r\n \"disablePasswordAuthentication\": false,\r\n \"\ - provisionVMAgent\": true\r\n },\r\n \"secrets\": [],\r\n \ - \ \"allowExtensionOperations\": true,\r\n \"requireGuestProvisionSignal\"\ - : true\r\n },\r\n \"storageProfile\": {\r\n \"osDisk\": {\r\ - \n \"createOption\": \"FromImage\",\r\n \"caching\": \"\ - ReadWrite\",\r\n \"managedDisk\": {\r\n \"storageAccountType\"\ - : \"Standard_LRS\"\r\n },\r\n \"diskSizeGB\": 512\r\n \ - \ },\r\n \"imageReference\": {\r\n \"publisher\": \"\ - Canonical\",\r\n \"offer\": \"UbuntuServer\",\r\n \"sku\"\ - : \"18.04-LTS\",\r\n \"version\": \"latest\"\r\n }\r\n \ - \ },\r\n \"networkProfile\": {\"networkInterfaceConfigurations\":[{\"\ - name\":\"testPC\",\"properties\":{\"primary\":true,\"enableAcceleratedNetworking\"\ - :false,\"dnsSettings\":{\"dnsServers\":[]},\"enableIPForwarding\":false,\"\ - ipConfigurations\":[{\"name\":\"testPC\",\"properties\":{\"subnet\":{\"id\"\ - :\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex80f0ea3/subnets/subnetnamex80f0ea3\"\ - },\"privateIPAddressVersion\":\"IPv4\"}}]}}]},\r\n \"extensionProfile\"\ - : {\r\n \"extensions\": [\r\n {\r\n \"name\": \"\ - vmssextensionx80f0ea3\",\r\n \"properties\": {\r\n \ - \ \"autoUpgradeMinorVersion\": true,\r\n \"publisher\": \"Microsoft.Azure.NetworkWatcher\"\ - ,\r\n \"type\": \"NetworkWatcherAgentWindows\",\r\n \ - \ \"typeHandlerVersion\": \"1.4\"\r\n }\r\n }\r\n\ - \ ]\r\n }\r\n },\r\n \"provisioningState\": \"Updating\"\ - ,\r\n \"overprovision\": true,\r\n \"doNotRunExtensionsOnOverprovisionedVMs\"\ - : false,\r\n \"uniqueId\": \"d9c74afe-68c7-4cd0-96b9-7078d54daf36\"\r\n\ - \ }\r\n}" - headers: - azure-asyncnotification: - - Enabled - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/bbeab88a-0816-4fe4-8dca-2dffca772913?api-version=2019-12-01 - cache-control: - - no-cache - content-length: - - '2461' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 18 May 2020 21:28:16 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/VMScaleSetActions3Min;239,Microsoft.Compute/VMScaleSetActions30Min;1199,Microsoft.Compute/VmssQueuedVMOperations;4800 - x-ms-ratelimit-remaining-subscription-writes: - - '1197' - x-ms-request-charge: - - '0' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/bbeab88a-0816-4fe4-8dca-2dffca772913?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-05-18T21:28:14.9249545+00:00\",\r\n \"\ - endTime\": \"2020-05-18T21:28:15.0499549+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"bbeab88a-0816-4fe4-8dca-2dffca772913\"\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '184' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 18 May 2020 21:28:26 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29824 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3?api-version=2019-12-01 - response: - body: - string: "{\r\n \"name\": \"virtualmachinescaleset80f0ea3\",\r\n \"id\": \"\ - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3\"\ - ,\r\n \"type\": \"Microsoft.Compute/virtualMachineScaleSets\",\r\n \"location\"\ - : \"eastus\",\r\n \"sku\": {\r\n \"name\": \"Standard_D1_v2\",\r\n \ - \ \"tier\": \"Standard\",\r\n \"capacity\": 2\r\n },\r\n \"properties\"\ - : {\r\n \"singlePlacementGroup\": true,\r\n \"upgradePolicy\": {\r\n\ - \ \"mode\": \"Manual\"\r\n },\r\n \"virtualMachineProfile\": {\r\ - \n \"osProfile\": {\r\n \"computerNamePrefix\": \"testPC\",\r\n\ - \ \"adminUsername\": \"testuser\",\r\n \"linuxConfiguration\"\ - : {\r\n \"disablePasswordAuthentication\": false,\r\n \"\ - provisionVMAgent\": true\r\n },\r\n \"secrets\": [],\r\n \ - \ \"allowExtensionOperations\": true,\r\n \"requireGuestProvisionSignal\"\ - : true\r\n },\r\n \"storageProfile\": {\r\n \"osDisk\": {\r\ - \n \"createOption\": \"FromImage\",\r\n \"caching\": \"\ - ReadWrite\",\r\n \"managedDisk\": {\r\n \"storageAccountType\"\ - : \"Standard_LRS\"\r\n },\r\n \"diskSizeGB\": 512\r\n \ - \ },\r\n \"imageReference\": {\r\n \"publisher\": \"\ - Canonical\",\r\n \"offer\": \"UbuntuServer\",\r\n \"sku\"\ - : \"18.04-LTS\",\r\n \"version\": \"latest\"\r\n }\r\n \ - \ },\r\n \"networkProfile\": {\"networkInterfaceConfigurations\":[{\"\ - name\":\"testPC\",\"properties\":{\"primary\":true,\"enableAcceleratedNetworking\"\ - :false,\"dnsSettings\":{\"dnsServers\":[]},\"enableIPForwarding\":false,\"\ - ipConfigurations\":[{\"name\":\"testPC\",\"properties\":{\"subnet\":{\"id\"\ - :\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex80f0ea3/subnets/subnetnamex80f0ea3\"\ - },\"privateIPAddressVersion\":\"IPv4\"}}]}}]},\r\n \"extensionProfile\"\ - : {\r\n \"extensions\": [\r\n {\r\n \"name\": \"\ - vmssextensionx80f0ea3\",\r\n \"properties\": {\r\n \ - \ \"autoUpgradeMinorVersion\": true,\r\n \"publisher\": \"Microsoft.Azure.NetworkWatcher\"\ - ,\r\n \"type\": \"NetworkWatcherAgentWindows\",\r\n \ - \ \"typeHandlerVersion\": \"1.4\"\r\n }\r\n }\r\n\ - \ ]\r\n }\r\n },\r\n \"provisioningState\": \"Succeeded\"\ - ,\r\n \"overprovision\": true,\r\n \"doNotRunExtensionsOnOverprovisionedVMs\"\ - : false,\r\n \"uniqueId\": \"d9c74afe-68c7-4cd0-96b9-7078d54daf36\"\r\n\ - \ }\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '2462' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 18 May 2020 21:28:26 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetVMScaleSet3Min;394,Microsoft.Compute/GetVMScaleSet30Min;2593 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - Content-Type: - - application/json - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3/restart?api-version=2019-12-01 - response: - body: - string: '' - headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/5904e7d8-d903-42cf-86c6-29b92211baa5?api-version=2019-12-01 - cache-control: - - no-cache - content-length: - - '0' - date: - - Mon, 18 May 2020 21:28:27 GMT - expires: - - '-1' - location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/5904e7d8-d903-42cf-86c6-29b92211baa5?monitor=true&api-version=2019-12-01 - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/VMScaleSetActions3Min;238,Microsoft.Compute/VMScaleSetActions30Min;1198,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;2903,Microsoft.Compute/VmssQueuedVMOperations;4798 - x-ms-ratelimit-remaining-subscription-writes: - - '1198' - x-ms-request-charge: - - '2' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/5904e7d8-d903-42cf-86c6-29b92211baa5?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-05-18T21:28:27.4719034+00:00\",\r\n \"\ - endTime\": \"2020-05-18T21:28:43.518812+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"5904e7d8-d903-42cf-86c6-29b92211baa5\"\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '183' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 18 May 2020 21:28:57 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29822 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/5904e7d8-d903-42cf-86c6-29b92211baa5?monitor=true&api-version=2019-12-01 - response: - body: - string: '' - headers: - cache-control: - - no-cache - content-length: - - '0' - date: - - Mon, 18 May 2020 21:28:57 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29821 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate Connection: - keep-alive Content-Length: - - '0' + - '123' Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3/poweroff?skipShutdown=false&api-version=2019-12-01 + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3?api-version=2020-06-01 response: body: - string: '' + string: "{\r\n \"name\": \"virtualmachinescaleset80f0ea3\",\r\n \"id\": \"\ + /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3\"\ + ,\r\n \"type\": \"Microsoft.Compute/virtualMachineScaleSets\",\r\n \"location\"\ + : \"eastus\",\r\n \"sku\": {\r\n \"name\": \"Standard_D1_v2\",\r\n \ + \ \"tier\": \"Standard\",\r\n \"capacity\": 2\r\n },\r\n \"properties\"\ + : {\r\n \"singlePlacementGroup\": true,\r\n \"upgradePolicy\": {\r\n\ + \ \"mode\": \"Manual\"\r\n },\r\n \"virtualMachineProfile\": {\r\ + \n \"osProfile\": {\r\n \"computerNamePrefix\": \"testPC\",\r\n\ + \ \"adminUsername\": \"testuser\",\r\n \"linuxConfiguration\"\ + : {\r\n \"disablePasswordAuthentication\": false,\r\n \"\ + provisionVMAgent\": true\r\n },\r\n \"secrets\": [],\r\n \ + \ \"allowExtensionOperations\": true,\r\n \"requireGuestProvisionSignal\"\ + : true\r\n },\r\n \"storageProfile\": {\r\n \"osDisk\": {\r\ + \n \"createOption\": \"FromImage\",\r\n \"caching\": \"\ + ReadWrite\",\r\n \"managedDisk\": {\r\n \"storageAccountType\"\ + : \"Standard_LRS\"\r\n },\r\n \"diskSizeGB\": 512\r\n \ + \ },\r\n \"imageReference\": {\r\n \"publisher\": \"\ + Canonical\",\r\n \"offer\": \"UbuntuServer\",\r\n \"sku\"\ + : \"18.04-LTS\",\r\n \"version\": \"latest\"\r\n }\r\n \ + \ },\r\n \"networkProfile\": {\"networkInterfaceConfigurations\":[{\"\ + name\":\"testPC\",\"properties\":{\"primary\":true,\"enableAcceleratedNetworking\"\ + :false,\"dnsSettings\":{\"dnsServers\":[]},\"enableIPForwarding\":false,\"\ + ipConfigurations\":[{\"name\":\"testPC\",\"properties\":{\"subnet\":{\"id\"\ + :\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex80f0ea3/subnets/subnetnamex80f0ea3\"\ + },\"privateIPAddressVersion\":\"IPv4\"}}]}}]},\r\n \"extensionProfile\"\ + : {\r\n \"extensions\": [\r\n {\r\n \"name\": \"\ + vmssextensionx80f0ea3\",\r\n \"properties\": {\r\n \ + \ \"autoUpgradeMinorVersion\": true,\r\n \"publisher\": \"Microsoft.Azure.NetworkWatcher\"\ + ,\r\n \"type\": \"NetworkWatcherAgentWindows\",\r\n \ + \ \"typeHandlerVersion\": \"1.4\"\r\n }\r\n }\r\n\ + \ ]\r\n }\r\n },\r\n \"provisioningState\": \"Updating\"\ + ,\r\n \"overprovision\": true,\r\n \"doNotRunExtensionsOnOverprovisionedVMs\"\ + : false,\r\n \"uniqueId\": \"06e379e6-983d-4f98-8634-fbaef3793187\"\r\n\ + \ }\r\n}" headers: + azure-asyncnotification: + - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/0295437b-f7f1-49cc-8605-248da942ffb7?api-version=2019-12-01 - cache-control: - - no-cache - content-length: - - '0' - date: - - Mon, 18 May 2020 21:28:58 GMT - expires: - - '-1' - location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/0295437b-f7f1-49cc-8605-248da942ffb7?monitor=true&api-version=2019-12-01 - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/DeleteVMScaleSet3Min;79,Microsoft.Compute/DeleteVMScaleSet30Min;399,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;2901,Microsoft.Compute/VmssQueuedVMOperations;4798 - x-ms-ratelimit-remaining-subscription-writes: - - '1197' - x-ms-request-charge: - - '2' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/0295437b-f7f1-49cc-8605-248da942ffb7?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-05-18T21:28:58.4407137+00:00\",\r\n \"\ - endTime\": \"2020-05-18T21:29:12.4409053+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"0295437b-f7f1-49cc-8605-248da942ffb7\"\r\n}" - headers: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3bdf4dd1-f86b-4c4a-ad11-b2d1ccb075f3?api-version=2020-06-01 cache-control: - no-cache content-length: - - '184' + - '2527' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:29:28 GMT + - Thu, 17 Sep 2020 03:16:42 GMT expires: - '-1' pragma: @@ -6524,100 +5774,14 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29818 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/0295437b-f7f1-49cc-8605-248da942ffb7?monitor=true&api-version=2019-12-01 - response: - body: - string: '' - headers: - cache-control: - - no-cache - content-length: + - Microsoft.Compute/VMScaleSetActions3Min;239,Microsoft.Compute/VMScaleSetActions30Min;1199,Microsoft.Compute/VmssQueuedVMOperations;4800 + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + x-ms-request-charge: - '0' - date: - - Mon, 18 May 2020 21:29:28 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14980,Microsoft.Compute/GetOperation30Min;29817 status: code: 200 message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - Content-Type: - - application/json - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3/start?api-version=2019-12-01 - response: - body: - string: '' - headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4e4e84a9-3f54-431c-b337-d75dfcbad54d?api-version=2019-12-01 - cache-control: - - no-cache - content-length: - - '0' - date: - - Mon, 18 May 2020 21:29:28 GMT - expires: - - '-1' - location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4e4e84a9-3f54-431c-b337-d75dfcbad54d?monitor=true&api-version=2019-12-01 - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/VMScaleSetActions3Min;237,Microsoft.Compute/VMScaleSetActions30Min;1197,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;2899,Microsoft.Compute/VmssQueuedVMOperations;4798 - x-ms-ratelimit-remaining-subscription-writes: - - '1196' - x-ms-request-charge: - - '2' - status: - code: 202 - message: Accepted - request: body: null headers: @@ -6628,14 +5792,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4e4e84a9-3f54-431c-b337-d75dfcbad54d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3bdf4dd1-f86b-4c4a-ad11-b2d1ccb075f3?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:29:29.3161081+00:00\",\r\n \"\ - endTime\": \"2020-05-18T21:29:33.2223771+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"4e4e84a9-3f54-431c-b337-d75dfcbad54d\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-17T03:16:39.1745575+00:00\",\r\n \"\ + endTime\": \"2020-09-17T03:16:39.2839798+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"3bdf4dd1-f86b-4c4a-ad11-b2d1ccb075f3\"\r\n}" headers: cache-control: - no-cache @@ -6644,7 +5808,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:29:58 GMT + - Thu, 17 Sep 2020 03:16:52 GMT expires: - '-1' pragma: @@ -6661,7 +5825,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29815 + - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29847 status: code: 200 message: OK @@ -6675,19 +5839,54 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4e4e84a9-3f54-431c-b337-d75dfcbad54d?monitor=true&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3?api-version=2020-06-01 response: body: - string: '' + string: "{\r\n \"name\": \"virtualmachinescaleset80f0ea3\",\r\n \"id\": \"\ + /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3\"\ + ,\r\n \"type\": \"Microsoft.Compute/virtualMachineScaleSets\",\r\n \"location\"\ + : \"eastus\",\r\n \"sku\": {\r\n \"name\": \"Standard_D1_v2\",\r\n \ + \ \"tier\": \"Standard\",\r\n \"capacity\": 2\r\n },\r\n \"properties\"\ + : {\r\n \"singlePlacementGroup\": true,\r\n \"upgradePolicy\": {\r\n\ + \ \"mode\": \"Manual\"\r\n },\r\n \"virtualMachineProfile\": {\r\ + \n \"osProfile\": {\r\n \"computerNamePrefix\": \"testPC\",\r\n\ + \ \"adminUsername\": \"testuser\",\r\n \"linuxConfiguration\"\ + : {\r\n \"disablePasswordAuthentication\": false,\r\n \"\ + provisionVMAgent\": true\r\n },\r\n \"secrets\": [],\r\n \ + \ \"allowExtensionOperations\": true,\r\n \"requireGuestProvisionSignal\"\ + : true\r\n },\r\n \"storageProfile\": {\r\n \"osDisk\": {\r\ + \n \"createOption\": \"FromImage\",\r\n \"caching\": \"\ + ReadWrite\",\r\n \"managedDisk\": {\r\n \"storageAccountType\"\ + : \"Standard_LRS\"\r\n },\r\n \"diskSizeGB\": 512\r\n \ + \ },\r\n \"imageReference\": {\r\n \"publisher\": \"\ + Canonical\",\r\n \"offer\": \"UbuntuServer\",\r\n \"sku\"\ + : \"18.04-LTS\",\r\n \"version\": \"latest\"\r\n }\r\n \ + \ },\r\n \"networkProfile\": {\"networkInterfaceConfigurations\":[{\"\ + name\":\"testPC\",\"properties\":{\"primary\":true,\"enableAcceleratedNetworking\"\ + :false,\"dnsSettings\":{\"dnsServers\":[]},\"enableIPForwarding\":false,\"\ + ipConfigurations\":[{\"name\":\"testPC\",\"properties\":{\"subnet\":{\"id\"\ + :\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex80f0ea3/subnets/subnetnamex80f0ea3\"\ + },\"privateIPAddressVersion\":\"IPv4\"}}]}}]},\r\n \"extensionProfile\"\ + : {\r\n \"extensions\": [\r\n {\r\n \"name\": \"\ + vmssextensionx80f0ea3\",\r\n \"properties\": {\r\n \ + \ \"autoUpgradeMinorVersion\": true,\r\n \"publisher\": \"Microsoft.Azure.NetworkWatcher\"\ + ,\r\n \"type\": \"NetworkWatcherAgentWindows\",\r\n \ + \ \"typeHandlerVersion\": \"1.4\"\r\n }\r\n }\r\n\ + \ ]\r\n }\r\n },\r\n \"provisioningState\": \"Succeeded\"\ + ,\r\n \"overprovision\": true,\r\n \"doNotRunExtensionsOnOverprovisionedVMs\"\ + : false,\r\n \"uniqueId\": \"06e379e6-983d-4f98-8634-fbaef3793187\"\r\n\ + \ }\r\n}" headers: cache-control: - no-cache content-length: - - '0' + - '2528' + content-type: + - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:29:59 GMT + - Thu, 17 Sep 2020 03:16:53 GMT expires: - '-1' pragma: @@ -6697,10 +5896,14 @@ interactions: - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14980,Microsoft.Compute/GetOperation30Min;29814 + - Microsoft.Compute/GetVMScaleSet3Min;397,Microsoft.Compute/GetVMScaleSet30Min;2597 status: code: 200 message: OK @@ -6718,25 +5921,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3/poweroff?skipShutdown=false&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3/restart?api-version=2020-06-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1895cf09-1e98-43c2-8222-6fe65c94af77?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1b6cf820-b08f-4266-818c-f702e39cac99?api-version=2020-06-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 18 May 2020 21:30:00 GMT + - Thu, 17 Sep 2020 03:16:53 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1895cf09-1e98-43c2-8222-6fe65c94af77?monitor=true&api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1b6cf820-b08f-4266-818c-f702e39cac99?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -6747,9 +5950,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/DeleteVMScaleSet3Min;78,Microsoft.Compute/DeleteVMScaleSet30Min;398,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;2897,Microsoft.Compute/VmssQueuedVMOperations;4798 + - Microsoft.Compute/VMScaleSetActions3Min;238,Microsoft.Compute/VMScaleSetActions30Min;1198,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;1198,Microsoft.Compute/VmssQueuedVMOperations;4798 x-ms-ratelimit-remaining-subscription-writes: - - '1195' + - '1198' x-ms-request-charge: - '2' status: @@ -6765,23 +5968,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1895cf09-1e98-43c2-8222-6fe65c94af77?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1b6cf820-b08f-4266-818c-f702e39cac99?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:30:01.034915+00:00\",\r\n \"\ - endTime\": \"2020-05-18T21:30:19.394413+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"1895cf09-1e98-43c2-8222-6fe65c94af77\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-17T03:16:53.6591523+00:00\",\r\n \"\ + endTime\": \"2020-09-17T03:17:07.768626+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"1b6cf820-b08f-4266-818c-f702e39cac99\"\r\n}" headers: cache-control: - no-cache content-length: - - '182' + - '183' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:30:31 GMT + - Thu, 17 Sep 2020 03:17:23 GMT expires: - '-1' pragma: @@ -6798,7 +6001,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29842 + - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29845 status: code: 200 message: OK @@ -6812,9 +6015,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1895cf09-1e98-43c2-8222-6fe65c94af77?monitor=true&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1b6cf820-b08f-4266-818c-f702e39cac99?monitor=true&api-version=2020-06-01 response: body: string: '' @@ -6824,7 +6027,7 @@ interactions: content-length: - '0' date: - - Mon, 18 May 2020 21:30:31 GMT + - Thu, 17 Sep 2020 03:17:23 GMT expires: - '-1' pragma: @@ -6837,46 +6040,43 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29841 + - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29844 status: code: 200 message: OK - request: - body: '{"properties": {"autoUpgradeMinorVersion": true}}' + body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive Content-Length: - - '49' + - '0' Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3/extensions/vmssextensionx80f0ea3?api-version=2019-12-01 + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3/poweroff?skipShutdown=false&api-version=2020-06-01 response: body: - string: "{\r\n \"name\": \"vmssextensionx80f0ea3\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3/extensions/vmssextensionx80f0ea3\"\ - ,\r\n \"type\": \"Microsoft.Compute/virtualMachineScaleSets/extensions\"\ - ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n\ - \ \"autoUpgradeMinorVersion\": true\r\n }\r\n}" + string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/54d3a27a-5aeb-4df5-a0be-50f71f224380?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b42f645f-3064-4b5f-a302-81cafc7eaea7?api-version=2020-06-01 cache-control: - no-cache content-length: - - '444' - content-type: - - application/json; charset=utf-8 + - '0' date: - - Mon, 18 May 2020 21:30:31 GMT + - Thu, 17 Sep 2020 03:17:24 GMT expires: - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b42f645f-3064-4b5f-a302-81cafc7eaea7?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -6887,14 +6087,14 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/VMScaleSetActions3Min;236,Microsoft.Compute/VMScaleSetActions30Min;1196,Microsoft.Compute/VmssQueuedVMOperations;4800 + - Microsoft.Compute/DeleteVMScaleSet3Min;79,Microsoft.Compute/DeleteVMScaleSet30Min;399,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;1196,Microsoft.Compute/VmssQueuedVMOperations;4798 x-ms-ratelimit-remaining-subscription-writes: - - '1196' + - '1197' x-ms-request-charge: - - '0' + - '2' status: - code: 201 - message: Created + code: 202 + message: Accepted - request: body: null headers: @@ -6905,23 +6105,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/54d3a27a-5aeb-4df5-a0be-50f71f224380?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b42f645f-3064-4b5f-a302-81cafc7eaea7?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:30:31.9569911+00:00\",\r\n \"\ - endTime\": \"2020-05-18T21:30:32.097616+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"54d3a27a-5aeb-4df5-a0be-50f71f224380\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-17T03:17:24.7529992+00:00\",\r\n \"\ + endTime\": \"2020-09-17T03:17:36.1906272+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"b42f645f-3064-4b5f-a302-81cafc7eaea7\"\r\n}" headers: cache-control: - no-cache content-length: - - '183' + - '184' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:30:41 GMT + - Thu, 17 Sep 2020 03:17:54 GMT expires: - '-1' pragma: @@ -6938,7 +6138,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29839 + - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29842 status: code: 200 message: OK @@ -6952,26 +6152,19 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3/extensions/vmssextensionx80f0ea3?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b42f645f-3064-4b5f-a302-81cafc7eaea7?monitor=true&api-version=2020-06-01 response: body: - string: "{\r\n \"name\": \"vmssextensionx80f0ea3\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3/extensions/vmssextensionx80f0ea3\"\ - ,\r\n \"type\": \"Microsoft.Compute/virtualMachineScaleSets/extensions\"\ - ,\r\n \"properties\": {\r\n \"provisioningState\": \"Creating\",\r\n \ - \ \"autoUpgradeMinorVersion\": true,\r\n \"publisher\": \"Microsoft.Azure.NetworkWatcher\"\ - ,\r\n \"type\": \"NetworkWatcherAgentWindows\",\r\n \"typeHandlerVersion\"\ - : \"1.4\"\r\n }\r\n}" + string: '' headers: cache-control: - no-cache content-length: - - '572' - content-type: - - application/json; charset=utf-8 + - '0' date: - - Mon, 18 May 2020 21:30:41 GMT + - Thu, 17 Sep 2020 03:17:54 GMT expires: - '-1' pragma: @@ -6981,14 +6174,10 @@ interactions: - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;3999,Microsoft.Compute/LowCostGet30Min;31992 + - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29841 status: code: 200 message: OK @@ -7003,26 +6192,28 @@ interactions: - keep-alive Content-Length: - '0' + Content-Type: + - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3/extensions/vmssextensionx80f0ea3?api-version=2019-12-01 + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3/start?api-version=2020-06-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/17c1e893-13ef-4aa9-b7da-344740bbbe90?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0be767a-ea5f-4cd0-8fc3-94befcdbea00?api-version=2020-06-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 18 May 2020 21:30:42 GMT + - Thu, 17 Sep 2020 03:17:55 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/17c1e893-13ef-4aa9-b7da-344740bbbe90?monitor=true&api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0be767a-ea5f-4cd0-8fc3-94befcdbea00?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -7033,11 +6224,11 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/VMScaleSetActions3Min;235,Microsoft.Compute/VMScaleSetActions30Min;1195,Microsoft.Compute/VmssQueuedVMOperations;4800 - x-ms-ratelimit-remaining-subscription-deletes: - - '14999' + - Microsoft.Compute/VMScaleSetActions3Min;237,Microsoft.Compute/VMScaleSetActions30Min;1197,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;1194,Microsoft.Compute/VmssQueuedVMOperations;4798 + x-ms-ratelimit-remaining-subscription-writes: + - '1196' x-ms-request-charge: - - '0' + - '2' status: code: 202 message: Accepted @@ -7051,14 +6242,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/17c1e893-13ef-4aa9-b7da-344740bbbe90?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0be767a-ea5f-4cd0-8fc3-94befcdbea00?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:30:42.9883353+00:00\",\r\n \"\ - endTime\": \"2020-05-18T21:30:43.1133357+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"17c1e893-13ef-4aa9-b7da-344740bbbe90\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-17T03:17:55.8626942+00:00\",\r\n \"\ + endTime\": \"2020-09-17T03:18:01.3939517+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"c0be767a-ea5f-4cd0-8fc3-94befcdbea00\"\r\n}" headers: cache-control: - no-cache @@ -7067,7 +6258,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:30:53 GMT + - Thu, 17 Sep 2020 03:18:25 GMT expires: - '-1' pragma: @@ -7084,7 +6275,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14980,Microsoft.Compute/GetOperation30Min;29838 + - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29839 status: code: 200 message: OK @@ -7097,30 +6288,22 @@ interactions: - gzip, deflate Connection: - keep-alive - Content-Length: - - '0' - Content-Type: - - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3/redeploy?api-version=2019-12-01 + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c0be767a-ea5f-4cd0-8fc3-94befcdbea00?monitor=true&api-version=2020-06-01 response: body: string: '' headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/24d6178e-cfa3-4c9b-8978-3108f4713638?api-version=2019-12-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 18 May 2020 21:30:53 GMT + - Thu, 17 Sep 2020 03:18:25 GMT expires: - '-1' - location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/24d6178e-cfa3-4c9b-8978-3108f4713638?monitor=true&api-version=2019-12-01 pragma: - no-cache server: @@ -7131,14 +6314,10 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/VMScaleSetActions3Min;234,Microsoft.Compute/VMScaleSetActions30Min;1194,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;2895,Microsoft.Compute/VmssQueuedVMOperations;4798 - x-ms-ratelimit-remaining-subscription-writes: - - '1194' - x-ms-request-charge: - - '2' + - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29838 status: - code: 202 - message: Accepted + code: 200 + message: OK - request: body: null headers: @@ -7148,26 +6327,30 @@ interactions: - gzip, deflate Connection: - keep-alive + Content-Length: + - '0' + Content-Type: + - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/24d6178e-cfa3-4c9b-8978-3108f4713638?api-version=2019-12-01 + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3/poweroff?skipShutdown=false&api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:30:53.7228095+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"24d6178e-cfa3-4c9b-8978-3108f4713638\"\ - \r\n}" + string: '' headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/5fa9f031-be8b-46cf-8243-79215366d816?api-version=2020-06-01 cache-control: - no-cache content-length: - - '134' - content-type: - - application/json; charset=utf-8 + - '0' date: - - Mon, 18 May 2020 21:31:23 GMT + - Thu, 17 Sep 2020 03:18:26 GMT expires: - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/5fa9f031-be8b-46cf-8243-79215366d816?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -7175,17 +6358,17 @@ interactions: - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29835 + - Microsoft.Compute/DeleteVMScaleSet3Min;78,Microsoft.Compute/DeleteVMScaleSet30Min;398,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;1192,Microsoft.Compute/VmssQueuedVMOperations;4798 + x-ms-ratelimit-remaining-subscription-writes: + - '1195' + x-ms-request-charge: + - '2' status: - code: 200 - message: OK + code: 202 + message: Accepted - request: body: null headers: @@ -7196,14 +6379,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/24d6178e-cfa3-4c9b-8978-3108f4713638?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/5fa9f031-be8b-46cf-8243-79215366d816?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:30:53.7228095+00:00\",\r\n \"\ - endTime\": \"2020-05-18T21:31:41.2074296+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"24d6178e-cfa3-4c9b-8978-3108f4713638\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-17T03:18:26.9566482+00:00\",\r\n \"\ + endTime\": \"2020-09-17T03:18:34.7847908+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"5fa9f031-be8b-46cf-8243-79215366d816\"\r\n}" headers: cache-control: - no-cache @@ -7212,7 +6395,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:31:54 GMT + - Thu, 17 Sep 2020 03:18:57 GMT expires: - '-1' pragma: @@ -7229,7 +6412,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29831 + - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29836 status: code: 200 message: OK @@ -7243,9 +6426,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/24d6178e-cfa3-4c9b-8978-3108f4713638?monitor=true&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/5fa9f031-be8b-46cf-8243-79215366d816?monitor=true&api-version=2020-06-01 response: body: string: '' @@ -7255,7 +6438,7 @@ interactions: content-length: - '0' date: - - Mon, 18 May 2020 21:31:54 GMT + - Thu, 17 Sep 2020 03:18:57 GMT expires: - '-1' pragma: @@ -7268,43 +6451,46 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14980,Microsoft.Compute/GetOperation30Min;29830 + - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29835 status: code: 200 message: OK - request: - body: null + body: '{"properties": {"autoUpgradeMinorVersion": true}}' headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate Connection: - keep-alive Content-Length: - - '0' + - '49' Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3/deallocate?api-version=2019-12-01 + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3/extensions/vmssextensionx80f0ea3?api-version=2020-06-01 response: body: - string: '' + string: "{\r\n \"name\": \"vmssextensionx80f0ea3\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3/extensions/vmssextensionx80f0ea3\"\ + ,\r\n \"type\": \"Microsoft.Compute/virtualMachineScaleSets/extensions\"\ + ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n\ + \ \"autoUpgradeMinorVersion\": true\r\n }\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/85c22788-ed46-4435-9bf0-5a873473dadf?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/8392b474-ac89-4f26-add4-7ace474cefe6?api-version=2020-06-01 cache-control: - no-cache content-length: - - '0' + - '477' + content-type: + - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:31:54 GMT + - Thu, 17 Sep 2020 03:18:58 GMT expires: - '-1' - location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/85c22788-ed46-4435-9bf0-5a873473dadf?monitor=true&api-version=2019-12-01 pragma: - no-cache server: @@ -7315,14 +6501,14 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/DeleteVMScaleSet3Min;78,Microsoft.Compute/DeleteVMScaleSet30Min;397,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;2893,Microsoft.Compute/VmssQueuedVMOperations;4798 + - Microsoft.Compute/VMScaleSetActions3Min;236,Microsoft.Compute/VMScaleSetActions30Min;1196,Microsoft.Compute/VmssQueuedVMOperations;4800 x-ms-ratelimit-remaining-subscription-writes: - - '1193' + - '1196' x-ms-request-charge: - - '2' + - '0' status: - code: 202 - message: Accepted + code: 201 + message: Created - request: body: null headers: @@ -7333,23 +6519,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/85c22788-ed46-4435-9bf0-5a873473dadf?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/8392b474-ac89-4f26-add4-7ace474cefe6?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:31:54.8168645+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"85c22788-ed46-4435-9bf0-5a873473dadf\"\ - \r\n}" + string: "{\r\n \"startTime\": \"2020-09-17T03:18:58.3475569+00:00\",\r\n \"\ + endTime\": \"2020-09-17T03:18:58.4881911+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"8392b474-ac89-4f26-add4-7ace474cefe6\"\r\n}" headers: cache-control: - no-cache content-length: - - '134' + - '184' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:32:24 GMT + - Thu, 17 Sep 2020 03:19:08 GMT expires: - '-1' pragma: @@ -7366,7 +6552,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14980,Microsoft.Compute/GetOperation30Min;29827 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29834 status: code: 200 message: OK @@ -7380,23 +6566,26 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/85c22788-ed46-4435-9bf0-5a873473dadf?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3/extensions/vmssextensionx80f0ea3?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:31:54.8168645+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"85c22788-ed46-4435-9bf0-5a873473dadf\"\ - \r\n}" + string: "{\r\n \"name\": \"vmssextensionx80f0ea3\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3/extensions/vmssextensionx80f0ea3\"\ + ,\r\n \"type\": \"Microsoft.Compute/virtualMachineScaleSets/extensions\"\ + ,\r\n \"properties\": {\r\n \"provisioningState\": \"Creating\",\r\n \ + \ \"autoUpgradeMinorVersion\": true,\r\n \"publisher\": \"Microsoft.Azure.NetworkWatcher\"\ + ,\r\n \"type\": \"NetworkWatcherAgentWindows\",\r\n \"typeHandlerVersion\"\ + : \"1.4\"\r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '134' + - '605' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:32:54 GMT + - Thu, 17 Sep 2020 03:19:09 GMT expires: - '-1' pragma: @@ -7413,7 +6602,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14979,Microsoft.Compute/GetOperation30Min;29823 + - Microsoft.Compute/LowCostGet3Min;3999,Microsoft.Compute/LowCostGet30Min;31998 status: code: 200 message: OK @@ -7426,26 +6615,28 @@ interactions: - gzip, deflate Connection: - keep-alive + Content-Length: + - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/85c22788-ed46-4435-9bf0-5a873473dadf?api-version=2019-12-01 + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3/extensions/vmssextensionx80f0ea3?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:31:54.8168645+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"85c22788-ed46-4435-9bf0-5a873473dadf\"\ - \r\n}" + string: '' headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/09d20eb1-8fe0-4633-a5c3-1bc40074c635?api-version=2020-06-01 cache-control: - no-cache content-length: - - '134' - content-type: - - application/json; charset=utf-8 + - '0' date: - - Mon, 18 May 2020 21:33:25 GMT + - Thu, 17 Sep 2020 03:19:09 GMT expires: - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/09d20eb1-8fe0-4633-a5c3-1bc40074c635?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -7453,17 +6644,17 @@ interactions: - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14977,Microsoft.Compute/GetOperation30Min;29820 + - Microsoft.Compute/VMScaleSetActions3Min;235,Microsoft.Compute/VMScaleSetActions30Min;1195,Microsoft.Compute/VmssQueuedVMOperations;4800 + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + x-ms-request-charge: + - '0' status: - code: 200 - message: OK + code: 202 + message: Accepted - request: body: null headers: @@ -7474,23 +6665,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/85c22788-ed46-4435-9bf0-5a873473dadf?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/09d20eb1-8fe0-4633-a5c3-1bc40074c635?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:31:54.8168645+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"85c22788-ed46-4435-9bf0-5a873473dadf\"\ - \r\n}" + string: "{\r\n \"startTime\": \"2020-09-17T03:19:09.5508602+00:00\",\r\n \"\ + endTime\": \"2020-09-17T03:19:09.6914812+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"09d20eb1-8fe0-4633-a5c3-1bc40074c635\"\r\n}" headers: cache-control: - no-cache content-length: - - '134' + - '184' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:33:55 GMT + - Thu, 17 Sep 2020 03:19:19 GMT expires: - '-1' pragma: @@ -7507,7 +6698,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14980,Microsoft.Compute/GetOperation30Min;29817 + - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29833 status: code: 200 message: OK @@ -7520,26 +6711,30 @@ interactions: - gzip, deflate Connection: - keep-alive + Content-Length: + - '0' + Content-Type: + - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/85c22788-ed46-4435-9bf0-5a873473dadf?api-version=2019-12-01 + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3/redeploy?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:31:54.8168645+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"85c22788-ed46-4435-9bf0-5a873473dadf\"\ - \r\n}" + string: '' headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/72445b4e-9526-42c2-9622-90c23f3218c8?api-version=2020-06-01 cache-control: - no-cache content-length: - - '134' - content-type: - - application/json; charset=utf-8 + - '0' date: - - Mon, 18 May 2020 21:34:25 GMT + - Thu, 17 Sep 2020 03:19:20 GMT expires: - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/72445b4e-9526-42c2-9622-90c23f3218c8?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -7547,17 +6742,17 @@ interactions: - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14980,Microsoft.Compute/GetOperation30Min;29814 + - Microsoft.Compute/VMScaleSetActions3Min;234,Microsoft.Compute/VMScaleSetActions30Min;1194,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;1190,Microsoft.Compute/VmssQueuedVMOperations;4798 + x-ms-ratelimit-remaining-subscription-writes: + - '1194' + x-ms-request-charge: + - '2' status: - code: 200 - message: OK + code: 202 + message: Accepted - request: body: null headers: @@ -7568,13 +6763,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/85c22788-ed46-4435-9bf0-5a873473dadf?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/72445b4e-9526-42c2-9622-90c23f3218c8?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:31:54.8168645+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"85c22788-ed46-4435-9bf0-5a873473dadf\"\ + string: "{\r\n \"startTime\": \"2020-09-17T03:19:20.3946804+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"72445b4e-9526-42c2-9622-90c23f3218c8\"\ \r\n}" headers: cache-control: @@ -7584,7 +6779,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:34:55 GMT + - Thu, 17 Sep 2020 03:19:50 GMT expires: - '-1' pragma: @@ -7601,7 +6796,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29812 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29830 status: code: 200 message: OK @@ -7615,23 +6810,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/85c22788-ed46-4435-9bf0-5a873473dadf?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/72445b4e-9526-42c2-9622-90c23f3218c8?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:31:54.8168645+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"85c22788-ed46-4435-9bf0-5a873473dadf\"\ - \r\n}" + string: "{\r\n \"startTime\": \"2020-09-17T03:19:20.3946804+00:00\",\r\n \"\ + endTime\": \"2020-09-17T03:20:07.8480195+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"72445b4e-9526-42c2-9622-90c23f3218c8\"\r\n}" headers: cache-control: - no-cache content-length: - - '134' + - '184' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:35:25 GMT + - Thu, 17 Sep 2020 03:20:20 GMT expires: - '-1' pragma: @@ -7648,7 +6843,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29841 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29855 status: code: 200 message: OK @@ -7662,23 +6857,19 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/85c22788-ed46-4435-9bf0-5a873473dadf?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/72445b4e-9526-42c2-9622-90c23f3218c8?monitor=true&api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:31:54.8168645+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"85c22788-ed46-4435-9bf0-5a873473dadf\"\ - \r\n}" + string: '' headers: cache-control: - no-cache content-length: - - '134' - content-type: - - application/json; charset=utf-8 + - '0' date: - - Mon, 18 May 2020 21:35:55 GMT + - Thu, 17 Sep 2020 03:20:20 GMT expires: - '-1' pragma: @@ -7688,14 +6879,10 @@ interactions: - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29838 + - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29854 status: code: 200 message: OK @@ -7708,26 +6895,30 @@ interactions: - gzip, deflate Connection: - keep-alive + Content-Length: + - '0' + Content-Type: + - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/85c22788-ed46-4435-9bf0-5a873473dadf?api-version=2019-12-01 + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3/deallocate?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:31:54.8168645+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"85c22788-ed46-4435-9bf0-5a873473dadf\"\ - \r\n}" + string: '' headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c19c3305-5fae-487e-82ab-f2d7cb4a9f5e?api-version=2020-06-01 cache-control: - no-cache content-length: - - '134' - content-type: - - application/json; charset=utf-8 + - '0' date: - - Mon, 18 May 2020 21:36:26 GMT + - Thu, 17 Sep 2020 03:20:21 GMT expires: - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c19c3305-5fae-487e-82ab-f2d7cb4a9f5e?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -7735,17 +6926,17 @@ interactions: - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29835 + - Microsoft.Compute/DeleteVMScaleSet3Min;78,Microsoft.Compute/DeleteVMScaleSet30Min;397,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;1188,Microsoft.Compute/VmssQueuedVMOperations;4798 + x-ms-ratelimit-remaining-subscription-writes: + - '1193' + x-ms-request-charge: + - '2' status: - code: 200 - message: OK + code: 202 + message: Accepted - request: body: null headers: @@ -7756,14 +6947,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/85c22788-ed46-4435-9bf0-5a873473dadf?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c19c3305-5fae-487e-82ab-f2d7cb4a9f5e?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:31:54.8168645+00:00\",\r\n \"\ - endTime\": \"2020-05-18T21:36:26.7560624+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"85c22788-ed46-4435-9bf0-5a873473dadf\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-17T03:20:21.8948788+00:00\",\r\n \"\ + endTime\": \"2020-09-17T03:20:51.8014354+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"c19c3305-5fae-487e-82ab-f2d7cb4a9f5e\"\r\n}" headers: cache-control: - no-cache @@ -7772,7 +6963,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:36:56 GMT + - Thu, 17 Sep 2020 03:20:52 GMT expires: - '-1' pragma: @@ -7789,7 +6980,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29833 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29852 status: code: 200 message: OK @@ -7803,9 +6994,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/85c22788-ed46-4435-9bf0-5a873473dadf?monitor=true&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c19c3305-5fae-487e-82ab-f2d7cb4a9f5e?monitor=true&api-version=2020-06-01 response: body: string: '' @@ -7815,7 +7006,7 @@ interactions: content-length: - '0' date: - - Mon, 18 May 2020 21:36:56 GMT + - Thu, 17 Sep 2020 03:20:52 GMT expires: - '-1' pragma: @@ -7828,7 +7019,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29832 + - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29851 status: code: 200 message: OK @@ -7844,9 +7035,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset80f0ea3?api-version=2020-06-01 response: body: string: '' @@ -7854,17 +7045,17 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d2279285-dbfa-4892-95ed-0886131d401b?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b748e2b6-67d7-4728-8b7a-028d6c900acf?api-version=2020-06-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 18 May 2020 21:36:57 GMT + - Thu, 17 Sep 2020 03:20:53 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d2279285-dbfa-4892-95ed-0886131d401b?monitor=true&api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b748e2b6-67d7-4728-8b7a-028d6c900acf?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -7875,7 +7066,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/DeleteVMScaleSet3Min;79,Microsoft.Compute/DeleteVMScaleSet30Min;396,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;2903,Microsoft.Compute/VmssQueuedVMOperations;4798 + - Microsoft.Compute/DeleteVMScaleSet3Min;77,Microsoft.Compute/DeleteVMScaleSet30Min;396,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;1186,Microsoft.Compute/VmssQueuedVMOperations;4798 x-ms-ratelimit-remaining-subscription-deletes: - '14998' x-ms-request-charge: @@ -7893,23 +7084,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d2279285-dbfa-4892-95ed-0886131d401b?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b748e2b6-67d7-4728-8b7a-028d6c900acf?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:36:58.0531213+00:00\",\r\n \"\ - endTime\": \"2020-05-18T21:36:59.0218984+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"d2279285-dbfa-4892-95ed-0886131d401b\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-17T03:20:53.285858+00:00\",\r\n \"\ + endTime\": \"2020-09-17T03:20:54.3796003+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"b748e2b6-67d7-4728-8b7a-028d6c900acf\"\r\n}" headers: cache-control: - no-cache content-length: - - '184' + - '183' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:37:08 GMT + - Thu, 17 Sep 2020 03:21:03 GMT expires: - '-1' pragma: @@ -7926,7 +7117,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29830 + - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29848 status: code: 200 message: OK diff --git a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vmss.test_compute_vmss_base_2.yaml b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vmss.test_compute_vmss_base_2.yaml index 2042ba2b171e..b069d8b1b9cd 100644 --- a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vmss.test_compute_vmss_base_2.yaml +++ b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vmss.test_compute_vmss_base_2.yaml @@ -12,21 +12,18 @@ interactions: Content-Length: - '92' Content-Type: - - application/json; charset=utf-8 + - application/json User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexd7d31356?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexd7d31356?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"networknamexd7d31356\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexd7d31356\"\ - ,\r\n \"etag\": \"W/\\\"f0d43626-d41b-466d-a04d-19214be5d106\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"04fd2f3d-d892-4aa2-8004-eadbb0850631\\\"\",\r\n \ \ \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \ - \ \"resourceGuid\": \"869f4cca-6e18-4884-b7c6-4f6de71ec39d\",\r\n \"\ + \ \"resourceGuid\": \"f1ee3692-f35b-4c7f-a7ce-9b4acf19689f\",\r\n \"\ addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\ \r\n ]\r\n },\r\n \"subnets\": [],\r\n \"virtualNetworkPeerings\"\ : [],\r\n \"enableDdosProtection\": false,\r\n \"enableVmProtection\"\ @@ -35,15 +32,15 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/964b5ce3-931b-4c5b-ab4e-4fe6d3b47ab5?api-version=2020-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/0b2b9d69-3010-4fad-84b7-fc1c9406e6f7?api-version=2020-06-01 cache-control: - no-cache content-length: - - '707' + - '727' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:37:20 GMT + - Wed, 16 Sep 2020 09:10:29 GMT expires: - '-1' pragma: @@ -56,7 +53,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 3c872c60-5785-4c92-9fa7-5a66ea9082f4 + - 10402622-f957-49ab-a39d-d79b006fae8c x-ms-ratelimit-remaining-subscription-writes: - '1199' status: @@ -66,108 +63,15 @@ interactions: body: null headers: Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/964b5ce3-931b-4c5b-ab4e-4fe6d3b47ab5?api-version=2020-04-01 - response: - body: - string: "{\r\n \"status\": \"InProgress\"\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '30' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 18 May 2020 21:37:23 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-arm-service-request-id: - - cda570ea-363c-4e4c-b730-b14252a594bf - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/964b5ce3-931b-4c5b-ab4e-4fe6d3b47ab5?api-version=2020-04-01 - response: - body: - string: "{\r\n \"status\": \"InProgress\"\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '30' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 18 May 2020 21:37:33 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-arm-service-request-id: - - 85764638-aefe-4e49-b42e-61361496fe59 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/964b5ce3-931b-4c5b-ab4e-4fe6d3b47ab5?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/0b2b9d69-3010-4fad-84b7-fc1c9406e6f7?api-version=2020-06-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -179,7 +83,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:37:43 GMT + - Wed, 16 Sep 2020 09:10:34 GMT expires: - '-1' pragma: @@ -196,7 +100,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - fcb5a434-3b9b-4aae-b797-3140e95f5ddd + - a4df218f-c26c-4762-9c31-788a92f6025f status: code: 200 message: OK @@ -204,23 +108,22 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexd7d31356?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexd7d31356?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"networknamexd7d31356\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexd7d31356\"\ - ,\r\n \"etag\": \"W/\\\"2c14da7a-ea33-400a-a28a-a73af98f8719\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"10b7350d-8d1f-4ff9-99be-6ca98bb9f4d6\\\"\",\r\n \ \ \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n\ - \ \"resourceGuid\": \"869f4cca-6e18-4884-b7c6-4f6de71ec39d\",\r\n \"\ + \ \"resourceGuid\": \"f1ee3692-f35b-4c7f-a7ce-9b4acf19689f\",\r\n \"\ addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\ \r\n ]\r\n },\r\n \"subnets\": [],\r\n \"virtualNetworkPeerings\"\ : [],\r\n \"enableDdosProtection\": false,\r\n \"enableVmProtection\"\ @@ -229,13 +132,13 @@ interactions: cache-control: - no-cache content-length: - - '708' + - '728' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:37:44 GMT + - Wed, 16 Sep 2020 09:10:35 GMT etag: - - W/"2c14da7a-ea33-400a-a28a-a73af98f8719" + - W/"10b7350d-8d1f-4ff9-99be-6ca98bb9f4d6" expires: - '-1' pragma: @@ -252,7 +155,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - e54f209a-326e-44f5-8879-3b367d8df7ea + - e16fcd02-2cbc-48bb-b953-4a18c3f7b913 status: code: 200 message: OK @@ -268,33 +171,30 @@ interactions: Content-Length: - '48' Content-Type: - - application/json; charset=utf-8 + - application/json User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexd7d31356/subnets/subnetnamexd7d31356?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexd7d31356/subnets/subnetnamexd7d31356?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"subnetnamexd7d31356\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexd7d31356/subnets/subnetnamexd7d31356\"\ - ,\r\n \"etag\": \"W/\\\"c9343c96-8486-4d6c-84eb-7054fa2f3afb\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"2d4b71a4-e456-4df3-83b1-c1a61620b321\\\"\",\r\n \ \ \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"\ addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\"\ : \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\ \n },\r\n \"type\": \"Microsoft.Network/virtualNetworks/subnets\"\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/169612e1-9d51-4c45-93f1-b075ff80c173?api-version=2020-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/c4d6f314-c3af-41a0-a3ac-e402907aa3bf?api-version=2020-06-01 cache-control: - no-cache content-length: - - '604' + - '624' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:37:45 GMT + - Wed, 16 Sep 2020 09:10:36 GMT expires: - '-1' pragma: @@ -307,7 +207,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 7e1832b1-7c7a-477b-b08e-fe9748cd492a + - 70d19777-a0b9-48e6-947f-ac32b5680cbf x-ms-ratelimit-remaining-subscription-writes: - '1198' status: @@ -317,16 +217,15 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/169612e1-9d51-4c45-93f1-b075ff80c173?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/c4d6f314-c3af-41a0-a3ac-e402907aa3bf?api-version=2020-06-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -338,7 +237,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:37:49 GMT + - Wed, 16 Sep 2020 09:10:40 GMT expires: - '-1' pragma: @@ -355,7 +254,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - aaff5a88-2950-44fd-af18-efe5506488dd + - 51279793-b1ec-45c8-908e-96f4b4d379d2 status: code: 200 message: OK @@ -363,20 +262,19 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexd7d31356/subnets/subnetnamexd7d31356?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexd7d31356/subnets/subnetnamexd7d31356?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"subnetnamexd7d31356\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexd7d31356/subnets/subnetnamexd7d31356\"\ - ,\r\n \"etag\": \"W/\\\"6b0cca5a-1021-4dde-8202-e95bf8e04d2c\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"e99b21b1-49e0-4d44-95dd-8da756f81240\\\"\",\r\n \ \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"\ addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\"\ : \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\ @@ -385,13 +283,13 @@ interactions: cache-control: - no-cache content-length: - - '605' + - '625' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:37:49 GMT + - Wed, 16 Sep 2020 09:10:40 GMT etag: - - W/"6b0cca5a-1021-4dde-8202-e95bf8e04d2c" + - W/"e99b21b1-49e0-4d44-95dd-8da756f81240" expires: - '-1' pragma: @@ -408,7 +306,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 60b4b47c-bcc4-4c32-8799-e06385ace582 + - 1dbe6e91-9236-4407-8e85-d3bcbcd79525 status: code: 200 message: OK @@ -425,20 +323,17 @@ interactions: Content-Length: - '167' Content-Type: - - application/json; charset=utf-8 + - application/json User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/publicIPAddresses/public_ip_address_name?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/publicIPAddresses/public_ip_address_name?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"public_ip_address_name\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/publicIPAddresses/public_ip_address_name\"\ - ,\r\n \"etag\": \"W/\\\"d8ff2b7a-4b26-42cf-b3b0-d9757e40b814\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"8a36e587-6330-481c-9e93-ec03093bcf27\\\"\",\r\n \ \ \"location\": \"eastus\",\r\n \"properties\": {\r\n \"provisioningState\"\ - : \"Updating\",\r\n \"resourceGuid\": \"d2f4d8e3-7490-4b82-bde7-deb715f81f22\"\ + : \"Updating\",\r\n \"resourceGuid\": \"3d975671-b8aa-4b8d-aa6d-c1340fa786d0\"\ ,\r\n \"publicIPAddressVersion\": \"IPv4\",\r\n \"publicIPAllocationMethod\"\ : \"Static\",\r\n \"idleTimeoutInMinutes\": 10,\r\n \"ipTags\": []\r\ \n },\r\n \"type\": \"Microsoft.Network/publicIPAddresses\",\r\n \"sku\"\ @@ -447,15 +342,15 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/edae8e1d-0d5a-42c3-a3d5-73d0febf6b85?api-version=2020-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/d975f3e1-66bf-423a-97fa-2e9b63f3f889?api-version=2020-06-01 cache-control: - no-cache content-length: - - '675' + - '695' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:37:51 GMT + - Wed, 16 Sep 2020 09:10:44 GMT expires: - '-1' pragma: @@ -468,7 +363,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 81bccb38-dae0-439c-a363-33f4e1ca3376 + - bfaf7ff7-fdf3-402d-ac33-77586de6529d x-ms-ratelimit-remaining-subscription-writes: - '1197' status: @@ -478,16 +373,15 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/edae8e1d-0d5a-42c3-a3d5-73d0febf6b85?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/d975f3e1-66bf-423a-97fa-2e9b63f3f889?api-version=2020-06-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -499,7 +393,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:37:53 GMT + - Wed, 16 Sep 2020 09:10:45 GMT expires: - '-1' pragma: @@ -516,7 +410,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 839d5198-7f8e-470d-adfd-5133436ccf99 + - aa6c0e3b-aa30-4ab7-a343-3918a3200b93 status: code: 200 message: OK @@ -524,23 +418,22 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/publicIPAddresses/public_ip_address_name?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/publicIPAddresses/public_ip_address_name?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"public_ip_address_name\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/publicIPAddresses/public_ip_address_name\"\ - ,\r\n \"etag\": \"W/\\\"06b97ae2-cd33-489b-82c1-466029c8436e\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"03c6cf1d-1ae8-4825-bc45-683f66a8076f\\\"\",\r\n \ \ \"location\": \"eastus\",\r\n \"properties\": {\r\n \"provisioningState\"\ - : \"Succeeded\",\r\n \"resourceGuid\": \"d2f4d8e3-7490-4b82-bde7-deb715f81f22\"\ - ,\r\n \"ipAddress\": \"52.188.223.51\",\r\n \"publicIPAddressVersion\"\ + : \"Succeeded\",\r\n \"resourceGuid\": \"3d975671-b8aa-4b8d-aa6d-c1340fa786d0\"\ + ,\r\n \"ipAddress\": \"52.226.46.163\",\r\n \"publicIPAddressVersion\"\ : \"IPv4\",\r\n \"publicIPAllocationMethod\": \"Static\",\r\n \"idleTimeoutInMinutes\"\ : 10,\r\n \"ipTags\": []\r\n },\r\n \"type\": \"Microsoft.Network/publicIPAddresses\"\ ,\r\n \"sku\": {\r\n \"name\": \"Standard\"\r\n }\r\n}" @@ -548,13 +441,13 @@ interactions: cache-control: - no-cache content-length: - - '711' + - '731' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:37:53 GMT + - Wed, 16 Sep 2020 09:10:45 GMT etag: - - W/"06b97ae2-cd33-489b-82c1-466029c8436e" + - W/"03c6cf1d-1ae8-4825-bc45-683f66a8076f" expires: - '-1' pragma: @@ -571,25 +464,27 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - f1e18dfd-a58b-4c56-a820-084b216de244 + - 6cb8dee0-7602-47a2-a92b-a57d7d12abc9 status: code: 200 message: OK - request: - body: 'b''{"location": "eastus", "sku": {"name": "Standard"}, "properties": {"frontendIPConfigurations": - [{"properties": {"publicIPAddress": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/publicIPAddresses/public_ip_address_name"}}, - "name": "myFrontendIpconfiguration"}], "backendAddressPools": [{"name": "myBackendAddressPool"}], - "loadBalancingRules": [{"properties": {"frontendIPConfiguration": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/loadBalancers/myLoadBalancer/frontendIPConfigurations/myFrontendIpconfiguration"}, + body: 'b''b\''{"location": "eastus", "sku": {"name": "Standard"}, "properties": + {"frontendIPConfigurations": [{"name": "myFrontendIpconfiguration", "properties": + {"publicIPAddress": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/publicIPAddresses/public_ip_address_name"}}}], + "backendAddressPools": [{"name": "myBackendAddressPool"}], "loadBalancingRules": + [{"name": "myLoadBalancingRule", "properties": {"frontendIPConfiguration": {"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/loadBalancers/myLoadBalancer/frontendIPConfigurations/myFrontendIpconfiguration"}, "backendAddressPool": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/loadBalancers/myLoadBalancer/backendAddressPools/myBackendAddressPool"}, "probe": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/loadBalancers/myLoadBalancer/probes/myProbe"}, "protocol": "Tcp", "loadDistribution": "Default", "frontendPort": 80, "backendPort": 80, "idleTimeoutInMinutes": 15, "enableFloatingIP": true, "disableOutboundSnat": - true}, "name": "myLoadBalancingRule"}], "probes": [{"properties": {"protocol": - "Http", "port": 80, "intervalInSeconds": 15, "numberOfProbes": 2, "requestPath": - "healthcheck.aspx"}, "name": "myProbe"}], "outboundRules": [{"properties": {"frontendIPConfigurations": + true}}], "probes": [{"name": "myProbe", "properties": {"protocol": "Http", "port": + 80, "intervalInSeconds": 15, "numberOfProbes": 2, "requestPath": "healthcheck.aspx"}}], + "outboundRules": [{"name": "myOutboundRule", "properties": {"frontendIPConfigurations": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/loadBalancers/myLoadBalancer/frontendIPConfigurations/myFrontendIpconfiguration"}], "backendAddressPool": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/loadBalancers/myLoadBalancer/backendAddressPools/myBackendAddressPool"}, - "protocol": "All"}, "name": "myOutboundRule"}]}}''' + "protocol": "All"}}]}}\''''' headers: Accept: - application/json @@ -598,26 +493,23 @@ interactions: Connection: - keep-alive Content-Length: - - '2186' + - '2306' Content-Type: - - application/json; charset=utf-8 + - application/json User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/loadBalancers/myLoadBalancer?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/loadBalancers/myLoadBalancer?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"myLoadBalancer\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/loadBalancers/myLoadBalancer\"\ - ,\r\n \"etag\": \"W/\\\"dd3f7f70-3d5b-479d-b2e4-ae79251790cf\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"736fd08e-8c3d-4f0c-9b53-26b3c5a3749f\\\"\",\r\n \ \ \"type\": \"Microsoft.Network/loadBalancers\",\r\n \"location\": \"eastus\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n\ - \ \"resourceGuid\": \"931e3461-8af3-4e5a-b751-b983bb1b43a4\",\r\n \"\ + \ \"resourceGuid\": \"b6a7b780-0a77-4af6-86f8-a738167c1b27\",\r\n \"\ frontendIPConfigurations\": [\r\n {\r\n \"name\": \"myFrontendIpconfiguration\"\ ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/loadBalancers/myLoadBalancer/frontendIPConfigurations/myFrontendIpconfiguration\"\ - ,\r\n \"etag\": \"W/\\\"dd3f7f70-3d5b-479d-b2e4-ae79251790cf\\\"\"\ + ,\r\n \"etag\": \"W/\\\"736fd08e-8c3d-4f0c-9b53-26b3c5a3749f\\\"\"\ ,\r\n \"type\": \"Microsoft.Network/loadBalancers/frontendIPConfigurations\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\ ,\r\n \"privateIPAllocationMethod\": \"Dynamic\",\r\n \"\ @@ -630,7 +522,7 @@ interactions: : \"IPv4\"\r\n }\r\n }\r\n ],\r\n \"backendAddressPools\"\ : [\r\n {\r\n \"name\": \"myBackendAddressPool\",\r\n \"\ id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/loadBalancers/myLoadBalancer/backendAddressPools/myBackendAddressPool\"\ - ,\r\n \"etag\": \"W/\\\"dd3f7f70-3d5b-479d-b2e4-ae79251790cf\\\"\"\ + ,\r\n \"etag\": \"W/\\\"736fd08e-8c3d-4f0c-9b53-26b3c5a3749f\\\"\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\ ,\r\n \"loadBalancerBackendAddresses\": [],\r\n \"outboundRules\"\ : [\r\n {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/loadBalancers/myLoadBalancer/outboundRules/myOutboundRule\"\ @@ -639,7 +531,7 @@ interactions: \r\n }\r\n ]\r\n },\r\n \"type\": \"Microsoft.Network/loadBalancers/backendAddressPools\"\ \r\n }\r\n ],\r\n \"loadBalancingRules\": [\r\n {\r\n \ \ \"name\": \"myLoadBalancingRule\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/loadBalancers/myLoadBalancer/loadBalancingRules/myLoadBalancingRule\"\ - ,\r\n \"etag\": \"W/\\\"dd3f7f70-3d5b-479d-b2e4-ae79251790cf\\\"\"\ + ,\r\n \"etag\": \"W/\\\"736fd08e-8c3d-4f0c-9b53-26b3c5a3749f\\\"\"\ ,\r\n \"type\": \"Microsoft.Network/loadBalancers/loadBalancingRules\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\ ,\r\n \"frontendIPConfiguration\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/loadBalancers/myLoadBalancer/frontendIPConfigurations/myFrontendIpconfiguration\"\ @@ -652,7 +544,7 @@ interactions: \r\n },\r\n \"probe\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/loadBalancers/myLoadBalancer/probes/myProbe\"\ \r\n }\r\n }\r\n }\r\n ],\r\n \"probes\": [\r\n\ \ {\r\n \"name\": \"myProbe\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/loadBalancers/myLoadBalancer/probes/myProbe\"\ - ,\r\n \"etag\": \"W/\\\"dd3f7f70-3d5b-479d-b2e4-ae79251790cf\\\"\"\ + ,\r\n \"etag\": \"W/\\\"736fd08e-8c3d-4f0c-9b53-26b3c5a3749f\\\"\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\ ,\r\n \"protocol\": \"Http\",\r\n \"port\": 80,\r\n \ \ \"requestPath\": \"healthcheck.aspx\",\r\n \"intervalInSeconds\"\ @@ -662,7 +554,7 @@ interactions: \r\n }\r\n ],\r\n \"inboundNatRules\": [],\r\n \"outboundRules\"\ : [\r\n {\r\n \"name\": \"myOutboundRule\",\r\n \"id\"\ : \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/loadBalancers/myLoadBalancer/outboundRules/myOutboundRule\"\ - ,\r\n \"etag\": \"W/\\\"dd3f7f70-3d5b-479d-b2e4-ae79251790cf\\\"\"\ + ,\r\n \"etag\": \"W/\\\"736fd08e-8c3d-4f0c-9b53-26b3c5a3749f\\\"\"\ ,\r\n \"type\": \"Microsoft.Network/loadBalancers/outboundRules\",\r\ \n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\ ,\r\n \"allocatedOutboundPorts\": 1024,\r\n \"protocol\"\ @@ -677,15 +569,15 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/45b8e945-2ee6-4ed9-b5c0-a58148dd058b?api-version=2020-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/71448158-ffb8-4cb9-931a-655ee8758589?api-version=2020-06-01 cache-control: - no-cache content-length: - - '7411' + - '7751' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:37:54 GMT + - Wed, 16 Sep 2020 09:10:49 GMT expires: - '-1' pragma: @@ -698,7 +590,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 2ecffb8a-1e17-4da7-ba81-a6de3ff82892 + - b32cbb19-0226-4202-9bd7-a2c3dcf6dd82 x-ms-ratelimit-remaining-subscription-writes: - '1196' status: @@ -708,16 +600,15 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/45b8e945-2ee6-4ed9-b5c0-a58148dd058b?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/71448158-ffb8-4cb9-931a-655ee8758589?api-version=2020-06-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -729,7 +620,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:38:25 GMT + - Wed, 16 Sep 2020 09:11:19 GMT expires: - '-1' pragma: @@ -746,7 +637,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - e2e7a1cf-8102-4742-aad0-b5d324f25ec2 + - 47d54c60-4832-4d12-b947-2c9b94d59efa status: code: 200 message: OK @@ -754,26 +645,25 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/loadBalancers/myLoadBalancer?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/loadBalancers/myLoadBalancer?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"myLoadBalancer\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/loadBalancers/myLoadBalancer\"\ - ,\r\n \"etag\": \"W/\\\"dd3f7f70-3d5b-479d-b2e4-ae79251790cf\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"736fd08e-8c3d-4f0c-9b53-26b3c5a3749f\\\"\",\r\n \ \ \"type\": \"Microsoft.Network/loadBalancers\",\r\n \"location\": \"eastus\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n\ - \ \"resourceGuid\": \"931e3461-8af3-4e5a-b751-b983bb1b43a4\",\r\n \"\ + \ \"resourceGuid\": \"b6a7b780-0a77-4af6-86f8-a738167c1b27\",\r\n \"\ frontendIPConfigurations\": [\r\n {\r\n \"name\": \"myFrontendIpconfiguration\"\ ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/loadBalancers/myLoadBalancer/frontendIPConfigurations/myFrontendIpconfiguration\"\ - ,\r\n \"etag\": \"W/\\\"dd3f7f70-3d5b-479d-b2e4-ae79251790cf\\\"\"\ + ,\r\n \"etag\": \"W/\\\"736fd08e-8c3d-4f0c-9b53-26b3c5a3749f\\\"\"\ ,\r\n \"type\": \"Microsoft.Network/loadBalancers/frontendIPConfigurations\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\ ,\r\n \"privateIPAllocationMethod\": \"Dynamic\",\r\n \"\ @@ -786,7 +676,7 @@ interactions: : \"IPv4\"\r\n }\r\n }\r\n ],\r\n \"backendAddressPools\"\ : [\r\n {\r\n \"name\": \"myBackendAddressPool\",\r\n \"\ id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/loadBalancers/myLoadBalancer/backendAddressPools/myBackendAddressPool\"\ - ,\r\n \"etag\": \"W/\\\"dd3f7f70-3d5b-479d-b2e4-ae79251790cf\\\"\"\ + ,\r\n \"etag\": \"W/\\\"736fd08e-8c3d-4f0c-9b53-26b3c5a3749f\\\"\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\ ,\r\n \"loadBalancerBackendAddresses\": [],\r\n \"outboundRules\"\ : [\r\n {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/loadBalancers/myLoadBalancer/outboundRules/myOutboundRule\"\ @@ -795,7 +685,7 @@ interactions: \r\n }\r\n ]\r\n },\r\n \"type\": \"Microsoft.Network/loadBalancers/backendAddressPools\"\ \r\n }\r\n ],\r\n \"loadBalancingRules\": [\r\n {\r\n \ \ \"name\": \"myLoadBalancingRule\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/loadBalancers/myLoadBalancer/loadBalancingRules/myLoadBalancingRule\"\ - ,\r\n \"etag\": \"W/\\\"dd3f7f70-3d5b-479d-b2e4-ae79251790cf\\\"\"\ + ,\r\n \"etag\": \"W/\\\"736fd08e-8c3d-4f0c-9b53-26b3c5a3749f\\\"\"\ ,\r\n \"type\": \"Microsoft.Network/loadBalancers/loadBalancingRules\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\ ,\r\n \"frontendIPConfiguration\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/loadBalancers/myLoadBalancer/frontendIPConfigurations/myFrontendIpconfiguration\"\ @@ -808,7 +698,7 @@ interactions: \r\n },\r\n \"probe\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/loadBalancers/myLoadBalancer/probes/myProbe\"\ \r\n }\r\n }\r\n }\r\n ],\r\n \"probes\": [\r\n\ \ {\r\n \"name\": \"myProbe\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/loadBalancers/myLoadBalancer/probes/myProbe\"\ - ,\r\n \"etag\": \"W/\\\"dd3f7f70-3d5b-479d-b2e4-ae79251790cf\\\"\"\ + ,\r\n \"etag\": \"W/\\\"736fd08e-8c3d-4f0c-9b53-26b3c5a3749f\\\"\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\ ,\r\n \"protocol\": \"Http\",\r\n \"port\": 80,\r\n \ \ \"requestPath\": \"healthcheck.aspx\",\r\n \"intervalInSeconds\"\ @@ -818,7 +708,7 @@ interactions: \r\n }\r\n ],\r\n \"inboundNatRules\": [],\r\n \"outboundRules\"\ : [\r\n {\r\n \"name\": \"myOutboundRule\",\r\n \"id\"\ : \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/loadBalancers/myLoadBalancer/outboundRules/myOutboundRule\"\ - ,\r\n \"etag\": \"W/\\\"dd3f7f70-3d5b-479d-b2e4-ae79251790cf\\\"\"\ + ,\r\n \"etag\": \"W/\\\"736fd08e-8c3d-4f0c-9b53-26b3c5a3749f\\\"\"\ ,\r\n \"type\": \"Microsoft.Network/loadBalancers/outboundRules\",\r\ \n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\ ,\r\n \"allocatedOutboundPorts\": 1024,\r\n \"protocol\"\ @@ -833,13 +723,13 @@ interactions: cache-control: - no-cache content-length: - - '7411' + - '7751' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:38:26 GMT + - Wed, 16 Sep 2020 09:11:19 GMT etag: - - W/"dd3f7f70-3d5b-479d-b2e4-ae79251790cf" + - W/"736fd08e-8c3d-4f0c-9b53-26b3c5a3749f" expires: - '-1' pragma: @@ -856,25 +746,25 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 1b3f6638-e8f7-47c5-80c2-920a2273b23a + - 54d58aae-6df1-45fa-a824-da64c2184147 status: code: 200 message: OK - request: - body: 'b''{"location": "eastus", "sku": {"name": "Standard_D1_v2", "tier": "Standard", - "capacity": 2}, "properties": {"upgradePolicy": {"mode": "Manual"}, "automaticRepairsPolicy": - {"enabled": true, "gracePeriod": "PT30M"}, "virtualMachineProfile": {"osProfile": - {"computerNamePrefix": "testPC", "adminUsername": "testuser", "adminPassword": - "Aa!1()-xyz"}, "storageProfile": {"imageReference": {"publisher": "Canonical", - "offer": "UbuntuServer", "sku": "18.04-LTS", "version": "latest"}, "osDisk": - {"caching": "ReadWrite", "createOption": "FromImage", "diskSizeGB": 512, "managedDisk": - {"storageAccountType": "Standard_LRS"}}}, "networkProfile": {"healthProbe": - {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/loadBalancers/myLoadBalancer/probes/myProbe"}, + body: 'b''b\''{"location": "eastus", "sku": {"name": "Standard_D1_v2", "tier": + "Standard", "capacity": 2}, "properties": {"upgradePolicy": {"mode": "Manual"}, + "automaticRepairsPolicy": {"enabled": true, "gracePeriod": "PT30M"}, "virtualMachineProfile": + {"osProfile": {"computerNamePrefix": "testPC", "adminUsername": "testuser", + "adminPassword": "Aa!1()-xyz"}, "storageProfile": {"imageReference": {"publisher": + "Canonical", "offer": "UbuntuServer", "sku": "18.04-LTS", "version": "latest"}, + "osDisk": {"caching": "ReadWrite", "createOption": "FromImage", "diskSizeGB": + 512, "managedDisk": {"storageAccountType": "Standard_LRS"}}}, "networkProfile": + {"healthProbe": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/loadBalancers/myLoadBalancer/probes/myProbe"}, "networkInterfaceConfigurations": [{"name": "testPC", "properties": {"primary": true, "ipConfigurations": [{"name": "testPC", "properties": {"subnet": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexd7d31356/subnets/subnetnamexd7d31356"}, "loadBalancerBackendAddressPools": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/loadBalancers/myLoadBalancer/backendAddressPools/myBackendAddressPool"}]}}]}}]}, - "extensionProfile": {}}, "overprovision": true}}''' + "extensionProfile": {}}, "overprovision": true}}\''''' headers: Accept: - application/json @@ -883,13 +773,13 @@ interactions: Connection: - keep-alive Content-Length: - - '1560' + - '1620' Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetd7d31356?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetd7d31356?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"virtualmachinescalesetd7d31356\",\r\n \"id\": \"\ @@ -921,22 +811,23 @@ interactions: }]}}]}}]},\r\n \"extensionProfile\": {\r\n \"extensions\": []\r\ \n }\r\n },\r\n \"provisioningState\": \"Creating\",\r\n \"\ overprovision\": true,\r\n \"doNotRunExtensionsOnOverprovisionedVMs\":\ - \ false,\r\n \"uniqueId\": \"8b5168d2-07ca-4e7d-8e6f-d4b25deabd0e\",\r\n\ + \ false,\r\n \"uniqueId\": \"668b361d-23dc-4ecc-ae95-6418893e3ad1\",\r\n\ \ \"automaticRepairsPolicy\": {\r\n \"enabled\": true,\r\n \"\ - gracePeriod\": \"PT30M\"\r\n }\r\n }\r\n}" + gracePeriod\": \"PT30M\",\r\n \"repairAction\": \"Replace\"\r\n }\r\ + \n }\r\n}" headers: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/07d1ea3c-3826-4257-a7e9-efce917b9c82?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/a3f1d31c-eb8b-4ec3-8d0d-7ccacef2c8b4?api-version=2020-06-01 cache-control: - no-cache content-length: - - '2738' + - '2852' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:38:34 GMT + - Wed, 16 Sep 2020 09:11:29 GMT expires: - '-1' pragma: @@ -949,7 +840,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/CreateVMScaleSet3Min;144,Microsoft.Compute/CreateVMScaleSet30Min;725,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;2899,Microsoft.Compute/VmssQueuedVMOperations;4796 + - Microsoft.Compute/CreateVMScaleSet3Min;59,Microsoft.Compute/CreateVMScaleSet30Min;299,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;1194,Microsoft.Compute/VmssQueuedVMOperations;4796 x-ms-ratelimit-remaining-subscription-writes: - '1199' x-ms-request-charge: @@ -967,23 +858,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/07d1ea3c-3826-4257-a7e9-efce917b9c82?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/a3f1d31c-eb8b-4ec3-8d0d-7ccacef2c8b4?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:38:33.663083+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"07d1ea3c-3826-4257-a7e9-efce917b9c82\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:11:28.2041418+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"a3f1d31c-eb8b-4ec3-8d0d-7ccacef2c8b4\"\ \r\n}" headers: cache-control: - no-cache content-length: - - '133' + - '134' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:38:45 GMT + - Wed, 16 Sep 2020 09:11:40 GMT expires: - '-1' pragma: @@ -1000,7 +891,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14990,Microsoft.Compute/GetOperation30Min;29828 + - Microsoft.Compute/GetOperation3Min;14989,Microsoft.Compute/GetOperation30Min;29854 status: code: 200 message: OK @@ -1014,23 +905,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/07d1ea3c-3826-4257-a7e9-efce917b9c82?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/a3f1d31c-eb8b-4ec3-8d0d-7ccacef2c8b4?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:38:33.663083+00:00\",\r\n \"\ - endTime\": \"2020-05-18T21:39:30.741572+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"07d1ea3c-3826-4257-a7e9-efce917b9c82\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T09:11:28.2041418+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"a3f1d31c-eb8b-4ec3-8d0d-7ccacef2c8b4\"\ + \r\n}" headers: cache-control: - no-cache content-length: - - '182' + - '134' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:39:46 GMT + - Wed, 16 Sep 2020 09:12:41 GMT expires: - '-1' pragma: @@ -1047,7 +938,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29825 + - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29852 status: code: 200 message: OK @@ -1061,9 +952,56 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetd7d31356?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/a3f1d31c-eb8b-4ec3-8d0d-7ccacef2c8b4?api-version=2020-06-01 + response: + body: + string: "{\r\n \"startTime\": \"2020-09-16T09:11:28.2041418+00:00\",\r\n \"\ + endTime\": \"2020-09-16T09:12:52.8298772+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"a3f1d31c-eb8b-4ec3-8d0d-7ccacef2c8b4\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '184' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 09:13:12 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetOperation3Min;14992,Microsoft.Compute/GetOperation30Min;29849 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetd7d31356?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"virtualmachinescalesetd7d31356\",\r\n \"id\": \"\ @@ -1095,18 +1033,19 @@ interactions: }]}}]}}]},\r\n \"extensionProfile\": {\r\n \"extensions\": []\r\ \n }\r\n },\r\n \"provisioningState\": \"Succeeded\",\r\n \"\ overprovision\": true,\r\n \"doNotRunExtensionsOnOverprovisionedVMs\":\ - \ false,\r\n \"uniqueId\": \"8b5168d2-07ca-4e7d-8e6f-d4b25deabd0e\",\r\n\ + \ false,\r\n \"uniqueId\": \"668b361d-23dc-4ecc-ae95-6418893e3ad1\",\r\n\ \ \"automaticRepairsPolicy\": {\r\n \"enabled\": true,\r\n \"\ - gracePeriod\": \"PT30M\"\r\n }\r\n }\r\n}" + gracePeriod\": \"PT30M\",\r\n \"repairAction\": \"Replace\"\r\n }\r\ + \n }\r\n}" headers: cache-control: - no-cache content-length: - - '2739' + - '2853' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:39:46 GMT + - Wed, 16 Sep 2020 09:13:12 GMT expires: - '-1' pragma: @@ -1123,7 +1062,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetVMScaleSet3Min;394,Microsoft.Compute/GetVMScaleSet30Min;2586 + - Microsoft.Compute/GetVMScaleSet3Min;396,Microsoft.Compute/GetVMScaleSet30Min;2596 status: code: 200 message: OK @@ -1141,25 +1080,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetd7d31356/setOrchestrationServiceState?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetd7d31356/setOrchestrationServiceState?api-version=2020-06-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/99abc4ea-bd37-4509-acf8-0c7e1f2b6b5e?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/5cbebbaa-eaf9-4ce8-8dc3-787f169812c3?api-version=2020-06-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 18 May 2020 21:39:46 GMT + - Wed, 16 Sep 2020 09:13:13 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/99abc4ea-bd37-4509-acf8-0c7e1f2b6b5e?monitor=true&api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/5cbebbaa-eaf9-4ce8-8dc3-787f169812c3?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -1170,7 +1109,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/VMScaleSetActions3Min;239,Microsoft.Compute/VMScaleSetActions30Min;1193,Microsoft.Compute/VmssQueuedVMOperations;4800 + - Microsoft.Compute/VMScaleSetActions3Min;239,Microsoft.Compute/VMScaleSetActions30Min;1199,Microsoft.Compute/VmssQueuedVMOperations;4800 x-ms-ratelimit-remaining-subscription-writes: - '1199' x-ms-request-charge: @@ -1192,25 +1131,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetd7d31356/reimage?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetd7d31356/reimage?api-version=2020-06-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/74ca0b60-cdde-4587-aec0-8500b59b9edd?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/be558fc5-841c-4b90-8e4e-c880c8be37f0?api-version=2020-06-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 18 May 2020 21:39:47 GMT + - Wed, 16 Sep 2020 09:13:13 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/74ca0b60-cdde-4587-aec0-8500b59b9edd?monitor=true&api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/be558fc5-841c-4b90-8e4e-c880c8be37f0?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -1221,7 +1160,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/VMScaleSetActions3Min;238,Microsoft.Compute/VMScaleSetActions30Min;1192,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;2897,Microsoft.Compute/VmssQueuedVMOperations;4798 + - Microsoft.Compute/VMScaleSetActions3Min;238,Microsoft.Compute/VMScaleSetActions30Min;1198,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;1192,Microsoft.Compute/VmssQueuedVMOperations;4798 x-ms-ratelimit-remaining-subscription-writes: - '1198' x-ms-request-charge: @@ -1239,23 +1178,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/99abc4ea-bd37-4509-acf8-0c7e1f2b6b5e?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/5cbebbaa-eaf9-4ce8-8dc3-787f169812c3?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:39:47.038559+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"99abc4ea-bd37-4509-acf8-0c7e1f2b6b5e\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:13:13.7361328+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"5cbebbaa-eaf9-4ce8-8dc3-787f169812c3\"\ \r\n}" headers: cache-control: - no-cache content-length: - - '133' + - '134' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:40:17 GMT + - Wed, 16 Sep 2020 09:13:43 GMT expires: - '-1' pragma: @@ -1272,7 +1211,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14992,Microsoft.Compute/GetOperation30Min;29853 + - Microsoft.Compute/GetOperation3Min;14990,Microsoft.Compute/GetOperation30Min;29846 status: code: 200 message: OK @@ -1286,23 +1225,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/74ca0b60-cdde-4587-aec0-8500b59b9edd?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/be558fc5-841c-4b90-8e4e-c880c8be37f0?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:39:47.569847+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"74ca0b60-cdde-4587-aec0-8500b59b9edd\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:13:14.1892516+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"be558fc5-841c-4b90-8e4e-c880c8be37f0\"\ \r\n}" headers: cache-control: - no-cache content-length: - - '133' + - '134' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:40:17 GMT + - Wed, 16 Sep 2020 09:13:43 GMT expires: - '-1' pragma: @@ -1319,7 +1258,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14991,Microsoft.Compute/GetOperation30Min;29852 + - Microsoft.Compute/GetOperation3Min;14989,Microsoft.Compute/GetOperation30Min;29845 status: code: 200 message: OK @@ -1333,23 +1272,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/99abc4ea-bd37-4509-acf8-0c7e1f2b6b5e?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/be558fc5-841c-4b90-8e4e-c880c8be37f0?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:39:47.038559+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"99abc4ea-bd37-4509-acf8-0c7e1f2b6b5e\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:13:14.1892516+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"be558fc5-841c-4b90-8e4e-c880c8be37f0\"\ \r\n}" headers: cache-control: - no-cache content-length: - - '133' + - '134' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:40:47 GMT + - Wed, 16 Sep 2020 09:14:15 GMT expires: - '-1' pragma: @@ -1366,7 +1305,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29846 + - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29840 status: code: 200 message: OK @@ -1380,23 +1319,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/74ca0b60-cdde-4587-aec0-8500b59b9edd?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/be558fc5-841c-4b90-8e4e-c880c8be37f0?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:39:47.569847+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"74ca0b60-cdde-4587-aec0-8500b59b9edd\"\ - \r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T09:13:14.1892516+00:00\",\r\n \"\ + endTime\": \"2020-09-16T09:14:20.4395934+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"be558fc5-841c-4b90-8e4e-c880c8be37f0\"\r\n}" headers: cache-control: - no-cache content-length: - - '133' + - '184' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:40:47 GMT + - Wed, 16 Sep 2020 09:14:45 GMT expires: - '-1' pragma: @@ -1413,7 +1352,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29845 + - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29835 status: code: 200 message: OK @@ -1427,23 +1366,19 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/99abc4ea-bd37-4509-acf8-0c7e1f2b6b5e?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/be558fc5-841c-4b90-8e4e-c880c8be37f0?monitor=true&api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:39:47.038559+00:00\",\r\n \"\ - endTime\": \"2020-05-18T21:41:13.3201939+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"99abc4ea-bd37-4509-acf8-0c7e1f2b6b5e\"\r\n}" + string: '' headers: cache-control: - no-cache content-length: - - '183' - content-type: - - application/json; charset=utf-8 + - '0' date: - - Mon, 18 May 2020 21:41:17 GMT + - Wed, 16 Sep 2020 09:14:46 GMT expires: - '-1' pragma: @@ -1453,14 +1388,10 @@ interactions: - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14978,Microsoft.Compute/GetOperation30Min;29839 + - Microsoft.Compute/GetOperation3Min;14980,Microsoft.Compute/GetOperation30Min;29834 status: code: 200 message: OK @@ -1473,22 +1404,30 @@ interactions: - gzip, deflate Connection: - keep-alive + Content-Length: + - '0' + Content-Type: + - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/99abc4ea-bd37-4509-acf8-0c7e1f2b6b5e?monitor=true&api-version=2019-12-01 + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetd7d31356/reimageall?api-version=2020-06-01 response: body: string: '' headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4be74722-7d9d-497c-a648-daf23424dcf7?api-version=2020-06-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 18 May 2020 21:41:17 GMT + - Wed, 16 Sep 2020 09:14:46 GMT expires: - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4be74722-7d9d-497c-a648-daf23424dcf7?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -1499,10 +1438,14 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14977,Microsoft.Compute/GetOperation30Min;29838 + - Microsoft.Compute/VMScaleSetActions3Min;237,Microsoft.Compute/VMScaleSetActions30Min;1197,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;1190,Microsoft.Compute/VmssQueuedVMOperations;4798 + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-ms-request-charge: + - '2' status: - code: 200 - message: OK + code: 202 + message: Accepted - request: body: null headers: @@ -1513,23 +1456,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/74ca0b60-cdde-4587-aec0-8500b59b9edd?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/5cbebbaa-eaf9-4ce8-8dc3-787f169812c3?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:39:47.569847+00:00\",\r\n \"\ - endTime\": \"2020-05-18T21:41:13.3201939+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"74ca0b60-cdde-4587-aec0-8500b59b9edd\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T09:13:13.7361328+00:00\",\r\n \"\ + endTime\": \"2020-09-16T09:14:20.4395934+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"5cbebbaa-eaf9-4ce8-8dc3-787f169812c3\"\r\n}" headers: cache-control: - no-cache content-length: - - '183' + - '184' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:41:18 GMT + - Wed, 16 Sep 2020 09:15:04 GMT expires: - '-1' pragma: @@ -1546,7 +1489,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14976,Microsoft.Compute/GetOperation30Min;29837 + - Microsoft.Compute/GetOperation3Min;14979,Microsoft.Compute/GetOperation30Min;29861 status: code: 200 message: OK @@ -1560,9 +1503,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/74ca0b60-cdde-4587-aec0-8500b59b9edd?monitor=true&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/5cbebbaa-eaf9-4ce8-8dc3-787f169812c3?monitor=true&api-version=2020-06-01 response: body: string: '' @@ -1572,7 +1515,7 @@ interactions: content-length: - '0' date: - - Mon, 18 May 2020 21:41:18 GMT + - Wed, 16 Sep 2020 09:15:05 GMT expires: - '-1' pragma: @@ -1585,61 +1528,10 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14975,Microsoft.Compute/GetOperation30Min;29836 + - Microsoft.Compute/GetOperation3Min;14977,Microsoft.Compute/GetOperation30Min;29859 status: code: 200 message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - Content-Type: - - application/json - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetd7d31356/reimageall?api-version=2019-12-01 - response: - body: - string: '' - headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/90c66341-dea5-4918-b52a-9e9e0bdaddc0?api-version=2019-12-01 - cache-control: - - no-cache - content-length: - - '0' - date: - - Mon, 18 May 2020 21:41:18 GMT - expires: - - '-1' - location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/90c66341-dea5-4918-b52a-9e9e0bdaddc0?monitor=true&api-version=2019-12-01 - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/VMScaleSetActions3Min;237,Microsoft.Compute/VMScaleSetActions30Min;1191,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;2897,Microsoft.Compute/VmssQueuedVMOperations;4798 - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - x-ms-request-charge: - - '2' - status: - code: 202 - message: Accepted - request: body: null headers: @@ -1650,13 +1542,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/90c66341-dea5-4918-b52a-9e9e0bdaddc0?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4be74722-7d9d-497c-a648-daf23424dcf7?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:41:19.6795804+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"90c66341-dea5-4918-b52a-9e9e0bdaddc0\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:14:46.7211344+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"4be74722-7d9d-497c-a648-daf23424dcf7\"\ \r\n}" headers: cache-control: @@ -1666,7 +1558,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:41:49 GMT + - Wed, 16 Sep 2020 09:15:16 GMT expires: - '-1' pragma: @@ -1683,7 +1575,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14973,Microsoft.Compute/GetOperation30Min;29832 + - Microsoft.Compute/GetOperation3Min;14976,Microsoft.Compute/GetOperation30Min;29858 status: code: 200 message: OK @@ -1697,13 +1589,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/90c66341-dea5-4918-b52a-9e9e0bdaddc0?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4be74722-7d9d-497c-a648-daf23424dcf7?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:41:19.6795804+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"90c66341-dea5-4918-b52a-9e9e0bdaddc0\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:14:46.7211344+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"4be74722-7d9d-497c-a648-daf23424dcf7\"\ \r\n}" headers: cache-control: @@ -1713,7 +1605,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:42:20 GMT + - Wed, 16 Sep 2020 09:15:47 GMT expires: - '-1' pragma: @@ -1730,7 +1622,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14971,Microsoft.Compute/GetOperation30Min;29829 + - Microsoft.Compute/GetOperation3Min;14976,Microsoft.Compute/GetOperation30Min;29855 status: code: 200 message: OK @@ -1744,14 +1636,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/90c66341-dea5-4918-b52a-9e9e0bdaddc0?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4be74722-7d9d-497c-a648-daf23424dcf7?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:41:19.6795804+00:00\",\r\n \"\ - endTime\": \"2020-05-18T21:42:25.3984818+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"90c66341-dea5-4918-b52a-9e9e0bdaddc0\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T09:14:46.7211344+00:00\",\r\n \"\ + endTime\": \"2020-09-16T09:16:00.8465842+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"4be74722-7d9d-497c-a648-daf23424dcf7\"\r\n}" headers: cache-control: - no-cache @@ -1760,7 +1652,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:42:50 GMT + - Wed, 16 Sep 2020 09:16:17 GMT expires: - '-1' pragma: @@ -1777,7 +1669,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14971,Microsoft.Compute/GetOperation30Min;29827 + - Microsoft.Compute/GetOperation3Min;14976,Microsoft.Compute/GetOperation30Min;29852 status: code: 200 message: OK @@ -1791,9 +1683,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/90c66341-dea5-4918-b52a-9e9e0bdaddc0?monitor=true&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4be74722-7d9d-497c-a648-daf23424dcf7?monitor=true&api-version=2020-06-01 response: body: string: '' @@ -1803,7 +1695,7 @@ interactions: content-length: - '0' date: - - Mon, 18 May 2020 21:42:50 GMT + - Wed, 16 Sep 2020 09:16:17 GMT expires: - '-1' pragma: @@ -1816,7 +1708,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14970,Microsoft.Compute/GetOperation30Min;29826 + - Microsoft.Compute/GetOperation3Min;14975,Microsoft.Compute/GetOperation30Min;29851 status: code: 200 message: OK @@ -1832,9 +1724,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetd7d31356?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetd7d31356?api-version=2020-06-01 response: body: string: '' @@ -1842,17 +1734,17 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3255aa81-0c37-4ffe-80da-307cb4d511c1?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e6ff1f76-49b1-4542-800d-80cbd87711db?api-version=2020-06-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 18 May 2020 21:42:51 GMT + - Wed, 16 Sep 2020 09:16:18 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3255aa81-0c37-4ffe-80da-307cb4d511c1?monitor=true&api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e6ff1f76-49b1-4542-800d-80cbd87711db?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -1863,7 +1755,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/DeleteVMScaleSet3Min;79,Microsoft.Compute/DeleteVMScaleSet30Min;395,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;2895,Microsoft.Compute/VmssQueuedVMOperations;4798 + - Microsoft.Compute/DeleteVMScaleSet3Min;79,Microsoft.Compute/DeleteVMScaleSet30Min;398,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;1194,Microsoft.Compute/VmssQueuedVMOperations;4798 x-ms-ratelimit-remaining-subscription-deletes: - '14999' x-ms-request-charge: @@ -1881,23 +1773,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3255aa81-0c37-4ffe-80da-307cb4d511c1?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e6ff1f76-49b1-4542-800d-80cbd87711db?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:42:51.4142686+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3255aa81-0c37-4ffe-80da-307cb4d511c1\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:16:18.862352+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"e6ff1f76-49b1-4542-800d-80cbd87711db\"\ \r\n}" headers: cache-control: - no-cache content-length: - - '134' + - '133' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:43:01 GMT + - Wed, 16 Sep 2020 09:16:28 GMT expires: - '-1' pragma: @@ -1914,7 +1806,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14975,Microsoft.Compute/GetOperation30Min;29825 + - Microsoft.Compute/GetOperation3Min;14974,Microsoft.Compute/GetOperation30Min;29850 status: code: 200 message: OK @@ -1928,23 +1820,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3255aa81-0c37-4ffe-80da-307cb4d511c1?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e6ff1f76-49b1-4542-800d-80cbd87711db?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:42:51.4142686+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3255aa81-0c37-4ffe-80da-307cb4d511c1\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:16:18.862352+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"e6ff1f76-49b1-4542-800d-80cbd87711db\"\ \r\n}" headers: cache-control: - no-cache content-length: - - '134' + - '133' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:43:11 GMT + - Wed, 16 Sep 2020 09:16:38 GMT expires: - '-1' pragma: @@ -1961,7 +1853,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14974,Microsoft.Compute/GetOperation30Min;29824 + - Microsoft.Compute/GetOperation3Min;14978,Microsoft.Compute/GetOperation30Min;29849 status: code: 200 message: OK @@ -1975,23 +1867,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3255aa81-0c37-4ffe-80da-307cb4d511c1?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e6ff1f76-49b1-4542-800d-80cbd87711db?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:42:51.4142686+00:00\",\r\n \"\ - endTime\": \"2020-05-18T21:43:32.4612299+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"3255aa81-0c37-4ffe-80da-307cb4d511c1\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T09:16:18.862352+00:00\",\r\n \"\ + endTime\": \"2020-09-16T09:16:49.7219433+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"e6ff1f76-49b1-4542-800d-80cbd87711db\"\r\n}" headers: cache-control: - no-cache content-length: - - '184' + - '183' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:43:41 GMT + - Wed, 16 Sep 2020 09:17:09 GMT expires: - '-1' pragma: @@ -2008,7 +1900,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14979,Microsoft.Compute/GetOperation30Min;29822 + - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29847 status: code: 200 message: OK diff --git a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vmss.test_compute_vmss_perform_maintenance.yaml b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vmss.test_compute_vmss_perform_maintenance.yaml index 3886340a2d3c..39732abf54bc 100644 --- a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vmss.test_compute_vmss_perform_maintenance.yaml +++ b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vmss.test_compute_vmss_perform_maintenance.yaml @@ -12,21 +12,18 @@ interactions: Content-Length: - '92' Content-Type: - - application/json; charset=utf-8 + - application/json User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexfe411907?api-version=2019-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexfe411907?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"networknamexfe411907\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexfe411907\"\ - ,\r\n \"etag\": \"W/\\\"9a80d74e-b7c0-40db-9910-c5d361ec23f7\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"42b3aa85-5c69-482b-aca9-99f610cd687d\\\"\",\r\n \ \ \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \ - \ \"resourceGuid\": \"adcaea12-5be7-4de8-8989-4f3664828be9\",\r\n \"\ + \ \"resourceGuid\": \"558aa752-be93-4bdc-9ab1-1dc4658a36c9\",\r\n \"\ addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\ \r\n ]\r\n },\r\n \"subnets\": [],\r\n \"virtualNetworkPeerings\"\ : [],\r\n \"enableDdosProtection\": false,\r\n \"enableVmProtection\"\ @@ -35,15 +32,15 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/64901957-52c5-435a-aa86-a3c9eb6185e3?api-version=2019-09-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/51f0f5e8-e618-4a7f-989f-1d9eb0613e97?api-version=2020-06-01 cache-control: - no-cache content-length: - - '720' + - '727' content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 08:52:31 GMT + - Wed, 16 Sep 2020 09:17:28 GMT expires: - '-1' pragma: @@ -56,9 +53,9 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 96c07e4a-a75a-499f-89f2-35ef5362bc99 + - 08298b7e-ac31-42c5-b3c0-09292e2f8101 x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' status: code: 201 message: Created @@ -66,16 +63,15 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/64901957-52c5-435a-aa86-a3c9eb6185e3?api-version=2019-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/51f0f5e8-e618-4a7f-989f-1d9eb0613e97?api-version=2020-06-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -87,7 +83,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 08:52:35 GMT + - Wed, 16 Sep 2020 09:17:32 GMT expires: - '-1' pragma: @@ -104,7 +100,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - ba71ee74-e02d-48c9-9e0a-b0eee6dfff56 + - 746fceec-2c6c-4f70-ad20-66a2ab5698a6 status: code: 200 message: OK @@ -112,23 +108,22 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexfe411907?api-version=2019-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexfe411907?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"networknamexfe411907\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexfe411907\"\ - ,\r\n \"etag\": \"W/\\\"9b953fdb-e8c3-4251-83b8-051ce4ca56c0\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"7e051676-26f2-46d8-87e9-900f02cd9937\\\"\",\r\n \ \ \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n\ - \ \"resourceGuid\": \"adcaea12-5be7-4de8-8989-4f3664828be9\",\r\n \"\ + \ \"resourceGuid\": \"558aa752-be93-4bdc-9ab1-1dc4658a36c9\",\r\n \"\ addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\ \r\n ]\r\n },\r\n \"subnets\": [],\r\n \"virtualNetworkPeerings\"\ : [],\r\n \"enableDdosProtection\": false,\r\n \"enableVmProtection\"\ @@ -137,13 +132,13 @@ interactions: cache-control: - no-cache content-length: - - '721' + - '728' content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 08:52:36 GMT + - Wed, 16 Sep 2020 09:17:32 GMT etag: - - W/"9b953fdb-e8c3-4251-83b8-051ce4ca56c0" + - W/"7e051676-26f2-46d8-87e9-900f02cd9937" expires: - '-1' pragma: @@ -160,7 +155,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 310202d1-969b-4955-8fb6-12309db66fa1 + - 6f1fce8a-cb28-4e9e-b4fc-1ea8cae87795 status: code: 200 message: OK @@ -176,33 +171,30 @@ interactions: Content-Length: - '48' Content-Type: - - application/json; charset=utf-8 + - application/json User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexfe411907/subnets/subnetnamexfe411907?api-version=2019-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexfe411907/subnets/subnetnamexfe411907?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"subnetnamexfe411907\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexfe411907/subnets/subnetnamexfe411907\"\ - ,\r\n \"etag\": \"W/\\\"e54bf0a7-2832-4ea4-bfff-8378615c5e20\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"9c0d03cd-79d6-42bd-babe-fa7291bd19b7\\\"\",\r\n \ \ \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"\ addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\"\ : \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\ \n },\r\n \"type\": \"Microsoft.Network/virtualNetworks/subnets\"\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/6ddecfcc-9c96-471f-8e90-931249e42a6b?api-version=2019-09-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/503a1ba7-ec3f-420c-a8ad-55005f4eed4c?api-version=2020-06-01 cache-control: - no-cache content-length: - - '617' + - '624' content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 08:52:36 GMT + - Wed, 16 Sep 2020 09:17:34 GMT expires: - '-1' pragma: @@ -215,9 +207,9 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - d8961e58-a026-42b4-bf1c-2f70d01c61f8 + - 8589a858-e38f-4113-953d-819e17b183ee x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1197' status: code: 201 message: Created @@ -225,16 +217,15 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/6ddecfcc-9c96-471f-8e90-931249e42a6b?api-version=2019-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/503a1ba7-ec3f-420c-a8ad-55005f4eed4c?api-version=2020-06-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -246,7 +237,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 08:52:41 GMT + - Wed, 16 Sep 2020 09:17:37 GMT expires: - '-1' pragma: @@ -263,7 +254,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 1c7da524-306d-4aad-a6da-eb09f0c8abf9 + - 4490ad79-43ef-4968-8417-04ad7b047a13 status: code: 200 message: OK @@ -271,20 +262,19 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexfe411907/subnets/subnetnamexfe411907?api-version=2019-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexfe411907/subnets/subnetnamexfe411907?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"subnetnamexfe411907\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexfe411907/subnets/subnetnamexfe411907\"\ - ,\r\n \"etag\": \"W/\\\"8dd7fcfb-a217-4b56-95e0-77cd9ca5ecfd\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"28b1ad56-0b32-4480-aea7-2cfbef10db32\\\"\",\r\n \ \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"\ addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\"\ : \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\ @@ -293,13 +283,13 @@ interactions: cache-control: - no-cache content-length: - - '618' + - '625' content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 08:52:42 GMT + - Wed, 16 Sep 2020 09:17:37 GMT etag: - - W/"8dd7fcfb-a217-4b56-95e0-77cd9ca5ecfd" + - W/"28b1ad56-0b32-4480-aea7-2cfbef10db32" expires: - '-1' pragma: @@ -316,22 +306,22 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 702873c1-01bb-470c-b22e-7ac8e3827953 + - 7b903c69-c975-4197-b63e-13d4b6d530a1 status: code: 200 message: OK - request: - body: 'b''{"location": "eastus", "sku": {"name": "Standard_D1_v2", "tier": "Standard", - "capacity": 1}, "properties": {"upgradePolicy": {"mode": "Manual"}, "virtualMachineProfile": - {"osProfile": {"computerNamePrefix": "testPC", "adminUsername": "testuser", - "adminPassword": "Aa!1()-xyz"}, "storageProfile": {"imageReference": {"publisher": - "MicrosoftWindowsServer", "offer": "WindowsServer", "sku": "2016-Datacenter", + body: 'b''b\''{"location": "eastus", "sku": {"name": "Standard_D1_v2", "tier": + "Standard", "capacity": 1}, "properties": {"upgradePolicy": {"mode": "Manual"}, + "virtualMachineProfile": {"osProfile": {"computerNamePrefix": "testPC", "adminUsername": + "testuser", "adminPassword": "Aa!1()-xyz"}, "storageProfile": {"imageReference": + {"publisher": "MicrosoftWindowsServer", "offer": "WindowsServer", "sku": "2016-Datacenter", "version": "latest"}, "osDisk": {"caching": "ReadWrite", "createOption": "FromImage", "diskSizeGB": 512, "managedDisk": {"storageAccountType": "Standard_LRS"}}}, "networkProfile": {"networkInterfaceConfigurations": [{"name": "testPC", "properties": {"primary": true, "ipConfigurations": [{"name": "testPC", "properties": {"subnet": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexfe411907/subnets/subnetnamexfe411907"}}}]}}]}}, - "overprovision": true}}''' + "overprovision": true}}\''''' headers: Accept: - application/json @@ -340,13 +330,13 @@ interactions: Connection: - keep-alive Content-Length: - - '1010' + - '1017' Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetfe411907?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetfe411907?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"virtualmachinescalesetfe411907\",\r\n \"id\": \"\ @@ -381,20 +371,20 @@ interactions: : {}\r\n }\r\n }\r\n ]\r\n }\r\n },\r\n\ \ \"provisioningState\": \"Creating\",\r\n \"overprovision\": true,\r\ \n \"doNotRunExtensionsOnOverprovisionedVMs\": false,\r\n \"uniqueId\"\ - : \"7025c26c-6c9f-44ab-a6a6-cf4e016664fa\"\r\n }\r\n}" + : \"ec05bbee-9a74-4516-bddb-d95a9bcae642\"\r\n }\r\n}" headers: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/04e77b34-5cb0-4e0f-b957-488384a59e1e?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/30cc8924-bcf2-4282-94fe-995fd323f7e4?api-version=2020-06-01 cache-control: - no-cache content-length: - - '2562' + - '2576' content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 08:52:51 GMT + - Wed, 16 Sep 2020 09:17:48 GMT expires: - '-1' pragma: @@ -407,7 +397,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/CreateVMScaleSet3Min;59,Microsoft.Compute/CreateVMScaleSet30Min;299,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;1198,Microsoft.Compute/VmssQueuedVMOperations;4798 + - Microsoft.Compute/CreateVMScaleSet3Min;59,Microsoft.Compute/CreateVMScaleSet30Min;298,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;1192,Microsoft.Compute/VmssQueuedVMOperations;4798 x-ms-ratelimit-remaining-subscription-writes: - '1199' x-ms-request-charge: @@ -425,13 +415,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/04e77b34-5cb0-4e0f-b957-488384a59e1e?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/30cc8924-bcf2-4282-94fe-995fd323f7e4?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T08:52:49.5533811+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"04e77b34-5cb0-4e0f-b957-488384a59e1e\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:17:46.1601252+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"30cc8924-bcf2-4282-94fe-995fd323f7e4\"\ \r\n}" headers: cache-control: @@ -441,7 +431,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 08:53:01 GMT + - Wed, 16 Sep 2020 09:17:58 GMT expires: - '-1' pragma: @@ -458,7 +448,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14998,Microsoft.Compute/GetOperation30Min;29988 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29846 status: code: 200 message: OK @@ -472,13 +462,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/04e77b34-5cb0-4e0f-b957-488384a59e1e?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/30cc8924-bcf2-4282-94fe-995fd323f7e4?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T08:52:49.5533811+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"04e77b34-5cb0-4e0f-b957-488384a59e1e\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:17:46.1601252+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"30cc8924-bcf2-4282-94fe-995fd323f7e4\"\ \r\n}" headers: cache-control: @@ -488,7 +478,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 08:54:38 GMT + - Wed, 16 Sep 2020 09:19:36 GMT expires: - '-1' pragma: @@ -505,7 +495,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14998,Microsoft.Compute/GetOperation30Min;29987 + - Microsoft.Compute/GetOperation3Min;14997,Microsoft.Compute/GetOperation30Min;29845 status: code: 200 message: OK @@ -519,13 +509,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/04e77b34-5cb0-4e0f-b957-488384a59e1e?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/30cc8924-bcf2-4282-94fe-995fd323f7e4?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T08:52:49.5533811+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"04e77b34-5cb0-4e0f-b957-488384a59e1e\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:17:46.1601252+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"30cc8924-bcf2-4282-94fe-995fd323f7e4\"\ \r\n}" headers: cache-control: @@ -535,7 +525,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 08:55:09 GMT + - Wed, 16 Sep 2020 09:20:06 GMT expires: - '-1' pragma: @@ -552,7 +542,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14996,Microsoft.Compute/GetOperation30Min;29985 + - Microsoft.Compute/GetOperation3Min;14996,Microsoft.Compute/GetOperation30Min;29872 status: code: 200 message: OK @@ -566,13 +556,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/04e77b34-5cb0-4e0f-b957-488384a59e1e?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/30cc8924-bcf2-4282-94fe-995fd323f7e4?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T08:52:49.5533811+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"04e77b34-5cb0-4e0f-b957-488384a59e1e\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:17:46.1601252+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"30cc8924-bcf2-4282-94fe-995fd323f7e4\"\ \r\n}" headers: cache-control: @@ -582,7 +572,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 08:55:40 GMT + - Wed, 16 Sep 2020 09:20:36 GMT expires: - '-1' pragma: @@ -599,7 +589,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14995,Microsoft.Compute/GetOperation30Min;29984 + - Microsoft.Compute/GetOperation3Min;14996,Microsoft.Compute/GetOperation30Min;29871 status: code: 200 message: OK @@ -613,13 +603,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/04e77b34-5cb0-4e0f-b957-488384a59e1e?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/30cc8924-bcf2-4282-94fe-995fd323f7e4?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T08:52:49.5533811+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"04e77b34-5cb0-4e0f-b957-488384a59e1e\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:17:46.1601252+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"30cc8924-bcf2-4282-94fe-995fd323f7e4\"\ \r\n}" headers: cache-control: @@ -629,7 +619,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 08:56:10 GMT + - Wed, 16 Sep 2020 09:21:06 GMT expires: - '-1' pragma: @@ -646,7 +636,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14995,Microsoft.Compute/GetOperation30Min;29983 + - Microsoft.Compute/GetOperation3Min;14995,Microsoft.Compute/GetOperation30Min;29870 status: code: 200 message: OK @@ -660,13 +650,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/04e77b34-5cb0-4e0f-b957-488384a59e1e?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/30cc8924-bcf2-4282-94fe-995fd323f7e4?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T08:52:49.5533811+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"04e77b34-5cb0-4e0f-b957-488384a59e1e\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:17:46.1601252+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"30cc8924-bcf2-4282-94fe-995fd323f7e4\"\ \r\n}" headers: cache-control: @@ -676,7 +666,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 08:56:40 GMT + - Wed, 16 Sep 2020 09:21:37 GMT expires: - '-1' pragma: @@ -693,7 +683,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14994,Microsoft.Compute/GetOperation30Min;29982 + - Microsoft.Compute/GetOperation3Min;14994,Microsoft.Compute/GetOperation30Min;29869 status: code: 200 message: OK @@ -707,13 +697,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/04e77b34-5cb0-4e0f-b957-488384a59e1e?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/30cc8924-bcf2-4282-94fe-995fd323f7e4?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T08:52:49.5533811+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"04e77b34-5cb0-4e0f-b957-488384a59e1e\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:17:46.1601252+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"30cc8924-bcf2-4282-94fe-995fd323f7e4\"\ \r\n}" headers: cache-control: @@ -723,7 +713,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 08:57:10 GMT + - Wed, 16 Sep 2020 09:22:07 GMT expires: - '-1' pragma: @@ -740,7 +730,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14992,Microsoft.Compute/GetOperation30Min;29980 + - Microsoft.Compute/GetOperation3Min;14992,Microsoft.Compute/GetOperation30Min;29867 status: code: 200 message: OK @@ -754,13 +744,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/04e77b34-5cb0-4e0f-b957-488384a59e1e?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/30cc8924-bcf2-4282-94fe-995fd323f7e4?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T08:52:49.5533811+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"04e77b34-5cb0-4e0f-b957-488384a59e1e\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:17:46.1601252+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"30cc8924-bcf2-4282-94fe-995fd323f7e4\"\ \r\n}" headers: cache-control: @@ -770,7 +760,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 08:57:41 GMT + - Wed, 16 Sep 2020 09:22:37 GMT expires: - '-1' pragma: @@ -787,7 +777,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29979 + - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29866 status: code: 200 message: OK @@ -801,14 +791,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/04e77b34-5cb0-4e0f-b957-488384a59e1e?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/30cc8924-bcf2-4282-94fe-995fd323f7e4?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T08:52:49.5533811+00:00\",\r\n \"\ - endTime\": \"2020-06-01T08:57:59.6330334+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"04e77b34-5cb0-4e0f-b957-488384a59e1e\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T09:17:46.1601252+00:00\",\r\n \"\ + endTime\": \"2020-09-16T09:22:50.1154803+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"30cc8924-bcf2-4282-94fe-995fd323f7e4\"\r\n}" headers: cache-control: - no-cache @@ -817,7 +807,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 08:58:11 GMT + - Wed, 16 Sep 2020 09:23:08 GMT expires: - '-1' pragma: @@ -834,7 +824,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14992,Microsoft.Compute/GetOperation30Min;29977 + - Microsoft.Compute/GetOperation3Min;14992,Microsoft.Compute/GetOperation30Min;29864 status: code: 200 message: OK @@ -848,9 +838,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetfe411907?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetfe411907?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"virtualmachinescalesetfe411907\",\r\n \"id\": \"\ @@ -885,16 +875,16 @@ interactions: : {}\r\n }\r\n }\r\n ]\r\n }\r\n },\r\n\ \ \"provisioningState\": \"Succeeded\",\r\n \"overprovision\": true,\r\ \n \"doNotRunExtensionsOnOverprovisionedVMs\": false,\r\n \"uniqueId\"\ - : \"7025c26c-6c9f-44ab-a6a6-cf4e016664fa\"\r\n }\r\n}" + : \"ec05bbee-9a74-4516-bddb-d95a9bcae642\"\r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '2563' + - '2577' content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 08:58:12 GMT + - Wed, 16 Sep 2020 09:23:08 GMT expires: - '-1' pragma: @@ -911,7 +901,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetVMScaleSet3Min;398,Microsoft.Compute/GetVMScaleSet30Min;2598 + - Microsoft.Compute/GetVMScaleSet3Min;395,Microsoft.Compute/GetVMScaleSet30Min;2586 status: code: 200 message: OK @@ -925,53 +915,53 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetfe411907/virtualmachines/0/instanceView?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetfe411907/virtualmachines/0/instanceView?api-version=2020-06-01 response: body: - string: "{\r\n \"placementGroupId\": \"3b3ef09d-d93b-4119-b0ea-2b458849b4d4\"\ + string: "{\r\n \"placementGroupId\": \"163e3403-a48a-4c4b-841a-7d1774e76f59\"\ ,\r\n \"platformUpdateDomain\": 0,\r\n \"platformFaultDomain\": 0,\r\n \ \ \"computerName\": \"testPC000000\",\r\n \"osName\": \"Windows Server 2016\ \ Datacenter\",\r\n \"osVersion\": \"Microsoft Windows NT 10.0.14393.0\"\ - ,\r\n \"vmAgent\": {\r\n \"vmAgentVersion\": \"2.7.41491.971\",\r\n \ + ,\r\n \"vmAgent\": {\r\n \"vmAgentVersion\": \"2.7.41491.993\",\r\n \ \ \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\"\ ,\r\n \"level\": \"Info\",\r\n \"displayStatus\": \"Ready\"\ ,\r\n \"message\": \"GuestAgent is running and processing the extensions.\"\ - ,\r\n \"time\": \"2020-06-01T09:01:12+00:00\"\r\n }\r\n ],\r\ + ,\r\n \"time\": \"2020-09-16T09:26:10+00:00\"\r\n }\r\n ],\r\ \n \"extensionHandlers\": [\r\n {\r\n \"type\": \"Microsoft.Azure.Geneva.GenevaMonitoring\"\ - ,\r\n \"typeHandlerVersion\": \"2.17.0.2\",\r\n \"status\":\ + ,\r\n \"typeHandlerVersion\": \"2.19.0.1\",\r\n \"status\":\ \ {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n \"\ level\": \"Info\",\r\n \"displayStatus\": \"Ready\",\r\n \ \ \"message\": \"ExtensionOperation:enable. Status:Success\"\r\n }\r\ \n }\r\n ]\r\n },\r\n \"disks\": [\r\n {\r\n \"name\": \"\ - virtualmachinescalesvirtualmachinescaleseOS__1_161546c992304a888826ff2395c15697\"\ + virtualmachinescalesvirtualmachinescaleseOS__1_c86e425f7c104f33942b7d57b8675eb4\"\ ,\r\n \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\"\ ,\r\n \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning\ - \ succeeded\",\r\n \"time\": \"2020-06-01T08:58:00.2423817+00:00\"\ + \ succeeded\",\r\n \"time\": \"2020-09-16T09:22:50.6779763+00:00\"\ \r\n }\r\n ]\r\n }\r\n ],\r\n \"extensions\": [\r\n {\r\ \n \"name\": \"Microsoft.Azure.Geneva.GenevaMonitoring\",\r\n \"\ type\": \"Microsoft.Azure.Geneva.GenevaMonitoring\",\r\n \"typeHandlerVersion\"\ - : \"2.17.0.2\",\r\n \"statuses\": [\r\n {\r\n \"code\"\ + : \"2.19.0.1\",\r\n \"statuses\": [\r\n {\r\n \"code\"\ : \"ProvisioningState/succeeded\",\r\n \"level\": \"Info\",\r\n \ \ \"displayStatus\": \"Provisioning succeeded\",\r\n \"message\"\ : \"ExtensionOperation:enable. Status:Success\",\r\n \"time\": \"\ - 2020-06-01T09:00:56+00:00\"\r\n }\r\n ]\r\n }\r\n ],\r\n \ + 2020-09-16T09:26:06+00:00\"\r\n }\r\n ]\r\n }\r\n ],\r\n \ \ \"hyperVGeneration\": \"V1\",\r\n \"statuses\": [\r\n {\r\n \"\ code\": \"ProvisioningState/succeeded\",\r\n \"level\": \"Info\",\r\n\ \ \"displayStatus\": \"Provisioning succeeded\",\r\n \"time\": \"\ - 2020-06-01T08:58:45.1642821+00:00\"\r\n },\r\n {\r\n \"code\":\ - \ \"PowerState/running\",\r\n \"level\": \"Info\",\r\n \"displayStatus\"\ + 2020-09-16T09:23:26.287516+00:00\"\r\n },\r\n {\r\n \"code\": \"\ + PowerState/running\",\r\n \"level\": \"Info\",\r\n \"displayStatus\"\ : \"VM running\"\r\n }\r\n ]\r\n}" headers: cache-control: - no-cache content-length: - - '2181' + - '2180' content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:01:12 GMT + - Wed, 16 Sep 2020 09:26:10 GMT expires: - '-1' pragma: @@ -1008,9 +998,9 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetfe411907/performMaintenance?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetfe411907/performMaintenance?api-version=2020-06-01 response: body: string: "{\r\n \"error\": {\r\n \"code\": \"OperationNotAllowed\",\r\n \ @@ -1024,7 +1014,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:01:12 GMT + - Wed, 16 Sep 2020 09:26:10 GMT expires: - '-1' pragma: @@ -1037,9 +1027,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/VMScaleSetActions3Min;239,Microsoft.Compute/VMScaleSetActions30Min;1199 + - Microsoft.Compute/VMScaleSetActions3Min;239,Microsoft.Compute/VMScaleSetActions30Min;1167 x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 409 message: Conflict @@ -1055,9 +1045,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetfe411907/virtualmachines/0/performMaintenance?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetfe411907/virtualmachines/0/performMaintenance?api-version=2020-06-01 response: body: string: "{\r\n \"error\": {\r\n \"code\": \"OperationNotAllowed\",\r\n \ @@ -1071,7 +1061,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:01:13 GMT + - Wed, 16 Sep 2020 09:26:10 GMT expires: - '-1' pragma: @@ -1084,9 +1074,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/VMScaleSetActions3Min;238,Microsoft.Compute/VMScaleSetActions30Min;1198 + - Microsoft.Compute/VMScaleSetActions3Min;238,Microsoft.Compute/VMScaleSetActions30Min;1166 x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1198' status: code: 409 message: Conflict @@ -1102,9 +1092,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetfe411907?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetfe411907?api-version=2020-06-01 response: body: string: '' @@ -1112,17 +1102,17 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/9237120d-0cfd-45df-aef6-7ffb8684db15?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b9d0d6c6-e037-45b6-af25-6ef7b51b6a1b?api-version=2020-06-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 01 Jun 2020 09:01:13 GMT + - Wed, 16 Sep 2020 09:26:11 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/9237120d-0cfd-45df-aef6-7ffb8684db15?monitor=true&api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b9d0d6c6-e037-45b6-af25-6ef7b51b6a1b?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -1133,9 +1123,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/DeleteVMScaleSet3Min;79,Microsoft.Compute/DeleteVMScaleSet30Min;399,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;1199,Microsoft.Compute/VmssQueuedVMOperations;4799 + - Microsoft.Compute/DeleteVMScaleSet3Min;79,Microsoft.Compute/DeleteVMScaleSet30Min;397,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;1199,Microsoft.Compute/VmssQueuedVMOperations;4799 x-ms-ratelimit-remaining-subscription-deletes: - - '14998' + - '14999' x-ms-request-charge: - '1' status: @@ -1151,13 +1141,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/9237120d-0cfd-45df-aef6-7ffb8684db15?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b9d0d6c6-e037-45b6-af25-6ef7b51b6a1b?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:01:14.6955063+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"9237120d-0cfd-45df-aef6-7ffb8684db15\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:26:11.8042991+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"b9d0d6c6-e037-45b6-af25-6ef7b51b6a1b\"\ \r\n}" headers: cache-control: @@ -1167,7 +1157,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:01:24 GMT + - Wed, 16 Sep 2020 09:26:21 GMT expires: - '-1' pragma: @@ -1184,7 +1174,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14999,Microsoft.Compute/GetOperation30Min;29976 + - Microsoft.Compute/GetOperation3Min;14999,Microsoft.Compute/GetOperation30Min;29890 status: code: 200 message: OK @@ -1198,13 +1188,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/9237120d-0cfd-45df-aef6-7ffb8684db15?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b9d0d6c6-e037-45b6-af25-6ef7b51b6a1b?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:01:14.6955063+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"9237120d-0cfd-45df-aef6-7ffb8684db15\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:26:11.8042991+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"b9d0d6c6-e037-45b6-af25-6ef7b51b6a1b\"\ \r\n}" headers: cache-control: @@ -1214,7 +1204,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:01:36 GMT + - Wed, 16 Sep 2020 09:26:33 GMT expires: - '-1' pragma: @@ -1231,7 +1221,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14998,Microsoft.Compute/GetOperation30Min;29975 + - Microsoft.Compute/GetOperation3Min;14998,Microsoft.Compute/GetOperation30Min;29889 status: code: 200 message: OK @@ -1245,14 +1235,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/9237120d-0cfd-45df-aef6-7ffb8684db15?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b9d0d6c6-e037-45b6-af25-6ef7b51b6a1b?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:01:14.6955063+00:00\",\r\n \"\ - endTime\": \"2020-06-01T09:01:56.0861482+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"9237120d-0cfd-45df-aef6-7ffb8684db15\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T09:26:11.8042991+00:00\",\r\n \"\ + endTime\": \"2020-09-16T09:26:52.7419881+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"b9d0d6c6-e037-45b6-af25-6ef7b51b6a1b\"\r\n}" headers: cache-control: - no-cache @@ -1261,7 +1251,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:02:06 GMT + - Wed, 16 Sep 2020 09:27:03 GMT expires: - '-1' pragma: @@ -1278,7 +1268,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14996,Microsoft.Compute/GetOperation30Min;29973 + - Microsoft.Compute/GetOperation3Min;14996,Microsoft.Compute/GetOperation30Min;29887 status: code: 200 message: OK diff --git a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vmss.test_compute_vmss_rolling_upgrades.yaml b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vmss.test_compute_vmss_rolling_upgrades.yaml index b6811eb95080..089f9041b424 100644 --- a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vmss.test_compute_vmss_rolling_upgrades.yaml +++ b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vmss.test_compute_vmss_rolling_upgrades.yaml @@ -12,21 +12,18 @@ interactions: Content-Length: - '92' Content-Type: - - application/json; charset=utf-8 + - application/json User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexb4bb17db?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexb4bb17db?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"networknamexb4bb17db\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexb4bb17db\"\ - ,\r\n \"etag\": \"W/\\\"2432a962-a464-4fda-95bb-ca827c8a4c7e\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"4e53ebfb-0994-4562-bdc9-bd5b613eaa72\\\"\",\r\n \ \ \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \ - \ \"resourceGuid\": \"fd8eba14-8758-4235-bd8b-47a91ab7dd2b\",\r\n \"\ + \ \"resourceGuid\": \"d480e249-8a01-47b8-89c7-43d1d244f077\",\r\n \"\ addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\ \r\n ]\r\n },\r\n \"subnets\": [],\r\n \"virtualNetworkPeerings\"\ : [],\r\n \"enableDdosProtection\": false,\r\n \"enableVmProtection\"\ @@ -35,15 +32,15 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/eee5320d-573a-4ca5-9947-9899df424fd4?api-version=2020-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/5b98f52b-b7d2-48fd-87cd-f9d995ea09b6?api-version=2020-06-01 cache-control: - no-cache content-length: - - '717' + - '727' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:26:31 GMT + - Wed, 16 Sep 2020 09:27:21 GMT expires: - '-1' pragma: @@ -56,7 +53,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - befcade9-92c0-4589-8bd9-1657d29d89be + - 21f3ee0b-15fa-45e3-b2df-d683fadf4a29 x-ms-ratelimit-remaining-subscription-writes: - '1199' status: @@ -66,16 +63,15 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/eee5320d-573a-4ca5-9947-9899df424fd4?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/5b98f52b-b7d2-48fd-87cd-f9d995ea09b6?api-version=2020-06-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -87,7 +83,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:26:36 GMT + - Wed, 16 Sep 2020 09:27:26 GMT expires: - '-1' pragma: @@ -104,7 +100,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 23b84d52-aed6-464a-9ab7-7d20b30bab6a + - f0d21e46-1ddf-4d48-b008-451a458f3e4a status: code: 200 message: OK @@ -112,23 +108,22 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexb4bb17db?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexb4bb17db?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"networknamexb4bb17db\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexb4bb17db\"\ - ,\r\n \"etag\": \"W/\\\"bfa0e8c0-3c28-48be-8ece-960b48212c18\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"de613662-a484-47ad-84e6-b423d95c841e\\\"\",\r\n \ \ \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n\ - \ \"resourceGuid\": \"fd8eba14-8758-4235-bd8b-47a91ab7dd2b\",\r\n \"\ + \ \"resourceGuid\": \"d480e249-8a01-47b8-89c7-43d1d244f077\",\r\n \"\ addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\ \r\n ]\r\n },\r\n \"subnets\": [],\r\n \"virtualNetworkPeerings\"\ : [],\r\n \"enableDdosProtection\": false,\r\n \"enableVmProtection\"\ @@ -137,13 +132,13 @@ interactions: cache-control: - no-cache content-length: - - '718' + - '728' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:26:36 GMT + - Wed, 16 Sep 2020 09:27:27 GMT etag: - - W/"bfa0e8c0-3c28-48be-8ece-960b48212c18" + - W/"de613662-a484-47ad-84e6-b423d95c841e" expires: - '-1' pragma: @@ -160,7 +155,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - ea0f910b-e44c-40d2-af53-26bc6bb4b76e + - af0f9da4-69fc-4155-a30c-b71fd047fe19 status: code: 200 message: OK @@ -176,33 +171,30 @@ interactions: Content-Length: - '48' Content-Type: - - application/json; charset=utf-8 + - application/json User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexb4bb17db/subnets/subnetnamexb4bb17db?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexb4bb17db/subnets/subnetnamexb4bb17db?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"subnetnamexb4bb17db\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexb4bb17db/subnets/subnetnamexb4bb17db\"\ - ,\r\n \"etag\": \"W/\\\"7dd008f4-9bd7-4b98-91cc-a347e9a165a7\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"f82c2dc5-09b3-4ece-ab57-6bfc6e192c0c\\\"\",\r\n \ \ \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"\ addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\"\ : \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\ \n },\r\n \"type\": \"Microsoft.Network/virtualNetworks/subnets\"\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/21cc130d-0dac-4690-9b27-662fc1235374?api-version=2020-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/0f46b258-1961-4fbd-a92a-d6be9054cd41?api-version=2020-06-01 cache-control: - no-cache content-length: - - '614' + - '624' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:26:36 GMT + - Wed, 16 Sep 2020 09:27:28 GMT expires: - '-1' pragma: @@ -215,7 +207,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 7e1ecc68-891c-468b-ac5b-16e6b570be92 + - b03655ba-0ef9-4717-9498-1a38589ab4e1 x-ms-ratelimit-remaining-subscription-writes: - '1198' status: @@ -225,16 +217,15 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/21cc130d-0dac-4690-9b27-662fc1235374?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/0f46b258-1961-4fbd-a92a-d6be9054cd41?api-version=2020-06-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -246,7 +237,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:26:40 GMT + - Wed, 16 Sep 2020 09:27:31 GMT expires: - '-1' pragma: @@ -263,7 +254,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - a15386c7-83da-400c-bd86-167dc4f87c31 + - 03172e5e-5074-401d-92bb-4ae717711e2d status: code: 200 message: OK @@ -271,20 +262,19 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexb4bb17db/subnets/subnetnamexb4bb17db?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexb4bb17db/subnets/subnetnamexb4bb17db?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"subnetnamexb4bb17db\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexb4bb17db/subnets/subnetnamexb4bb17db\"\ - ,\r\n \"etag\": \"W/\\\"6e54b4db-8221-422f-be19-50d5587b62e7\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"d3e703a0-31c7-4aa0-bbbe-ab48dc0d27af\\\"\",\r\n \ \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"\ addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\"\ : \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\ @@ -293,13 +283,13 @@ interactions: cache-control: - no-cache content-length: - - '615' + - '625' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:26:40 GMT + - Wed, 16 Sep 2020 09:27:31 GMT etag: - - W/"6e54b4db-8221-422f-be19-50d5587b62e7" + - W/"d3e703a0-31c7-4aa0-bbbe-ab48dc0d27af" expires: - '-1' pragma: @@ -316,14 +306,14 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 4ee19a54-ec74-42b6-ae12-b227202935f3 + - 3d2d66fb-ddb8-4e8e-acbb-edcad377cb4f status: code: 200 message: OK - request: - body: 'b''{"location": "eastus", "sku": {"name": "Standard_D1_v2", "tier": "Standard", - "capacity": 1}, "properties": {"upgradePolicy": {"mode": "Manual", "rollingUpgradePolicy": - {"maxUnhealthyInstancePercent": 100, "maxUnhealthyUpgradedInstancePercent": + body: 'b''b\''{"location": "eastus", "sku": {"name": "Standard_D1_v2", "tier": + "Standard", "capacity": 1}, "properties": {"upgradePolicy": {"mode": "Manual", + "rollingUpgradePolicy": {"maxUnhealthyInstancePercent": 100, "maxUnhealthyUpgradedInstancePercent": 100}}, "virtualMachineProfile": {"osProfile": {"computerNamePrefix": "testPC", "adminUsername": "testuser", "adminPassword": "Aa!1()-xyz"}, "storageProfile": {"imageReference": {"publisher": "MicrosoftWindowsServer", "offer": "WindowsServer", @@ -332,7 +322,7 @@ interactions: "Standard_LRS"}}}, "networkProfile": {"networkInterfaceConfigurations": [{"name": "testPC", "properties": {"primary": true, "ipConfigurations": [{"name": "testPC", "properties": {"subnet": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexb4bb17db/subnets/subnetnamexb4bb17db"}}}]}}]}}, - "overprovision": true}}''' + "overprovision": true}}\''''' headers: Accept: - application/json @@ -341,13 +331,13 @@ interactions: Connection: - keep-alive Content-Length: - - '1113' + - '1123' Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb4bb17db?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb4bb17db?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"virtualmachinescalesetb4bb17db\",\r\n \"id\": \"\ @@ -385,20 +375,20 @@ interactions: : {}\r\n }\r\n }\r\n ]\r\n }\r\n },\r\n\ \ \"provisioningState\": \"Creating\",\r\n \"overprovision\": true,\r\ \n \"doNotRunExtensionsOnOverprovisionedVMs\": false,\r\n \"uniqueId\"\ - : \"239c265a-ea6d-434c-9f32-17f3b0b5a47e\"\r\n }\r\n}" + : \"e828c0db-fb12-43b8-bf67-2f7a4a6e46c3\"\r\n }\r\n}" headers: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d57ba76b-20ae-4482-a689-baa059c29743?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/fed88982-a411-420e-ad44-fbc686213556?api-version=2020-06-01 cache-control: - no-cache content-length: - - '2780' + - '2800' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:26:50 GMT + - Wed, 16 Sep 2020 09:27:46 GMT expires: - '-1' pragma: @@ -411,9 +401,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/CreateVMScaleSet3Min;143,Microsoft.Compute/CreateVMScaleSet30Min;720,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;2885,Microsoft.Compute/VmssQueuedVMOperations;4798 + - Microsoft.Compute/CreateVMScaleSet3Min;59,Microsoft.Compute/CreateVMScaleSet30Min;297,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;1197,Microsoft.Compute/VmssQueuedVMOperations;4798 x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' x-ms-request-charge: - '2' status: @@ -429,13 +419,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d57ba76b-20ae-4482-a689-baa059c29743?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/fed88982-a411-420e-ad44-fbc686213556?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:26:49.3683751+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"d57ba76b-20ae-4482-a689-baa059c29743\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:27:45.5236326+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"fed88982-a411-420e-ad44-fbc686213556\"\ \r\n}" headers: cache-control: @@ -445,7 +435,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:27:00 GMT + - Wed, 16 Sep 2020 09:27:56 GMT expires: - '-1' pragma: @@ -462,7 +452,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14999,Microsoft.Compute/GetOperation30Min;29999 + - Microsoft.Compute/GetOperation3Min;14995,Microsoft.Compute/GetOperation30Min;29886 status: code: 200 message: OK @@ -476,13 +466,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d57ba76b-20ae-4482-a689-baa059c29743?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/fed88982-a411-420e-ad44-fbc686213556?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:26:49.3683751+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"d57ba76b-20ae-4482-a689-baa059c29743\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:27:45.5236326+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"fed88982-a411-420e-ad44-fbc686213556\"\ \r\n}" headers: cache-control: @@ -492,7 +482,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:28:37 GMT + - Wed, 16 Sep 2020 09:29:34 GMT expires: - '-1' pragma: @@ -509,7 +499,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14998,Microsoft.Compute/GetOperation30Min;29998 + - Microsoft.Compute/GetOperation3Min;14997,Microsoft.Compute/GetOperation30Min;29885 status: code: 200 message: OK @@ -523,13 +513,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d57ba76b-20ae-4482-a689-baa059c29743?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/fed88982-a411-420e-ad44-fbc686213556?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:26:49.3683751+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"d57ba76b-20ae-4482-a689-baa059c29743\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:27:45.5236326+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"fed88982-a411-420e-ad44-fbc686213556\"\ \r\n}" headers: cache-control: @@ -539,7 +529,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:29:07 GMT + - Wed, 16 Sep 2020 09:30:07 GMT expires: - '-1' pragma: @@ -556,7 +546,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14996,Microsoft.Compute/GetOperation30Min;29996 + - Microsoft.Compute/GetOperation3Min;14996,Microsoft.Compute/GetOperation30Min;29911 status: code: 200 message: OK @@ -570,13 +560,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d57ba76b-20ae-4482-a689-baa059c29743?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/fed88982-a411-420e-ad44-fbc686213556?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:26:49.3683751+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"d57ba76b-20ae-4482-a689-baa059c29743\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:27:45.5236326+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"fed88982-a411-420e-ad44-fbc686213556\"\ \r\n}" headers: cache-control: @@ -586,7 +576,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:29:38 GMT + - Wed, 16 Sep 2020 09:30:37 GMT expires: - '-1' pragma: @@ -603,7 +593,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14995,Microsoft.Compute/GetOperation30Min;29995 + - Microsoft.Compute/GetOperation3Min;14996,Microsoft.Compute/GetOperation30Min;29910 status: code: 200 message: OK @@ -617,13 +607,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d57ba76b-20ae-4482-a689-baa059c29743?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/fed88982-a411-420e-ad44-fbc686213556?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:26:49.3683751+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"d57ba76b-20ae-4482-a689-baa059c29743\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:27:45.5236326+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"fed88982-a411-420e-ad44-fbc686213556\"\ \r\n}" headers: cache-control: @@ -633,7 +623,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:30:08 GMT + - Wed, 16 Sep 2020 09:31:07 GMT expires: - '-1' pragma: @@ -650,7 +640,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14995,Microsoft.Compute/GetOperation30Min;29994 + - Microsoft.Compute/GetOperation3Min;14995,Microsoft.Compute/GetOperation30Min;29909 status: code: 200 message: OK @@ -664,13 +654,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d57ba76b-20ae-4482-a689-baa059c29743?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/fed88982-a411-420e-ad44-fbc686213556?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:26:49.3683751+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"d57ba76b-20ae-4482-a689-baa059c29743\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:27:45.5236326+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"fed88982-a411-420e-ad44-fbc686213556\"\ \r\n}" headers: cache-control: @@ -680,7 +670,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:30:38 GMT + - Wed, 16 Sep 2020 09:31:51 GMT expires: - '-1' pragma: @@ -697,7 +687,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14994,Microsoft.Compute/GetOperation30Min;29993 + - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29907 status: code: 200 message: OK @@ -711,13 +701,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d57ba76b-20ae-4482-a689-baa059c29743?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/fed88982-a411-420e-ad44-fbc686213556?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:26:49.3683751+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"d57ba76b-20ae-4482-a689-baa059c29743\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:27:45.5236326+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"fed88982-a411-420e-ad44-fbc686213556\"\ \r\n}" headers: cache-control: @@ -727,7 +717,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:31:09 GMT + - Wed, 16 Sep 2020 09:32:23 GMT expires: - '-1' pragma: @@ -744,7 +734,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14992,Microsoft.Compute/GetOperation30Min;29991 + - Microsoft.Compute/GetOperation3Min;14992,Microsoft.Compute/GetOperation30Min;29906 status: code: 200 message: OK @@ -758,13 +748,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d57ba76b-20ae-4482-a689-baa059c29743?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/fed88982-a411-420e-ad44-fbc686213556?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:26:49.3683751+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"d57ba76b-20ae-4482-a689-baa059c29743\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:27:45.5236326+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"fed88982-a411-420e-ad44-fbc686213556\"\ \r\n}" headers: cache-control: @@ -774,7 +764,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:31:39 GMT + - Wed, 16 Sep 2020 09:32:58 GMT expires: - '-1' pragma: @@ -791,7 +781,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29990 + - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29905 status: code: 200 message: OK @@ -805,14 +795,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d57ba76b-20ae-4482-a689-baa059c29743?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/fed88982-a411-420e-ad44-fbc686213556?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:26:49.3683751+00:00\",\r\n \"\ - endTime\": \"2020-05-19T03:31:56.4327904+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"d57ba76b-20ae-4482-a689-baa059c29743\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T09:27:45.5236326+00:00\",\r\n \"\ + endTime\": \"2020-09-16T09:33:02.8696477+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"fed88982-a411-420e-ad44-fbc686213556\"\r\n}" headers: cache-control: - no-cache @@ -821,7 +811,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:32:09 GMT + - Wed, 16 Sep 2020 09:33:39 GMT expires: - '-1' pragma: @@ -838,7 +828,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14992,Microsoft.Compute/GetOperation30Min;29988 + - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29903 status: code: 200 message: OK @@ -852,9 +842,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb4bb17db?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb4bb17db?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"virtualmachinescalesetb4bb17db\",\r\n \"id\": \"\ @@ -892,16 +882,16 @@ interactions: : {}\r\n }\r\n }\r\n ]\r\n }\r\n },\r\n\ \ \"provisioningState\": \"Succeeded\",\r\n \"overprovision\": true,\r\ \n \"doNotRunExtensionsOnOverprovisionedVMs\": false,\r\n \"uniqueId\"\ - : \"239c265a-ea6d-434c-9f32-17f3b0b5a47e\"\r\n }\r\n}" + : \"e828c0db-fb12-43b8-bf67-2f7a4a6e46c3\"\r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '2781' + - '2801' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:32:09 GMT + - Wed, 16 Sep 2020 09:33:40 GMT expires: - '-1' pragma: @@ -918,7 +908,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetVMScaleSet3Min;396,Microsoft.Compute/GetVMScaleSet30Min;2596 + - Microsoft.Compute/GetVMScaleSet3Min;395,Microsoft.Compute/GetVMScaleSet30Min;2572 status: code: 200 message: OK @@ -934,25 +924,25 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb4bb17db/extensionRollingUpgrade?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb4bb17db/extensionRollingUpgrade?api-version=2020-06-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3eabfb27-e0b2-42ab-aa14-456b615d2e0d?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7ac9039a-c24f-4be8-82fa-13161e6ed992?api-version=2020-06-01 cache-control: - no-cache content-length: - '0' date: - - Tue, 19 May 2020 03:32:09 GMT + - Wed, 16 Sep 2020 09:33:41 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3eabfb27-e0b2-42ab-aa14-456b615d2e0d?monitor=true&api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7ac9039a-c24f-4be8-82fa-13161e6ed992?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -963,7 +953,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/VMScaleSetActions3Min;239,Microsoft.Compute/VMScaleSetActions30Min;1199,Microsoft.Compute/VmssQueuedVMOperations;4800 + - Microsoft.Compute/VMScaleSetActions3Min;239,Microsoft.Compute/VMScaleSetActions30Min;1165,Microsoft.Compute/VmssQueuedVMOperations;4800 x-ms-ratelimit-remaining-subscription-writes: - '1199' x-ms-request-charge: @@ -981,60 +971,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3eabfb27-e0b2-42ab-aa14-456b615d2e0d?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-05-19T03:32:10.3077848+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3eabfb27-e0b2-42ab-aa14-456b615d2e0d\"\ - \r\n}" - headers: - cache-control: - - no-cache - content-length: - - '134' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 19 May 2020 03:32:40 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14991,Microsoft.Compute/GetOperation30Min;29986 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3eabfb27-e0b2-42ab-aa14-456b615d2e0d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7ac9039a-c24f-4be8-82fa-13161e6ed992?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:32:10.3077848+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3eabfb27-e0b2-42ab-aa14-456b615d2e0d\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:33:41.7448383+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"7ac9039a-c24f-4be8-82fa-13161e6ed992\"\ \r\n}" headers: cache-control: @@ -1044,7 +987,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:33:10 GMT + - Wed, 16 Sep 2020 09:34:12 GMT expires: - '-1' pragma: @@ -1061,7 +1004,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14989,Microsoft.Compute/GetOperation30Min;29983 + - Microsoft.Compute/GetOperation3Min;14992,Microsoft.Compute/GetOperation30Min;29901 status: code: 200 message: OK @@ -1075,13 +1018,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3eabfb27-e0b2-42ab-aa14-456b615d2e0d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7ac9039a-c24f-4be8-82fa-13161e6ed992?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:32:10.3077848+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3eabfb27-e0b2-42ab-aa14-456b615d2e0d\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:33:41.7448383+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"7ac9039a-c24f-4be8-82fa-13161e6ed992\"\ \r\n}" headers: cache-control: @@ -1091,7 +1034,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:33:40 GMT + - Wed, 16 Sep 2020 09:34:43 GMT expires: - '-1' pragma: @@ -1108,7 +1051,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14988,Microsoft.Compute/GetOperation30Min;29980 + - Microsoft.Compute/GetOperation3Min;14991,Microsoft.Compute/GetOperation30Min;29898 status: code: 200 message: OK @@ -1122,13 +1065,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3eabfb27-e0b2-42ab-aa14-456b615d2e0d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7ac9039a-c24f-4be8-82fa-13161e6ed992?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:32:10.3077848+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3eabfb27-e0b2-42ab-aa14-456b615d2e0d\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:33:41.7448383+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"7ac9039a-c24f-4be8-82fa-13161e6ed992\"\ \r\n}" headers: cache-control: @@ -1138,7 +1081,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:34:10 GMT + - Wed, 16 Sep 2020 09:35:13 GMT expires: - '-1' pragma: @@ -1155,7 +1098,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29977 + - Microsoft.Compute/GetOperation3Min;14989,Microsoft.Compute/GetOperation30Min;29924 status: code: 200 message: OK @@ -1169,13 +1112,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3eabfb27-e0b2-42ab-aa14-456b615d2e0d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7ac9039a-c24f-4be8-82fa-13161e6ed992?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:32:10.3077848+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3eabfb27-e0b2-42ab-aa14-456b615d2e0d\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:33:41.7448383+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"7ac9039a-c24f-4be8-82fa-13161e6ed992\"\ \r\n}" headers: cache-control: @@ -1185,7 +1128,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:34:40 GMT + - Wed, 16 Sep 2020 09:35:44 GMT expires: - '-1' pragma: @@ -1202,7 +1145,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29974 + - Microsoft.Compute/GetOperation3Min;14987,Microsoft.Compute/GetOperation30Min;29921 status: code: 200 message: OK @@ -1216,13 +1159,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3eabfb27-e0b2-42ab-aa14-456b615d2e0d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7ac9039a-c24f-4be8-82fa-13161e6ed992?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:32:10.3077848+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3eabfb27-e0b2-42ab-aa14-456b615d2e0d\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:33:41.7448383+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"7ac9039a-c24f-4be8-82fa-13161e6ed992\"\ \r\n}" headers: cache-control: @@ -1232,7 +1175,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:35:10 GMT + - Wed, 16 Sep 2020 09:36:14 GMT expires: - '-1' pragma: @@ -1249,7 +1192,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29971 + - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29918 status: code: 200 message: OK @@ -1263,13 +1206,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3eabfb27-e0b2-42ab-aa14-456b615d2e0d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7ac9039a-c24f-4be8-82fa-13161e6ed992?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:32:10.3077848+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3eabfb27-e0b2-42ab-aa14-456b615d2e0d\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:33:41.7448383+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"7ac9039a-c24f-4be8-82fa-13161e6ed992\"\ \r\n}" headers: cache-control: @@ -1279,7 +1222,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:35:41 GMT + - Wed, 16 Sep 2020 09:36:45 GMT expires: - '-1' pragma: @@ -1296,7 +1239,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29969 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29915 status: code: 200 message: OK @@ -1310,13 +1253,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3eabfb27-e0b2-42ab-aa14-456b615d2e0d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7ac9039a-c24f-4be8-82fa-13161e6ed992?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:32:10.3077848+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3eabfb27-e0b2-42ab-aa14-456b615d2e0d\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:33:41.7448383+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"7ac9039a-c24f-4be8-82fa-13161e6ed992\"\ \r\n}" headers: cache-control: @@ -1326,7 +1269,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:36:11 GMT + - Wed, 16 Sep 2020 09:37:15 GMT expires: - '-1' pragma: @@ -1343,7 +1286,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29966 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29912 status: code: 200 message: OK @@ -1357,13 +1300,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3eabfb27-e0b2-42ab-aa14-456b615d2e0d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7ac9039a-c24f-4be8-82fa-13161e6ed992?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:32:10.3077848+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3eabfb27-e0b2-42ab-aa14-456b615d2e0d\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:33:41.7448383+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"7ac9039a-c24f-4be8-82fa-13161e6ed992\"\ \r\n}" headers: cache-control: @@ -1373,7 +1316,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:36:41 GMT + - Wed, 16 Sep 2020 09:37:45 GMT expires: - '-1' pragma: @@ -1390,7 +1333,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29963 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29909 status: code: 200 message: OK @@ -1404,13 +1347,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3eabfb27-e0b2-42ab-aa14-456b615d2e0d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7ac9039a-c24f-4be8-82fa-13161e6ed992?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:32:10.3077848+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3eabfb27-e0b2-42ab-aa14-456b615d2e0d\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:33:41.7448383+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"7ac9039a-c24f-4be8-82fa-13161e6ed992\"\ \r\n}" headers: cache-control: @@ -1420,7 +1363,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:37:12 GMT + - Wed, 16 Sep 2020 09:38:15 GMT expires: - '-1' pragma: @@ -1437,7 +1380,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29960 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29907 status: code: 200 message: OK @@ -1451,13 +1394,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3eabfb27-e0b2-42ab-aa14-456b615d2e0d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7ac9039a-c24f-4be8-82fa-13161e6ed992?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:32:10.3077848+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3eabfb27-e0b2-42ab-aa14-456b615d2e0d\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:33:41.7448383+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"7ac9039a-c24f-4be8-82fa-13161e6ed992\"\ \r\n}" headers: cache-control: @@ -1467,7 +1410,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:37:42 GMT + - Wed, 16 Sep 2020 09:38:46 GMT expires: - '-1' pragma: @@ -1484,7 +1427,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29957 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29904 status: code: 200 message: OK @@ -1498,13 +1441,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3eabfb27-e0b2-42ab-aa14-456b615d2e0d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7ac9039a-c24f-4be8-82fa-13161e6ed992?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:32:10.3077848+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3eabfb27-e0b2-42ab-aa14-456b615d2e0d\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:33:41.7448383+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"7ac9039a-c24f-4be8-82fa-13161e6ed992\"\ \r\n}" headers: cache-control: @@ -1514,7 +1457,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:38:11 GMT + - Wed, 16 Sep 2020 09:39:17 GMT expires: - '-1' pragma: @@ -1531,7 +1474,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29954 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29901 status: code: 200 message: OK @@ -1545,13 +1488,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3eabfb27-e0b2-42ab-aa14-456b615d2e0d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7ac9039a-c24f-4be8-82fa-13161e6ed992?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:32:10.3077848+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3eabfb27-e0b2-42ab-aa14-456b615d2e0d\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:33:41.7448383+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"7ac9039a-c24f-4be8-82fa-13161e6ed992\"\ \r\n}" headers: cache-control: @@ -1561,7 +1504,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:38:42 GMT + - Wed, 16 Sep 2020 09:39:47 GMT expires: - '-1' pragma: @@ -1578,7 +1521,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29952 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29898 status: code: 200 message: OK @@ -1592,13 +1535,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3eabfb27-e0b2-42ab-aa14-456b615d2e0d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7ac9039a-c24f-4be8-82fa-13161e6ed992?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:32:10.3077848+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3eabfb27-e0b2-42ab-aa14-456b615d2e0d\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:33:41.7448383+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"7ac9039a-c24f-4be8-82fa-13161e6ed992\"\ \r\n}" headers: cache-control: @@ -1608,7 +1551,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:39:12 GMT + - Wed, 16 Sep 2020 09:40:17 GMT expires: - '-1' pragma: @@ -1625,7 +1568,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29949 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29920 status: code: 200 message: OK @@ -1639,13 +1582,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3eabfb27-e0b2-42ab-aa14-456b615d2e0d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7ac9039a-c24f-4be8-82fa-13161e6ed992?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:32:10.3077848+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3eabfb27-e0b2-42ab-aa14-456b615d2e0d\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:33:41.7448383+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"7ac9039a-c24f-4be8-82fa-13161e6ed992\"\ \r\n}" headers: cache-control: @@ -1655,7 +1598,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:39:43 GMT + - Wed, 16 Sep 2020 09:40:47 GMT expires: - '-1' pragma: @@ -1672,7 +1615,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29946 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29918 status: code: 200 message: OK @@ -1686,13 +1629,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3eabfb27-e0b2-42ab-aa14-456b615d2e0d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7ac9039a-c24f-4be8-82fa-13161e6ed992?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:32:10.3077848+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3eabfb27-e0b2-42ab-aa14-456b615d2e0d\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:33:41.7448383+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"7ac9039a-c24f-4be8-82fa-13161e6ed992\"\ \r\n}" headers: cache-control: @@ -1702,7 +1645,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:40:13 GMT + - Wed, 16 Sep 2020 09:41:18 GMT expires: - '-1' pragma: @@ -1719,7 +1662,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29943 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29915 status: code: 200 message: OK @@ -1733,13 +1676,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3eabfb27-e0b2-42ab-aa14-456b615d2e0d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7ac9039a-c24f-4be8-82fa-13161e6ed992?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:32:10.3077848+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3eabfb27-e0b2-42ab-aa14-456b615d2e0d\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:33:41.7448383+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"7ac9039a-c24f-4be8-82fa-13161e6ed992\"\ \r\n}" headers: cache-control: @@ -1749,7 +1692,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:40:43 GMT + - Wed, 16 Sep 2020 09:41:49 GMT expires: - '-1' pragma: @@ -1766,7 +1709,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29940 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29912 status: code: 200 message: OK @@ -1780,13 +1723,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3eabfb27-e0b2-42ab-aa14-456b615d2e0d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7ac9039a-c24f-4be8-82fa-13161e6ed992?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:32:10.3077848+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3eabfb27-e0b2-42ab-aa14-456b615d2e0d\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:33:41.7448383+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"7ac9039a-c24f-4be8-82fa-13161e6ed992\"\ \r\n}" headers: cache-control: @@ -1796,7 +1739,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:41:14 GMT + - Wed, 16 Sep 2020 09:42:19 GMT expires: - '-1' pragma: @@ -1813,7 +1756,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29937 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29909 status: code: 200 message: OK @@ -1827,13 +1770,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3eabfb27-e0b2-42ab-aa14-456b615d2e0d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7ac9039a-c24f-4be8-82fa-13161e6ed992?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:32:10.3077848+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3eabfb27-e0b2-42ab-aa14-456b615d2e0d\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:33:41.7448383+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"7ac9039a-c24f-4be8-82fa-13161e6ed992\"\ \r\n}" headers: cache-control: @@ -1843,7 +1786,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:41:44 GMT + - Wed, 16 Sep 2020 09:42:49 GMT expires: - '-1' pragma: @@ -1860,7 +1803,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29934 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29906 status: code: 200 message: OK @@ -1874,13 +1817,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3eabfb27-e0b2-42ab-aa14-456b615d2e0d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7ac9039a-c24f-4be8-82fa-13161e6ed992?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:32:10.3077848+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3eabfb27-e0b2-42ab-aa14-456b615d2e0d\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:33:41.7448383+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"7ac9039a-c24f-4be8-82fa-13161e6ed992\"\ \r\n}" headers: cache-control: @@ -1890,7 +1833,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:42:13 GMT + - Wed, 16 Sep 2020 09:43:19 GMT expires: - '-1' pragma: @@ -1907,7 +1850,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29931 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29903 status: code: 200 message: OK @@ -1921,23 +1864,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3eabfb27-e0b2-42ab-aa14-456b615d2e0d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7ac9039a-c24f-4be8-82fa-13161e6ed992?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:32:10.3077848+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3eabfb27-e0b2-42ab-aa14-456b615d2e0d\"\ - \r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T09:33:41.7448383+00:00\",\r\n \"\ + endTime\": \"2020-09-16T09:43:41.9520308+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"7ac9039a-c24f-4be8-82fa-13161e6ed992\"\r\n}" headers: cache-control: - no-cache content-length: - - '134' + - '184' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:42:44 GMT + - Wed, 16 Sep 2020 09:43:50 GMT expires: - '-1' pragma: @@ -1954,7 +1897,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29929 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29901 status: code: 200 message: OK @@ -1968,23 +1911,19 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3eabfb27-e0b2-42ab-aa14-456b615d2e0d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7ac9039a-c24f-4be8-82fa-13161e6ed992?monitor=true&api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:32:10.3077848+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3eabfb27-e0b2-42ab-aa14-456b615d2e0d\"\ - \r\n}" + string: '' headers: cache-control: - no-cache content-length: - - '134' - content-type: - - application/json; charset=utf-8 + - '0' date: - - Tue, 19 May 2020 03:43:14 GMT + - Wed, 16 Sep 2020 09:43:50 GMT expires: - '-1' pragma: @@ -1994,14 +1933,10 @@ interactions: - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29926 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29900 status: code: 200 message: OK @@ -2014,26 +1949,28 @@ interactions: - gzip, deflate Connection: - keep-alive + Content-Length: + - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3eabfb27-e0b2-42ab-aa14-456b615d2e0d?api-version=2019-12-01 + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb4bb17db/osRollingUpgrade?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:32:10.3077848+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3eabfb27-e0b2-42ab-aa14-456b615d2e0d\"\ - \r\n}" + string: '' headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3dfbefdb-6529-43e9-bf28-174ff5ee2810?api-version=2020-06-01 cache-control: - no-cache content-length: - - '134' - content-type: - - application/json; charset=utf-8 + - '0' date: - - Tue, 19 May 2020 03:43:45 GMT + - Wed, 16 Sep 2020 09:43:50 GMT expires: - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3dfbefdb-6529-43e9-bf28-174ff5ee2810?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -2041,44 +1978,51 @@ interactions: - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29923 + - Microsoft.Compute/VMScaleSetActions3Min;239,Microsoft.Compute/VMScaleSetActions30Min;1167,Microsoft.Compute/VmssQueuedVMOperations;4800 + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + x-ms-request-charge: + - '0' status: - code: 200 - message: OK + code: 202 + message: Accepted - request: body: null headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3eabfb27-e0b2-42ab-aa14-456b615d2e0d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb4bb17db/rollingUpgrades/latest?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:32:10.3077848+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3eabfb27-e0b2-42ab-aa14-456b615d2e0d\"\ - \r\n}" + string: "{\r\n \"type\": \"Microsoft.Compute/virtualMachineScaleSets/rollingUpgrades\"\ + ,\r\n \"location\": \"eastus\",\r\n \"properties\": {\r\n \"policy\"\ + : {\r\n \"maxBatchInstancePercent\": 20,\r\n \"maxUnhealthyInstancePercent\"\ + : 100,\r\n \"maxUnhealthyUpgradedInstancePercent\": 100,\r\n \"\ + pauseTimeBetweenBatches\": \"PT0S\"\r\n },\r\n \"runningStatus\": {\r\ + \n \"lastAction\": \"Start\",\r\n \"lastActionTime\": \"2020-09-16T09:43:51.3895503+00:00\"\ + ,\r\n \"code\": \"RollingForward\",\r\n \"startTime\": \"2020-09-16T09:43:51.4364689+00:00\"\ + \r\n },\r\n \"progress\": {\r\n \"successfulInstanceCount\": 0,\r\ + \n \"failedInstanceCount\": 0,\r\n \"inProgressInstanceCount\":\ + \ 1,\r\n \"pendingInstanceCount\": 0\r\n }\r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '134' + - '702' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:44:15 GMT + - Wed, 16 Sep 2020 09:43:51 GMT expires: - '-1' pragma: @@ -2095,7 +2039,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29920 + - Microsoft.Compute/GetVMScaleSet3Min;395,Microsoft.Compute/GetVMScaleSet30Min;2563 status: code: 200 message: OK @@ -2108,26 +2052,28 @@ interactions: - gzip, deflate Connection: - keep-alive + Content-Length: + - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3eabfb27-e0b2-42ab-aa14-456b615d2e0d?api-version=2019-12-01 + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb4bb17db/rollingUpgrades/cancel?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:32:10.3077848+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3eabfb27-e0b2-42ab-aa14-456b615d2e0d\"\ - \r\n}" + string: '' headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e3a2fae5-72ad-43b2-a832-c4af0d77107d?api-version=2020-06-01 cache-control: - no-cache content-length: - - '134' - content-type: - - application/json; charset=utf-8 + - '0' date: - - Tue, 19 May 2020 03:44:45 GMT + - Wed, 16 Sep 2020 09:43:51 GMT expires: - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e3a2fae5-72ad-43b2-a832-c4af0d77107d?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -2135,17 +2081,17 @@ interactions: - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29917 + - Microsoft.Compute/VMScaleSetActions3Min;238,Microsoft.Compute/VMScaleSetActions30Min;1166,Microsoft.Compute/VmssQueuedVMOperations;4800 + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + x-ms-request-charge: + - '0' status: - code: 200 - message: OK + code: 202 + message: Accepted - request: body: null headers: @@ -2156,23 +2102,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3eabfb27-e0b2-42ab-aa14-456b615d2e0d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3dfbefdb-6529-43e9-bf28-174ff5ee2810?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:32:10.3077848+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3eabfb27-e0b2-42ab-aa14-456b615d2e0d\"\ - \r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T09:43:51.3270771+00:00\",\r\n \"\ + endTime\": \"2020-09-16T09:43:52.2489361+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"3dfbefdb-6529-43e9-bf28-174ff5ee2810\"\r\n}" headers: cache-control: - no-cache content-length: - - '134' + - '184' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:45:14 GMT + - Wed, 16 Sep 2020 09:44:21 GMT expires: - '-1' pragma: @@ -2189,7 +2135,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29915 + - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29896 status: code: 200 message: OK @@ -2203,23 +2149,19 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3eabfb27-e0b2-42ab-aa14-456b615d2e0d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3dfbefdb-6529-43e9-bf28-174ff5ee2810?monitor=true&api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:32:10.3077848+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3eabfb27-e0b2-42ab-aa14-456b615d2e0d\"\ - \r\n}" + string: '' headers: cache-control: - no-cache content-length: - - '134' - content-type: - - application/json; charset=utf-8 + - '0' date: - - Tue, 19 May 2020 03:45:45 GMT + - Wed, 16 Sep 2020 09:44:21 GMT expires: - '-1' pragma: @@ -2229,14 +2171,10 @@ interactions: - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29912 + - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29895 status: code: 200 message: OK @@ -2250,23 +2188,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3eabfb27-e0b2-42ab-aa14-456b615d2e0d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e3a2fae5-72ad-43b2-a832-c4af0d77107d?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:32:10.3077848+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3eabfb27-e0b2-42ab-aa14-456b615d2e0d\"\ - \r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T09:43:52.1708277+00:00\",\r\n \"\ + endTime\": \"2020-09-16T09:43:52.2489361+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"e3a2fae5-72ad-43b2-a832-c4af0d77107d\"\r\n}" headers: cache-control: - no-cache content-length: - - '134' + - '184' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:46:16 GMT + - Wed, 16 Sep 2020 09:44:21 GMT expires: - '-1' pragma: @@ -2283,7 +2221,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29909 + - Microsoft.Compute/GetOperation3Min;14980,Microsoft.Compute/GetOperation30Min;29894 status: code: 200 message: OK @@ -2297,23 +2235,19 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3eabfb27-e0b2-42ab-aa14-456b615d2e0d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e3a2fae5-72ad-43b2-a832-c4af0d77107d?monitor=true&api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:32:10.3077848+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3eabfb27-e0b2-42ab-aa14-456b615d2e0d\"\ - \r\n}" + string: '' headers: cache-control: - no-cache content-length: - - '134' - content-type: - - application/json; charset=utf-8 + - '0' date: - - Tue, 19 May 2020 03:46:45 GMT + - Wed, 16 Sep 2020 09:44:22 GMT expires: - '-1' pragma: @@ -2323,14 +2257,10 @@ interactions: - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29906 + - Microsoft.Compute/GetOperation3Min;14979,Microsoft.Compute/GetOperation30Min;29893 status: code: 200 message: OK @@ -2343,26 +2273,30 @@ interactions: - gzip, deflate Connection: - keep-alive + Content-Length: + - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3eabfb27-e0b2-42ab-aa14-456b615d2e0d?api-version=2019-12-01 + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb4bb17db?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:32:10.3077848+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3eabfb27-e0b2-42ab-aa14-456b615d2e0d\"\ - \r\n}" + string: '' headers: + azure-asyncnotification: + - Enabled + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/0a7702b2-8e91-4536-9b7e-40096f243f70?api-version=2020-06-01 cache-control: - no-cache content-length: - - '134' - content-type: - - application/json; charset=utf-8 + - '0' date: - - Tue, 19 May 2020 03:47:15 GMT + - Wed, 16 Sep 2020 09:44:22 GMT expires: - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/0a7702b2-8e91-4536-9b7e-40096f243f70?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -2370,17 +2304,17 @@ interactions: - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29903 + - Microsoft.Compute/DeleteVMScaleSet3Min;79,Microsoft.Compute/DeleteVMScaleSet30Min;397,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;1199,Microsoft.Compute/VmssQueuedVMOperations;4799 + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + x-ms-request-charge: + - '1' status: - code: 200 - message: OK + code: 202 + message: Accepted - request: body: null headers: @@ -2391,13 +2325,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3eabfb27-e0b2-42ab-aa14-456b615d2e0d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/0a7702b2-8e91-4536-9b7e-40096f243f70?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:32:10.3077848+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3eabfb27-e0b2-42ab-aa14-456b615d2e0d\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:44:23.5773006+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"0a7702b2-8e91-4536-9b7e-40096f243f70\"\ \r\n}" headers: cache-control: @@ -2407,7 +2341,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:47:46 GMT + - Wed, 16 Sep 2020 09:44:33 GMT expires: - '-1' pragma: @@ -2424,7 +2358,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29900 + - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29892 status: code: 200 message: OK @@ -2438,14 +2372,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3eabfb27-e0b2-42ab-aa14-456b615d2e0d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/0a7702b2-8e91-4536-9b7e-40096f243f70?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T03:48:08.0002725+00:00\",\r\n \"\ - endTime\": \"2020-05-19T03:48:08.0158923+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"3eabfb27-e0b2-42ab-aa14-456b615d2e0d\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T09:44:23.5773006+00:00\",\r\n \"\ + endTime\": \"2020-09-16T09:44:44.8117314+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"0a7702b2-8e91-4536-9b7e-40096f243f70\"\r\n}" headers: cache-control: - no-cache @@ -2454,331 +2388,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 03:48:16 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29898 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3eabfb27-e0b2-42ab-aa14-456b615d2e0d?monitor=true&api-version=2019-12-01 - response: - body: - string: '' - headers: - cache-control: - - no-cache - content-length: - - '0' - date: - - Tue, 19 May 2020 03:48:16 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29897 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb4bb17db/osRollingUpgrade?api-version=2019-12-01 - response: - body: - string: '' - headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b953485c-1075-4fb4-ae47-f5a1e275e1dc?api-version=2019-12-01 - cache-control: - - no-cache - content-length: - - '0' - date: - - Tue, 19 May 2020 03:48:17 GMT - expires: - - '-1' - location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b953485c-1075-4fb4-ae47-f5a1e275e1dc?monitor=true&api-version=2019-12-01 - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/VMScaleSetActions3Min;239,Microsoft.Compute/VMScaleSetActions30Min;1197,Microsoft.Compute/VmssQueuedVMOperations;4800 - x-ms-ratelimit-remaining-subscription-writes: - - '1198' - x-ms-request-charge: - - '0' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb4bb17db/rollingUpgrades/latest?api-version=2019-12-01 - response: - body: - string: "{\r\n \"type\": \"Microsoft.Compute/virtualMachineScaleSets/rollingUpgrades\"\ - ,\r\n \"location\": \"eastus\",\r\n \"properties\": {\r\n \"policy\"\ - : {\r\n \"maxBatchInstancePercent\": 20,\r\n \"maxUnhealthyInstancePercent\"\ - : 100,\r\n \"maxUnhealthyUpgradedInstancePercent\": 100,\r\n \"\ - pauseTimeBetweenBatches\": \"PT0S\"\r\n },\r\n \"runningStatus\": {\r\ - \n \"lastAction\": \"Start\",\r\n \"lastActionTime\": \"2020-05-19T03:48:17.6878581+00:00\"\ - ,\r\n \"code\": \"RollingForward\",\r\n \"startTime\": \"2020-05-19T03:48:17.7190873+00:00\"\ - \r\n },\r\n \"progress\": {\r\n \"successfulInstanceCount\": 0,\r\ - \n \"failedInstanceCount\": 0,\r\n \"inProgressInstanceCount\":\ - \ 1,\r\n \"pendingInstanceCount\": 0\r\n }\r\n }\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '702' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 19 May 2020 03:48:17 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetVMScaleSet3Min;398,Microsoft.Compute/GetVMScaleSet30Min;2586 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb4bb17db/rollingUpgrades/cancel?api-version=2019-12-01 - response: - body: - string: '' - headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/6f84f7c5-d220-4394-b291-e9127efe45d5?api-version=2019-12-01 - cache-control: - - no-cache - content-length: - - '0' - date: - - Tue, 19 May 2020 03:48:17 GMT - expires: - - '-1' - location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/6f84f7c5-d220-4394-b291-e9127efe45d5?monitor=true&api-version=2019-12-01 - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/VMScaleSetActions3Min;238,Microsoft.Compute/VMScaleSetActions30Min;1196,Microsoft.Compute/VmssQueuedVMOperations;4800 - x-ms-ratelimit-remaining-subscription-writes: - - '1197' - x-ms-request-charge: - - '0' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b953485c-1075-4fb4-ae47-f5a1e275e1dc?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-05-19T03:48:18.3909335+00:00\",\r\n \"\ - endTime\": \"2020-05-19T03:48:18.3909335+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"b953485c-1075-4fb4-ae47-f5a1e275e1dc\"\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '184' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 19 May 2020 03:48:47 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29893 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b953485c-1075-4fb4-ae47-f5a1e275e1dc?monitor=true&api-version=2019-12-01 - response: - body: - string: '' - headers: - cache-control: - - no-cache - content-length: - - '0' - date: - - Tue, 19 May 2020 03:48:47 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29892 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/6f84f7c5-d220-4394-b291-e9127efe45d5?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-05-19T03:48:18.3909335+00:00\",\r\n \"\ - endTime\": \"2020-05-19T03:48:18.4065588+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"6f84f7c5-d220-4394-b291-e9127efe45d5\"\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '184' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 19 May 2020 03:48:47 GMT + - Wed, 16 Sep 2020 09:44:45 GMT expires: - '-1' pragma: @@ -2799,564 +2409,4 @@ interactions: status: code: 200 message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/6f84f7c5-d220-4394-b291-e9127efe45d5?monitor=true&api-version=2019-12-01 - response: - body: - string: '' - headers: - cache-control: - - no-cache - content-length: - - '0' - date: - - Tue, 19 May 2020 03:48:47 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14979,Microsoft.Compute/GetOperation30Min;29890 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb4bb17db?api-version=2019-12-01 - response: - body: - string: '' - headers: - azure-asyncnotification: - - Enabled - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e3d1547e-263c-4365-b8cf-d160f9baf515?api-version=2019-12-01 - cache-control: - - no-cache - content-length: - - '0' - date: - - Tue, 19 May 2020 03:48:48 GMT - expires: - - '-1' - location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e3d1547e-263c-4365-b8cf-d160f9baf515?monitor=true&api-version=2019-12-01 - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/DeleteVMScaleSet3Min;79,Microsoft.Compute/DeleteVMScaleSet30Min;399,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;2886,Microsoft.Compute/VmssQueuedVMOperations;4799 - x-ms-ratelimit-remaining-subscription-deletes: - - '14998' - x-ms-request-charge: - - '1' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e3d1547e-263c-4365-b8cf-d160f9baf515?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-05-19T03:48:49.6411681+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"e3d1547e-263c-4365-b8cf-d160f9baf515\"\ - \r\n}" - headers: - cache-control: - - no-cache - content-length: - - '134' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 19 May 2020 03:48:59 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14978,Microsoft.Compute/GetOperation30Min;29889 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e3d1547e-263c-4365-b8cf-d160f9baf515?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-05-19T03:48:49.6411681+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"e3d1547e-263c-4365-b8cf-d160f9baf515\"\ - \r\n}" - headers: - cache-control: - - no-cache - content-length: - - '134' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 19 May 2020 03:49:10 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14980,Microsoft.Compute/GetOperation30Min;29888 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e3d1547e-263c-4365-b8cf-d160f9baf515?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-05-19T03:48:49.6411681+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"e3d1547e-263c-4365-b8cf-d160f9baf515\"\ - \r\n}" - headers: - cache-control: - - no-cache - content-length: - - '134' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 19 May 2020 03:49:41 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29887 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e3d1547e-263c-4365-b8cf-d160f9baf515?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-05-19T03:48:49.6411681+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"e3d1547e-263c-4365-b8cf-d160f9baf515\"\ - \r\n}" - headers: - cache-control: - - no-cache - content-length: - - '134' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 19 May 2020 03:50:11 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29886 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e3d1547e-263c-4365-b8cf-d160f9baf515?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-05-19T03:48:49.6411681+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"e3d1547e-263c-4365-b8cf-d160f9baf515\"\ - \r\n}" - headers: - cache-control: - - no-cache - content-length: - - '134' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 19 May 2020 03:50:41 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29885 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e3d1547e-263c-4365-b8cf-d160f9baf515?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-05-19T03:48:49.6411681+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"e3d1547e-263c-4365-b8cf-d160f9baf515\"\ - \r\n}" - headers: - cache-control: - - no-cache - content-length: - - '134' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 19 May 2020 03:51:11 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14987,Microsoft.Compute/GetOperation30Min;29883 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e3d1547e-263c-4365-b8cf-d160f9baf515?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-05-19T03:48:49.6411681+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"e3d1547e-263c-4365-b8cf-d160f9baf515\"\ - \r\n}" - headers: - cache-control: - - no-cache - content-length: - - '134' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 19 May 2020 03:51:42 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29882 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e3d1547e-263c-4365-b8cf-d160f9baf515?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-05-19T03:48:49.6411681+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"e3d1547e-263c-4365-b8cf-d160f9baf515\"\ - \r\n}" - headers: - cache-control: - - no-cache - content-length: - - '134' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 19 May 2020 03:52:12 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29881 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e3d1547e-263c-4365-b8cf-d160f9baf515?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-05-19T03:48:49.6411681+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"e3d1547e-263c-4365-b8cf-d160f9baf515\"\ - \r\n}" - headers: - cache-control: - - no-cache - content-length: - - '134' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 19 May 2020 03:52:41 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29880 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e3d1547e-263c-4365-b8cf-d160f9baf515?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-05-19T03:48:49.6411681+00:00\",\r\n \"\ - endTime\": \"2020-05-19T03:52:53.8144877+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"e3d1547e-263c-4365-b8cf-d160f9baf515\"\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '184' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 19 May 2020 03:53:12 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14991,Microsoft.Compute/GetOperation30Min;29877 - status: - code: 200 - message: OK version: 1 diff --git a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vmss.test_compute_vmss_vm.yaml b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vmss.test_compute_vmss_vm.yaml index 17ca40a757b3..624ac0019cfa 100644 --- a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vmss.test_compute_vmss_vm.yaml +++ b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vmss.test_compute_vmss_vm.yaml @@ -12,21 +12,18 @@ interactions: Content-Length: - '92' Content-Type: - - application/json; charset=utf-8 + - application/json User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex8c68120d?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex8c68120d?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"networknamex8c68120d\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex8c68120d\"\ - ,\r\n \"etag\": \"W/\\\"57a99a87-a12f-41a6-a207-eb500e955551\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"d78610bd-0949-4f43-8c1d-41f430cb7e79\\\"\",\r\n \ \ \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \ - \ \"resourceGuid\": \"2807da61-57a0-4037-b4e6-b136350203b4\",\r\n \"\ + \ \"resourceGuid\": \"c836bfbf-b0a4-4d08-9f4e-8bfa36c73d94\",\r\n \"\ addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\ \r\n ]\r\n },\r\n \"subnets\": [],\r\n \"virtualNetworkPeerings\"\ : [],\r\n \"enableDdosProtection\": false,\r\n \"enableVmProtection\"\ @@ -35,15 +32,15 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/e8687ea6-4437-4759-9d31-76aed7cc8008?api-version=2020-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/eb5823e1-a48b-49a8-936d-abdd21d13442?api-version=2020-06-01 cache-control: - no-cache content-length: - - '703' + - '727' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:53:40 GMT + - Wed, 16 Sep 2020 09:45:03 GMT expires: - '-1' pragma: @@ -56,7 +53,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - b6c78634-3193-4148-a72b-ec75d1dea5b2 + - e65003fa-6ed3-4e69-bbe6-469278fd60ed x-ms-ratelimit-remaining-subscription-writes: - '1199' status: @@ -66,16 +63,15 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/e8687ea6-4437-4759-9d31-76aed7cc8008?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/eb5823e1-a48b-49a8-936d-abdd21d13442?api-version=2020-06-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -87,7 +83,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:53:44 GMT + - Wed, 16 Sep 2020 09:45:07 GMT expires: - '-1' pragma: @@ -104,7 +100,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - fabb84b6-a145-4338-9dea-5e101efaca1c + - b724e322-a007-474f-8808-173f615b6154 status: code: 200 message: OK @@ -112,23 +108,22 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex8c68120d?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex8c68120d?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"networknamex8c68120d\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex8c68120d\"\ - ,\r\n \"etag\": \"W/\\\"1ad35a91-02bb-4cf8-8079-6e0feae65d28\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"381a9a1a-2f55-4d96-8b1c-5dfedd7511f0\\\"\",\r\n \ \ \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n\ - \ \"resourceGuid\": \"2807da61-57a0-4037-b4e6-b136350203b4\",\r\n \"\ + \ \"resourceGuid\": \"c836bfbf-b0a4-4d08-9f4e-8bfa36c73d94\",\r\n \"\ addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\ \r\n ]\r\n },\r\n \"subnets\": [],\r\n \"virtualNetworkPeerings\"\ : [],\r\n \"enableDdosProtection\": false,\r\n \"enableVmProtection\"\ @@ -137,13 +132,13 @@ interactions: cache-control: - no-cache content-length: - - '704' + - '728' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:53:44 GMT + - Wed, 16 Sep 2020 09:45:07 GMT etag: - - W/"1ad35a91-02bb-4cf8-8079-6e0feae65d28" + - W/"381a9a1a-2f55-4d96-8b1c-5dfedd7511f0" expires: - '-1' pragma: @@ -160,7 +155,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - be172afb-6c5e-4fdc-a357-47f6d3b45a66 + - cd3a943a-c0ca-460e-8481-bfc5207ead67 status: code: 200 message: OK @@ -176,33 +171,30 @@ interactions: Content-Length: - '48' Content-Type: - - application/json; charset=utf-8 + - application/json User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex8c68120d/subnets/subnetnamex8c68120d?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex8c68120d/subnets/subnetnamex8c68120d?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"subnetnamex8c68120d\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex8c68120d/subnets/subnetnamex8c68120d\"\ - ,\r\n \"etag\": \"W/\\\"850c4ebf-83dd-43e8-a598-869d552ad449\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"c25e67a3-70b4-495a-b9ba-92f608802d8d\\\"\",\r\n \ \ \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"\ addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\"\ : \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\ \n },\r\n \"type\": \"Microsoft.Network/virtualNetworks/subnets\"\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/3dd35df2-6a45-4be1-b6d6-42300f6e1146?api-version=2020-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/1a928338-6c64-4bb0-bea1-d67a73ced13f?api-version=2020-06-01 cache-control: - no-cache content-length: - - '600' + - '624' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:53:45 GMT + - Wed, 16 Sep 2020 09:45:08 GMT expires: - '-1' pragma: @@ -215,7 +207,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 718d7901-37f4-49db-989d-d4ed9e9ff1dc + - 0e54973a-6331-46e2-b40e-ec9b046b0950 x-ms-ratelimit-remaining-subscription-writes: - '1198' status: @@ -225,16 +217,15 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/3dd35df2-6a45-4be1-b6d6-42300f6e1146?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/1a928338-6c64-4bb0-bea1-d67a73ced13f?api-version=2020-06-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -246,7 +237,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:53:49 GMT + - Wed, 16 Sep 2020 09:45:11 GMT expires: - '-1' pragma: @@ -263,7 +254,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 892da797-91b7-4e68-94cf-e7846d0ed4f0 + - 44668367-d599-4633-b680-bf1506cd7ac3 status: code: 200 message: OK @@ -271,20 +262,19 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex8c68120d/subnets/subnetnamex8c68120d?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex8c68120d/subnets/subnetnamex8c68120d?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"subnetnamex8c68120d\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex8c68120d/subnets/subnetnamex8c68120d\"\ - ,\r\n \"etag\": \"W/\\\"1725bdce-5423-4c19-9f28-0b6223110709\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"1eeb70a9-7c0e-4323-8563-b1bf7f800f63\\\"\",\r\n \ \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"\ addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\"\ : \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\ @@ -293,13 +283,13 @@ interactions: cache-control: - no-cache content-length: - - '601' + - '625' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:53:50 GMT + - Wed, 16 Sep 2020 09:45:11 GMT etag: - - W/"1725bdce-5423-4c19-9f28-0b6223110709" + - W/"1eeb70a9-7c0e-4323-8563-b1bf7f800f63" expires: - '-1' pragma: @@ -316,22 +306,22 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 8d09a6f5-4d62-4592-b3f9-b317186e3df3 + - 84ee3bbb-39d6-41b9-b678-3d936161aeea status: code: 200 message: OK - request: - body: 'b''{"location": "eastus", "sku": {"name": "Standard_D1_v2", "tier": "Standard", - "capacity": 1}, "properties": {"upgradePolicy": {"mode": "Manual"}, "virtualMachineProfile": - {"osProfile": {"computerNamePrefix": "testPC", "adminUsername": "testuser", - "adminPassword": "Aa!1()-xyz"}, "storageProfile": {"imageReference": {"publisher": - "MicrosoftWindowsServer", "offer": "WindowsServer", "sku": "2016-Datacenter", + body: 'b''b\''{"location": "eastus", "sku": {"name": "Standard_D1_v2", "tier": + "Standard", "capacity": 1}, "properties": {"upgradePolicy": {"mode": "Manual"}, + "virtualMachineProfile": {"osProfile": {"computerNamePrefix": "testPC", "adminUsername": + "testuser", "adminPassword": "Aa!1()-xyz"}, "storageProfile": {"imageReference": + {"publisher": "MicrosoftWindowsServer", "offer": "WindowsServer", "sku": "2016-Datacenter", "version": "latest"}, "osDisk": {"caching": "ReadWrite", "createOption": "FromImage", "diskSizeGB": 512, "managedDisk": {"storageAccountType": "Standard_LRS"}}}, "networkProfile": {"networkInterfaceConfigurations": [{"name": "testPC", "properties": {"primary": true, "ipConfigurations": [{"name": "testPC", "properties": {"subnet": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex8c68120d/subnets/subnetnamex8c68120d"}}}]}}]}}, - "overprovision": true}}''' + "overprovision": true}}\''''' headers: Accept: - application/json @@ -340,13 +330,13 @@ interactions: Connection: - keep-alive Content-Length: - - '993' + - '1017' Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"virtualmachinescaleset8c68120d\",\r\n \"id\": \"\ @@ -381,20 +371,20 @@ interactions: : {}\r\n }\r\n }\r\n ]\r\n }\r\n },\r\n\ \ \"provisioningState\": \"Creating\",\r\n \"overprovision\": true,\r\ \n \"doNotRunExtensionsOnOverprovisionedVMs\": false,\r\n \"uniqueId\"\ - : \"c3dfe4bb-16c1-4585-90b3-d98398fcf427\"\r\n }\r\n}" + : \"6ba3891c-0990-4f57-95cf-60d430901ccd\"\r\n }\r\n}" headers: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f3473f74-90c9-4578-927a-1552dc59b057?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/cdddb136-39b7-4aa2-aee5-b61fad349f2e?api-version=2020-06-01 cache-control: - no-cache content-length: - - '2528' + - '2576' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:53:55 GMT + - Wed, 16 Sep 2020 09:45:21 GMT expires: - '-1' pragma: @@ -407,9 +397,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/CreateVMScaleSet3Min;144,Microsoft.Compute/CreateVMScaleSet30Min;722,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;2899,Microsoft.Compute/VmssQueuedVMOperations;4798 + - Microsoft.Compute/CreateVMScaleSet3Min;59,Microsoft.Compute/CreateVMScaleSet30Min;298,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;1197,Microsoft.Compute/VmssQueuedVMOperations;4798 x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1199' x-ms-request-charge: - '2' status: @@ -425,13 +415,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f3473f74-90c9-4578-927a-1552dc59b057?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/cdddb136-39b7-4aa2-aee5-b61fad349f2e?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:53:55.5897105+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"f3473f74-90c9-4578-927a-1552dc59b057\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:45:19.5775904+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"cdddb136-39b7-4aa2-aee5-b61fad349f2e\"\ \r\n}" headers: cache-control: @@ -441,7 +431,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:54:06 GMT + - Wed, 16 Sep 2020 09:45:31 GMT expires: - '-1' pragma: @@ -458,7 +448,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14992,Microsoft.Compute/GetOperation30Min;29859 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29907 status: code: 200 message: OK @@ -472,13 +462,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f3473f74-90c9-4578-927a-1552dc59b057?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/cdddb136-39b7-4aa2-aee5-b61fad349f2e?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:53:55.5897105+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"f3473f74-90c9-4578-927a-1552dc59b057\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:45:19.5775904+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"cdddb136-39b7-4aa2-aee5-b61fad349f2e\"\ \r\n}" headers: cache-control: @@ -488,7 +478,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:55:43 GMT + - Wed, 16 Sep 2020 09:47:09 GMT expires: - '-1' pragma: @@ -505,7 +495,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29888 + - Microsoft.Compute/GetOperation3Min;14995,Microsoft.Compute/GetOperation30Min;29906 status: code: 200 message: OK @@ -519,13 +509,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f3473f74-90c9-4578-927a-1552dc59b057?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/cdddb136-39b7-4aa2-aee5-b61fad349f2e?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:53:55.5897105+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"f3473f74-90c9-4578-927a-1552dc59b057\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:45:19.5775904+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"cdddb136-39b7-4aa2-aee5-b61fad349f2e\"\ \r\n}" headers: cache-control: @@ -535,7 +525,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:56:13 GMT + - Wed, 16 Sep 2020 09:47:39 GMT expires: - '-1' pragma: @@ -552,7 +542,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29885 + - Microsoft.Compute/GetOperation3Min;14996,Microsoft.Compute/GetOperation30Min;29904 status: code: 200 message: OK @@ -566,13 +556,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f3473f74-90c9-4578-927a-1552dc59b057?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/cdddb136-39b7-4aa2-aee5-b61fad349f2e?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:53:55.5897105+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"f3473f74-90c9-4578-927a-1552dc59b057\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:45:19.5775904+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"cdddb136-39b7-4aa2-aee5-b61fad349f2e\"\ \r\n}" headers: cache-control: @@ -582,7 +572,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:56:43 GMT + - Wed, 16 Sep 2020 09:48:09 GMT expires: - '-1' pragma: @@ -599,7 +589,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14992,Microsoft.Compute/GetOperation30Min;29884 + - Microsoft.Compute/GetOperation3Min;14995,Microsoft.Compute/GetOperation30Min;29903 status: code: 200 message: OK @@ -613,13 +603,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f3473f74-90c9-4578-927a-1552dc59b057?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/cdddb136-39b7-4aa2-aee5-b61fad349f2e?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:53:55.5897105+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"f3473f74-90c9-4578-927a-1552dc59b057\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:45:19.5775904+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"cdddb136-39b7-4aa2-aee5-b61fad349f2e\"\ \r\n}" headers: cache-control: @@ -629,7 +619,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:57:14 GMT + - Wed, 16 Sep 2020 09:48:40 GMT expires: - '-1' pragma: @@ -646,7 +636,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14994,Microsoft.Compute/GetOperation30Min;29883 + - Microsoft.Compute/GetOperation3Min;14995,Microsoft.Compute/GetOperation30Min;29902 status: code: 200 message: OK @@ -660,13 +650,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f3473f74-90c9-4578-927a-1552dc59b057?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/cdddb136-39b7-4aa2-aee5-b61fad349f2e?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:53:55.5897105+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"f3473f74-90c9-4578-927a-1552dc59b057\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:45:19.5775904+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"cdddb136-39b7-4aa2-aee5-b61fad349f2e\"\ \r\n}" headers: cache-control: @@ -676,7 +666,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:57:44 GMT + - Wed, 16 Sep 2020 09:49:11 GMT expires: - '-1' pragma: @@ -693,7 +683,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29882 + - Microsoft.Compute/GetOperation3Min;14994,Microsoft.Compute/GetOperation30Min;29901 status: code: 200 message: OK @@ -707,13 +697,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f3473f74-90c9-4578-927a-1552dc59b057?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/cdddb136-39b7-4aa2-aee5-b61fad349f2e?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:53:55.5897105+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"f3473f74-90c9-4578-927a-1552dc59b057\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:45:19.5775904+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"cdddb136-39b7-4aa2-aee5-b61fad349f2e\"\ \r\n}" headers: cache-control: @@ -723,7 +713,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:58:14 GMT + - Wed, 16 Sep 2020 09:49:41 GMT expires: - '-1' pragma: @@ -740,7 +730,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14989,Microsoft.Compute/GetOperation30Min;29878 + - Microsoft.Compute/GetOperation3Min;14992,Microsoft.Compute/GetOperation30Min;29899 status: code: 200 message: OK @@ -754,13 +744,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f3473f74-90c9-4578-927a-1552dc59b057?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/cdddb136-39b7-4aa2-aee5-b61fad349f2e?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:53:55.5897105+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"f3473f74-90c9-4578-927a-1552dc59b057\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:45:19.5775904+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"cdddb136-39b7-4aa2-aee5-b61fad349f2e\"\ \r\n}" headers: cache-control: @@ -770,7 +760,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:58:44 GMT + - Wed, 16 Sep 2020 09:50:11 GMT expires: - '-1' pragma: @@ -787,7 +777,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14990,Microsoft.Compute/GetOperation30Min;29876 + - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29907 status: code: 200 message: OK @@ -801,14 +791,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f3473f74-90c9-4578-927a-1552dc59b057?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/cdddb136-39b7-4aa2-aee5-b61fad349f2e?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T21:53:55.5897105+00:00\",\r\n \"\ - endTime\": \"2020-05-18T21:59:07.5599655+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"f3473f74-90c9-4578-927a-1552dc59b057\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T09:45:19.5775904+00:00\",\r\n \"\ + endTime\": \"2020-09-16T09:50:41.0020803+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"cdddb136-39b7-4aa2-aee5-b61fad349f2e\"\r\n}" headers: cache-control: - no-cache @@ -817,7 +807,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:59:15 GMT + - Wed, 16 Sep 2020 09:50:41 GMT expires: - '-1' pragma: @@ -834,7 +824,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14989,Microsoft.Compute/GetOperation30Min;29874 + - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29906 status: code: 200 message: OK @@ -848,9 +838,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"virtualmachinescaleset8c68120d\",\r\n \"id\": \"\ @@ -885,16 +875,16 @@ interactions: : {}\r\n }\r\n }\r\n ]\r\n }\r\n },\r\n\ \ \"provisioningState\": \"Succeeded\",\r\n \"overprovision\": true,\r\ \n \"doNotRunExtensionsOnOverprovisionedVMs\": false,\r\n \"uniqueId\"\ - : \"c3dfe4bb-16c1-4585-90b3-d98398fcf427\"\r\n }\r\n}" + : \"6ba3891c-0990-4f57-95cf-60d430901ccd\"\r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '2529' + - '2577' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 21:59:15 GMT + - Wed, 16 Sep 2020 09:50:42 GMT expires: - '-1' pragma: @@ -911,7 +901,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetVMScaleSet3Min;395,Microsoft.Compute/GetVMScaleSet30Min;2567 + - Microsoft.Compute/GetVMScaleSet3Min;398,Microsoft.Compute/GetVMScaleSet30Min;2569 status: code: 200 message: OK @@ -925,53 +915,97 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualmachines/0/instanceView?api-version=2020-06-01 + response: + body: + string: "{\r\n \"error\": {\r\n \"code\": \"NotFound\",\r\n \"message\"\ + : \"The entity was not found in this Azure location.\"\r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '115' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 09:53:43 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetVMScaleSetVM3Min;999,Microsoft.Compute/GetVMScaleSetVM30Min;4998,Microsoft.Compute/VMScaleSetVMViews3Min;4999 + x-ms-request-charge: + - '1' + status: + code: 404 + message: Not Found +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualmachines/0/instanceView?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualmachines/1/instanceView?api-version=2020-06-01 response: body: - string: "{\r\n \"placementGroupId\": \"fe41eeb6-f188-44cc-b32f-eb4d298ef2a6\"\ - ,\r\n \"platformUpdateDomain\": 0,\r\n \"platformFaultDomain\": 0,\r\n \ - \ \"computerName\": \"testPC000000\",\r\n \"osName\": \"Windows Server 2016\ + string: "{\r\n \"placementGroupId\": \"d8dd572f-4fa9-4468-8a81-fc38cb2519d6\"\ + ,\r\n \"platformUpdateDomain\": 1,\r\n \"platformFaultDomain\": 1,\r\n \ + \ \"computerName\": \"testPC000001\",\r\n \"osName\": \"Windows Server 2016\ \ Datacenter\",\r\n \"osVersion\": \"Microsoft Windows NT 10.0.14393.0\"\ - ,\r\n \"vmAgent\": {\r\n \"vmAgentVersion\": \"2.7.41491.963\",\r\n \ + ,\r\n \"vmAgent\": {\r\n \"vmAgentVersion\": \"2.7.41491.993\",\r\n \ \ \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\"\ ,\r\n \"level\": \"Info\",\r\n \"displayStatus\": \"Ready\"\ - ,\r\n \"message\": \"GuestAgent is running and accepting new configurations.\"\ - ,\r\n \"time\": \"2020-05-18T22:02:04+00:00\"\r\n }\r\n ],\r\ + ,\r\n \"message\": \"GuestAgent is running and processing the extensions.\"\ + ,\r\n \"time\": \"2020-09-16T09:53:33+00:00\"\r\n }\r\n ],\r\ \n \"extensionHandlers\": [\r\n {\r\n \"type\": \"Microsoft.Azure.Geneva.GenevaMonitoring\"\ - ,\r\n \"typeHandlerVersion\": \"2.17.0.2\",\r\n \"status\":\ + ,\r\n \"typeHandlerVersion\": \"2.19.0.1\",\r\n \"status\":\ \ {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n \"\ level\": \"Info\",\r\n \"displayStatus\": \"Ready\",\r\n \ \ \"message\": \"ExtensionOperation:enable. Status:Success\"\r\n }\r\ \n }\r\n ]\r\n },\r\n \"disks\": [\r\n {\r\n \"name\": \"\ - virtualmachinescalesvirtualmachinescaleseOS__1_a06513bdbd0c44e7ab4e4aaaa44bdf0c\"\ + virtualmachinescalesvirtualmachinescaleseOS__1_45670800492a4f71ba8b9fa5064d08b0\"\ ,\r\n \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\"\ ,\r\n \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning\ - \ succeeded\",\r\n \"time\": \"2020-05-18T21:59:08.0912304+00:00\"\ + \ succeeded\",\r\n \"time\": \"2020-09-16T09:45:31.640237+00:00\"\ \r\n }\r\n ]\r\n }\r\n ],\r\n \"extensions\": [\r\n {\r\ \n \"name\": \"Microsoft.Azure.Geneva.GenevaMonitoring\",\r\n \"\ type\": \"Microsoft.Azure.Geneva.GenevaMonitoring\",\r\n \"typeHandlerVersion\"\ - : \"2.17.0.2\",\r\n \"statuses\": [\r\n {\r\n \"code\"\ + : \"2.19.0.1\",\r\n \"statuses\": [\r\n {\r\n \"code\"\ : \"ProvisioningState/succeeded\",\r\n \"level\": \"Info\",\r\n \ \ \"displayStatus\": \"Provisioning succeeded\",\r\n \"message\"\ : \"ExtensionOperation:enable. Status:Success\",\r\n \"time\": \"\ - 2020-05-18T22:01:50+00:00\"\r\n }\r\n ]\r\n }\r\n ],\r\n \ + 2020-09-16T09:53:33+00:00\"\r\n }\r\n ]\r\n }\r\n ],\r\n \ \ \"hyperVGeneration\": \"V1\",\r\n \"statuses\": [\r\n {\r\n \"\ code\": \"ProvisioningState/succeeded\",\r\n \"level\": \"Info\",\r\n\ \ \"displayStatus\": \"Provisioning succeeded\",\r\n \"time\": \"\ - 2020-05-18T21:59:51.9977814+00:00\"\r\n },\r\n {\r\n \"code\":\ + 2020-09-16T09:50:40.9552552+00:00\"\r\n },\r\n {\r\n \"code\":\ \ \"PowerState/running\",\r\n \"level\": \"Info\",\r\n \"displayStatus\"\ : \"VM running\"\r\n }\r\n ]\r\n}" headers: cache-control: - no-cache content-length: - - '2184' + - '2180' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 22:02:17 GMT + - Wed, 16 Sep 2020 09:53:43 GMT expires: - '-1' pragma: @@ -988,7 +1022,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetVMScaleSetVM3Min;999,Microsoft.Compute/GetVMScaleSetVM30Min;4998,Microsoft.Compute/VMScaleSetVMViews3Min;4999 + - Microsoft.Compute/GetVMScaleSetVM3Min;998,Microsoft.Compute/GetVMScaleSetVM30Min;4997,Microsoft.Compute/VMScaleSetVMViews3Min;4998 x-ms-request-charge: - '1' status: @@ -1004,42 +1038,81 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualmachines/0?$expand=instanceView&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualmachines/1?$expand=instanceView&api-version=2020-06-01 response: body: - string: "{\r\n \"name\": \"virtualmachinescaleset8c68120d_0\",\r\n \"id\"\ - : \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualMachines/0\"\ + string: "{\r\n \"name\": \"virtualmachinescaleset8c68120d_1\",\r\n \"id\"\ + : \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualMachines/1\"\ ,\r\n \"type\": \"Microsoft.Compute/virtualMachineScaleSets/virtualMachines\"\ - ,\r\n \"location\": \"eastus\",\r\n \"instanceId\": \"0\",\r\n \"sku\"\ + ,\r\n \"location\": \"eastus\",\r\n \"instanceId\": \"1\",\r\n \"sku\"\ : {\r\n \"name\": \"Standard_D1_v2\",\r\n \"tier\": \"Standard\"\r\n\ \ },\r\n \"properties\": {\r\n \"latestModelApplied\": true,\r\n \"\ - modelDefinitionApplied\": \"VirtualMachineScaleSet\",\r\n \"networkProfileConfiguration\"\ - : {\"networkInterfaceConfigurations\":[{\"name\":\"testPC\",\"properties\"\ - :{\"primary\":true,\"enableAcceleratedNetworking\":false,\"dnsSettings\":{\"\ - dnsServers\":[]},\"enableIPForwarding\":false,\"ipConfigurations\":[{\"name\"\ - :\"testPC\",\"properties\":{\"subnet\":{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex8c68120d/subnets/subnetnamex8c68120d\"\ - },\"privateIPAddressVersion\":\"IPv4\"}}]}}]},\r\n \"vmId\": \"1fc704ac-308c-4abe-8c36-3dee8db4b2e6\"\ + modelDefinitionApplied\": \"VirtualMachineScaleSet\",\r\n \"instanceView\"\ + : {\r\n \"placementGroupId\": \"d8dd572f-4fa9-4468-8a81-fc38cb2519d6\"\ + ,\r\n \"platformUpdateDomain\": 1,\r\n \"platformFaultDomain\":\ + \ 1,\r\n \"computerName\": \"testPC000001\",\r\n \"osName\": \"\ + Windows Server 2016 Datacenter\",\r\n \"osVersion\": \"Microsoft Windows\ + \ NT 10.0.14393.0\",\r\n \"vmAgent\": {\r\n \"vmAgentVersion\"\ + : \"2.7.41491.993\",\r\n \"statuses\": [\r\n {\r\n \ + \ \"code\": \"ProvisioningState/succeeded\",\r\n \"level\"\ + : \"Info\",\r\n \"displayStatus\": \"Ready\",\r\n \"\ + message\": \"GuestAgent is running and processing the extensions.\",\r\n \ + \ \"time\": \"2020-09-16T09:53:33+00:00\"\r\n }\r\n \ + \ ],\r\n \"extensionHandlers\": [\r\n {\r\n \ + \ \"type\": \"Microsoft.Azure.Geneva.GenevaMonitoring\",\r\n \"\ + typeHandlerVersion\": \"2.19.0.1\",\r\n \"status\": {\r\n \ + \ \"code\": \"ProvisioningState/succeeded\",\r\n \"level\"\ + : \"Info\",\r\n \"displayStatus\": \"Ready\",\r\n \ + \ \"message\": \"ExtensionOperation:enable. Status:Success\"\r\n \ + \ }\r\n }\r\n ]\r\n },\r\n \"disks\": [\r\n\ + \ {\r\n \"name\": \"virtualmachinescalesvirtualmachinescaleseOS__1_45670800492a4f71ba8b9fa5064d08b0\"\ + ,\r\n \"statuses\": [\r\n {\r\n \"code\"\ + : \"ProvisioningState/succeeded\",\r\n \"level\": \"Info\",\r\ + \n \"displayStatus\": \"Provisioning succeeded\",\r\n \ + \ \"time\": \"2020-09-16T09:45:31.640237+00:00\"\r\n }\r\n\ + \ ]\r\n }\r\n ],\r\n \"extensions\": [\r\n \ + \ {\r\n \"name\": \"Microsoft.Azure.Geneva.GenevaMonitoring\",\r\ + \n \"type\": \"Microsoft.Azure.Geneva.GenevaMonitoring\",\r\n \ + \ \"typeHandlerVersion\": \"2.19.0.1\",\r\n \"statuses\": [\r\ + \n {\r\n \"code\": \"ProvisioningState/succeeded\"\ + ,\r\n \"level\": \"Info\",\r\n \"displayStatus\"\ + : \"Provisioning succeeded\",\r\n \"message\": \"ExtensionOperation:enable.\ + \ Status:Success\",\r\n \"time\": \"2020-09-16T09:53:33+00:00\"\ + \r\n }\r\n ]\r\n }\r\n ],\r\n \"hyperVGeneration\"\ + : \"V1\",\r\n \"statuses\": [\r\n {\r\n \"code\": \"\ + ProvisioningState/succeeded\",\r\n \"level\": \"Info\",\r\n \ + \ \"displayStatus\": \"Provisioning succeeded\",\r\n \"time\"\ + : \"2020-09-16T09:50:40.9552552+00:00\"\r\n },\r\n {\r\n \ + \ \"code\": \"PowerState/running\",\r\n \"level\": \"Info\"\ + ,\r\n \"displayStatus\": \"VM running\"\r\n }\r\n ]\r\ + \n },\r\n \"networkProfileConfiguration\": {\"networkInterfaceConfigurations\"\ + :[{\"name\":\"testPC\",\"properties\":{\"primary\":true,\"enableAcceleratedNetworking\"\ + :false,\"dnsSettings\":{\"dnsServers\":[]},\"enableIPForwarding\":false,\"\ + ipConfigurations\":[{\"name\":\"testPC\",\"properties\":{\"subnet\":{\"id\"\ + :\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex8c68120d/subnets/subnetnamex8c68120d\"\ + },\"privateIPAddressVersion\":\"IPv4\"}}]}}]},\r\n \"vmId\": \"eb27bf68-ef07-4f01-8331-a4fcc85eb4da\"\ ,\r\n \"hardwareProfile\": {},\r\n \"storageProfile\": {\r\n \"\ imageReference\": {\r\n \"publisher\": \"MicrosoftWindowsServer\",\r\ \n \"offer\": \"WindowsServer\",\r\n \"sku\": \"2016-Datacenter\"\ - ,\r\n \"version\": \"latest\",\r\n \"exactVersion\": \"14393.3686.2005061700\"\ + ,\r\n \"version\": \"latest\",\r\n \"exactVersion\": \"14393.3930.2009041537\"\ \r\n },\r\n \"osDisk\": {\r\n \"osType\": \"Windows\",\r\n\ - \ \"name\": \"virtualmachinescalesvirtualmachinescaleseOS__1_a06513bdbd0c44e7ab4e4aaaa44bdf0c\"\ + \ \"name\": \"virtualmachinescalesvirtualmachinescaleseOS__1_45670800492a4f71ba8b9fa5064d08b0\"\ ,\r\n \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\"\ ,\r\n \"managedDisk\": {\r\n \"storageAccountType\": \"Standard_LRS\"\ - ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/virtualmachinescalesvirtualmachinescaleseOS__1_a06513bdbd0c44e7ab4e4aaaa44bdf0c\"\ + ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/7NYDNTYFOO6MP7TJTWDH2RMLZ2IH3L2XLPIU67DP6MPWR7K2AG62TMXYZHON2UFB54SZFCTOCG7/providers/Microsoft.Compute/disks/virtualmachinescalesvirtualmachinescaleseOS__1_45670800492a4f71ba8b9fa5064d08b0\"\ \r\n },\r\n \"diskSizeGB\": 512\r\n },\r\n \"dataDisks\"\ - : []\r\n },\r\n \"osProfile\": {\r\n \"computerName\": \"testPC000000\"\ + : []\r\n },\r\n \"osProfile\": {\r\n \"computerName\": \"testPC000001\"\ ,\r\n \"adminUsername\": \"testuser\",\r\n \"windowsConfiguration\"\ : {\r\n \"provisionVMAgent\": true,\r\n \"enableAutomaticUpdates\"\ - : true\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\"\ + : true,\r\n \"patchSettings\": {\r\n \"patchMode\": \"AutomaticByOS\"\ + \r\n }\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\"\ : true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"\ - networkProfile\": {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualMachines/0/networkInterfaces/testPC\"\ + networkProfile\": {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualMachines/1/networkInterfaces/testPC\"\ }]},\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"resources\"\ : [\r\n {\r\n \"name\": \"Microsoft.Azure.Geneva.GenevaMonitoring\"\ - ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinescaleset8c68120d_0/extensions/Microsoft.Azure.Geneva.GenevaMonitoring\"\ + ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinescaleset8c68120d_1/extensions/Microsoft.Azure.Geneva.GenevaMonitoring\"\ ,\r\n \"type\": \"Microsoft.Compute/virtualMachines/extensions\",\r\n\ \ \"location\": \"eastus\",\r\n \"properties\": {\r\n \"\ autoUpgradeMinorVersion\": true,\r\n \"provisioningState\": \"Succeeded\"\ @@ -1050,11 +1123,11 @@ interactions: cache-control: - no-cache content-length: - - '3472' + - '6171' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 22:02:17 GMT + - Wed, 16 Sep 2020 09:53:44 GMT expires: - '-1' pragma: @@ -1071,7 +1144,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetVMScaleSetVM3Min;998,Microsoft.Compute/GetVMScaleSetVM30Min;4997,Microsoft.Compute/VMScaleSetVMViews3Min;4998 + - Microsoft.Compute/GetVMScaleSetVM3Min;997,Microsoft.Compute/GetVMScaleSetVM30Min;4996,Microsoft.Compute/VMScaleSetVMViews3Min;4997 x-ms-request-charge: - '1' status: @@ -1091,15 +1164,15 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualmachines/0?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualmachines/1?api-version=2020-06-01 response: body: - string: "{\r\n \"name\": \"virtualmachinescaleset8c68120d_0\",\r\n \"id\"\ - : \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualMachines/0\"\ + string: "{\r\n \"name\": \"virtualmachinescaleset8c68120d_1\",\r\n \"id\"\ + : \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualMachines/1\"\ ,\r\n \"type\": \"Microsoft.Compute/virtualMachineScaleSets/virtualMachines\"\ - ,\r\n \"location\": \"eastus\",\r\n \"instanceId\": \"0\",\r\n \"sku\"\ + ,\r\n \"location\": \"eastus\",\r\n \"instanceId\": \"1\",\r\n \"sku\"\ : {\r\n \"name\": \"Standard_D1_v2\",\r\n \"tier\": \"Standard\"\r\n\ \ },\r\n \"properties\": {\r\n \"latestModelApplied\": true,\r\n \"\ modelDefinitionApplied\": \"VirtualMachineScaleSet\",\r\n \"networkProfileConfiguration\"\ @@ -1107,26 +1180,27 @@ interactions: :{\"primary\":true,\"enableAcceleratedNetworking\":false,\"dnsSettings\":{\"\ dnsServers\":[]},\"enableIPForwarding\":false,\"ipConfigurations\":[{\"name\"\ :\"testPC\",\"properties\":{\"subnet\":{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex8c68120d/subnets/subnetnamex8c68120d\"\ - },\"privateIPAddressVersion\":\"IPv4\"}}]}}]},\r\n \"vmId\": \"1fc704ac-308c-4abe-8c36-3dee8db4b2e6\"\ + },\"privateIPAddressVersion\":\"IPv4\"}}]}}]},\r\n \"vmId\": \"eb27bf68-ef07-4f01-8331-a4fcc85eb4da\"\ ,\r\n \"hardwareProfile\": {},\r\n \"storageProfile\": {\r\n \"\ imageReference\": {\r\n \"publisher\": \"MicrosoftWindowsServer\",\r\ \n \"offer\": \"WindowsServer\",\r\n \"sku\": \"2016-Datacenter\"\ - ,\r\n \"version\": \"latest\",\r\n \"exactVersion\": \"14393.3686.2005061700\"\ + ,\r\n \"version\": \"latest\",\r\n \"exactVersion\": \"14393.3930.2009041537\"\ \r\n },\r\n \"osDisk\": {\r\n \"osType\": \"Windows\",\r\n\ - \ \"name\": \"virtualmachinescalesvirtualmachinescaleseOS__1_a06513bdbd0c44e7ab4e4aaaa44bdf0c\"\ + \ \"name\": \"virtualmachinescalesvirtualmachinescaleseOS__1_45670800492a4f71ba8b9fa5064d08b0\"\ ,\r\n \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\"\ ,\r\n \"managedDisk\": {\r\n \"storageAccountType\": \"Standard_LRS\"\ - ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/virtualmachinescalesvirtualmachinescaleseOS__1_a06513bdbd0c44e7ab4e4aaaa44bdf0c\"\ + ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/7NYDNTYFOO6MP7TJTWDH2RMLZ2IH3L2XLPIU67DP6MPWR7K2AG62TMXYZHON2UFB54SZFCTOCG7/providers/Microsoft.Compute/disks/virtualmachinescalesvirtualmachinescaleseOS__1_45670800492a4f71ba8b9fa5064d08b0\"\ \r\n },\r\n \"diskSizeGB\": 512\r\n },\r\n \"dataDisks\"\ - : []\r\n },\r\n \"osProfile\": {\r\n \"computerName\": \"testPC000000\"\ + : []\r\n },\r\n \"osProfile\": {\r\n \"computerName\": \"testPC000001\"\ ,\r\n \"adminUsername\": \"testuser\",\r\n \"windowsConfiguration\"\ : {\r\n \"provisionVMAgent\": true,\r\n \"enableAutomaticUpdates\"\ - : true\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\"\ + : true,\r\n \"patchSettings\": {\r\n \"patchMode\": \"AutomaticByOS\"\ + \r\n }\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\"\ : true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"\ - networkProfile\": {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualMachines/0/networkInterfaces/testPC\"\ + networkProfile\": {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualMachines/1/networkInterfaces/testPC\"\ }]},\r\n \"provisioningState\": \"Updating\"\r\n },\r\n \"resources\"\ : [\r\n {\r\n \"name\": \"Microsoft.Azure.Geneva.GenevaMonitoring\"\ - ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinescaleset8c68120d_0/extensions/Microsoft.Azure.Geneva.GenevaMonitoring\"\ + ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinescaleset8c68120d_1/extensions/Microsoft.Azure.Geneva.GenevaMonitoring\"\ ,\r\n \"type\": \"Microsoft.Compute/virtualMachines/extensions\",\r\n\ \ \"location\": \"eastus\",\r\n \"properties\": {\r\n \"\ autoUpgradeMinorVersion\": true,\r\n \"provisioningState\": \"Succeeded\"\ @@ -1135,15 +1209,15 @@ interactions: \ \"settings\": {}\r\n }\r\n }\r\n ]\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4b69df1c-8a73-4290-a76e-cf2d0810a3df?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/5442e837-34bd-4d71-ab3c-90fa7b861cda?api-version=2020-06-01 cache-control: - no-cache content-length: - - '3471' + - '3671' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 22:02:18 GMT + - Wed, 16 Sep 2020 09:53:45 GMT expires: - '-1' pragma: @@ -1160,9 +1234,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/VMScaleSetActions3Min;239,Microsoft.Compute/VMScaleSetActions30Min;1165,Microsoft.Compute/VmssQueuedVMOperations;4800 + - Microsoft.Compute/VMScaleSetActions3Min;239,Microsoft.Compute/VMScaleSetActions30Min;1194,Microsoft.Compute/VmssQueuedVMOperations;4800 x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1197' x-ms-request-charge: - '0' status: @@ -1178,14 +1252,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4b69df1c-8a73-4290-a76e-cf2d0810a3df?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/5442e837-34bd-4d71-ab3c-90fa7b861cda?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T22:02:18.1545455+00:00\",\r\n \"\ - endTime\": \"2020-05-18T22:02:18.2639268+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"4b69df1c-8a73-4290-a76e-cf2d0810a3df\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T09:53:45.3003734+00:00\",\r\n \"\ + endTime\": \"2020-09-16T09:53:45.3941767+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"5442e837-34bd-4d71-ab3c-90fa7b861cda\"\r\n}" headers: cache-control: - no-cache @@ -1194,7 +1268,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 22:02:48 GMT + - Wed, 16 Sep 2020 09:54:15 GMT expires: - '-1' pragma: @@ -1211,7 +1285,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14996,Microsoft.Compute/GetOperation30Min;29902 + - Microsoft.Compute/GetOperation3Min;14999,Microsoft.Compute/GetOperation30Min;29904 status: code: 200 message: OK @@ -1225,15 +1299,15 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualmachines/0?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualmachines/1?api-version=2020-06-01 response: body: - string: "{\r\n \"name\": \"virtualmachinescaleset8c68120d_0\",\r\n \"id\"\ - : \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualMachines/0\"\ + string: "{\r\n \"name\": \"virtualmachinescaleset8c68120d_1\",\r\n \"id\"\ + : \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualMachines/1\"\ ,\r\n \"type\": \"Microsoft.Compute/virtualMachineScaleSets/virtualMachines\"\ - ,\r\n \"location\": \"eastus\",\r\n \"instanceId\": \"0\",\r\n \"sku\"\ + ,\r\n \"location\": \"eastus\",\r\n \"instanceId\": \"1\",\r\n \"sku\"\ : {\r\n \"name\": \"Standard_D1_v2\",\r\n \"tier\": \"Standard\"\r\n\ \ },\r\n \"properties\": {\r\n \"latestModelApplied\": true,\r\n \"\ modelDefinitionApplied\": \"VirtualMachineScaleSet\",\r\n \"networkProfileConfiguration\"\ @@ -1241,26 +1315,27 @@ interactions: :{\"primary\":true,\"enableAcceleratedNetworking\":false,\"dnsSettings\":{\"\ dnsServers\":[]},\"enableIPForwarding\":false,\"ipConfigurations\":[{\"name\"\ :\"testPC\",\"properties\":{\"subnet\":{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex8c68120d/subnets/subnetnamex8c68120d\"\ - },\"privateIPAddressVersion\":\"IPv4\"}}]}}]},\r\n \"vmId\": \"1fc704ac-308c-4abe-8c36-3dee8db4b2e6\"\ + },\"privateIPAddressVersion\":\"IPv4\"}}]}}]},\r\n \"vmId\": \"eb27bf68-ef07-4f01-8331-a4fcc85eb4da\"\ ,\r\n \"hardwareProfile\": {},\r\n \"storageProfile\": {\r\n \"\ imageReference\": {\r\n \"publisher\": \"MicrosoftWindowsServer\",\r\ \n \"offer\": \"WindowsServer\",\r\n \"sku\": \"2016-Datacenter\"\ - ,\r\n \"version\": \"latest\",\r\n \"exactVersion\": \"14393.3686.2005061700\"\ + ,\r\n \"version\": \"latest\",\r\n \"exactVersion\": \"14393.3930.2009041537\"\ \r\n },\r\n \"osDisk\": {\r\n \"osType\": \"Windows\",\r\n\ - \ \"name\": \"virtualmachinescalesvirtualmachinescaleseOS__1_a06513bdbd0c44e7ab4e4aaaa44bdf0c\"\ + \ \"name\": \"virtualmachinescalesvirtualmachinescaleseOS__1_45670800492a4f71ba8b9fa5064d08b0\"\ ,\r\n \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\"\ ,\r\n \"managedDisk\": {\r\n \"storageAccountType\": \"Standard_LRS\"\ - ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/virtualmachinescalesvirtualmachinescaleseOS__1_a06513bdbd0c44e7ab4e4aaaa44bdf0c\"\ + ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/7NYDNTYFOO6MP7TJTWDH2RMLZ2IH3L2XLPIU67DP6MPWR7K2AG62TMXYZHON2UFB54SZFCTOCG7/providers/Microsoft.Compute/disks/virtualmachinescalesvirtualmachinescaleseOS__1_45670800492a4f71ba8b9fa5064d08b0\"\ \r\n },\r\n \"diskSizeGB\": 512\r\n },\r\n \"dataDisks\"\ - : []\r\n },\r\n \"osProfile\": {\r\n \"computerName\": \"testPC000000\"\ + : []\r\n },\r\n \"osProfile\": {\r\n \"computerName\": \"testPC000001\"\ ,\r\n \"adminUsername\": \"testuser\",\r\n \"windowsConfiguration\"\ : {\r\n \"provisionVMAgent\": true,\r\n \"enableAutomaticUpdates\"\ - : true\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\"\ + : true,\r\n \"patchSettings\": {\r\n \"patchMode\": \"AutomaticByOS\"\ + \r\n }\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\"\ : true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"\ - networkProfile\": {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualMachines/0/networkInterfaces/testPC\"\ + networkProfile\": {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualMachines/1/networkInterfaces/testPC\"\ }]},\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"resources\"\ : [\r\n {\r\n \"name\": \"Microsoft.Azure.Geneva.GenevaMonitoring\"\ - ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinescaleset8c68120d_0/extensions/Microsoft.Azure.Geneva.GenevaMonitoring\"\ + ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinescaleset8c68120d_1/extensions/Microsoft.Azure.Geneva.GenevaMonitoring\"\ ,\r\n \"type\": \"Microsoft.Compute/virtualMachines/extensions\",\r\n\ \ \"location\": \"eastus\",\r\n \"properties\": {\r\n \"\ autoUpgradeMinorVersion\": true,\r\n \"provisioningState\": \"Succeeded\"\ @@ -1271,11 +1346,11 @@ interactions: cache-control: - no-cache content-length: - - '3472' + - '3672' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 22:02:48 GMT + - Wed, 16 Sep 2020 09:54:16 GMT expires: - '-1' pragma: @@ -1292,7 +1367,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetVMScaleSetVM3Min;996,Microsoft.Compute/GetVMScaleSetVM30Min;4995,Microsoft.Compute/VMScaleSetVMViews3Min;4996 + - Microsoft.Compute/GetVMScaleSetVM3Min;995,Microsoft.Compute/GetVMScaleSetVM30Min;4994,Microsoft.Compute/VMScaleSetVMViews3Min;4995 x-ms-request-charge: - '1' status: @@ -1310,25 +1385,25 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualmachines/0/restart?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualmachines/1/restart?api-version=2020-06-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/71f033d6-b26e-450b-999a-5d6133ead332?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/040d44db-973e-4f16-8df6-631b39bd9efb?api-version=2020-06-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 18 May 2020 22:02:49 GMT + - Wed, 16 Sep 2020 09:54:16 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/71f033d6-b26e-450b-999a-5d6133ead332?monitor=true&api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/040d44db-973e-4f16-8df6-631b39bd9efb?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -1339,7 +1414,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/VMScaleSetActions3Min;238,Microsoft.Compute/VMScaleSetActions30Min;1164,Microsoft.Compute/VMScaleSetVMActions3Min;199,Microsoft.Compute/VMScaleSetVMActions30Min;999,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;2902,Microsoft.Compute/VmssQueuedVMOperations;4799 + - Microsoft.Compute/VMScaleSetActions3Min;238,Microsoft.Compute/VMScaleSetActions30Min;1193,Microsoft.Compute/VMScaleSetVMActions3Min;199,Microsoft.Compute/VMScaleSetVMActions30Min;999,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;1199,Microsoft.Compute/VmssQueuedVMOperations;4799 x-ms-ratelimit-remaining-subscription-writes: - '1199' x-ms-request-charge: @@ -1357,14 +1432,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/71f033d6-b26e-450b-999a-5d6133ead332?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/040d44db-973e-4f16-8df6-631b39bd9efb?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T22:02:49.2796796+00:00\",\r\n \"\ - endTime\": \"2020-05-18T22:02:50.8265899+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"71f033d6-b26e-450b-999a-5d6133ead332\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T09:54:16.9490172+00:00\",\r\n \"\ + endTime\": \"2020-09-16T09:54:18.3238803+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"040d44db-973e-4f16-8df6-631b39bd9efb\"\r\n}" headers: cache-control: - no-cache @@ -1373,7 +1448,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 22:03:19 GMT + - Wed, 16 Sep 2020 09:54:47 GMT expires: - '-1' pragma: @@ -1390,7 +1465,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14996,Microsoft.Compute/GetOperation30Min;29900 + - Microsoft.Compute/GetOperation3Min;14997,Microsoft.Compute/GetOperation30Min;29902 status: code: 200 message: OK @@ -1404,9 +1479,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/71f033d6-b26e-450b-999a-5d6133ead332?monitor=true&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/040d44db-973e-4f16-8df6-631b39bd9efb?monitor=true&api-version=2020-06-01 response: body: string: '' @@ -1416,7 +1491,7 @@ interactions: content-length: - '0' date: - - Mon, 18 May 2020 22:03:19 GMT + - Wed, 16 Sep 2020 09:54:47 GMT expires: - '-1' pragma: @@ -1429,7 +1504,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14995,Microsoft.Compute/GetOperation30Min;29899 + - Microsoft.Compute/GetOperation3Min;14996,Microsoft.Compute/GetOperation30Min;29901 status: code: 200 message: OK @@ -1445,25 +1520,25 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualmachines/0/poweroff?skipShutdown=false&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualmachines/1/poweroff?skipShutdown=false&api-version=2020-06-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/219d826a-7181-4ed8-a693-ade23858bd45?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d5823942-1fcc-47f6-bad4-4d400af91ea7?api-version=2020-06-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 18 May 2020 22:03:19 GMT + - Wed, 16 Sep 2020 09:54:48 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/219d826a-7181-4ed8-a693-ade23858bd45?monitor=true&api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d5823942-1fcc-47f6-bad4-4d400af91ea7?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -1474,7 +1549,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/DeleteVMScaleSetVM3Min;239,Microsoft.Compute/DeleteVMScaleSetVM30Min;1199,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;2901,Microsoft.Compute/VmssQueuedVMOperations;4799 + - Microsoft.Compute/DeleteVMScaleSetVM3Min;239,Microsoft.Compute/DeleteVMScaleSetVM30Min;1199,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;1198,Microsoft.Compute/VmssQueuedVMOperations;4799 x-ms-ratelimit-remaining-subscription-writes: - '1198' x-ms-request-charge: @@ -1492,108 +1567,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/219d826a-7181-4ed8-a693-ade23858bd45?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-05-18T22:03:20.1705468+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"219d826a-7181-4ed8-a693-ade23858bd45\"\ - \r\n}" - headers: - cache-control: - - no-cache - content-length: - - '134' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 18 May 2020 22:03:50 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14994,Microsoft.Compute/GetOperation30Min;29897 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/219d826a-7181-4ed8-a693-ade23858bd45?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-05-18T22:03:20.1705468+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"219d826a-7181-4ed8-a693-ade23858bd45\"\ - \r\n}" - headers: - cache-control: - - no-cache - content-length: - - '134' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 18 May 2020 22:04:19 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14991,Microsoft.Compute/GetOperation30Min;29894 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/219d826a-7181-4ed8-a693-ade23858bd45?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d5823942-1fcc-47f6-bad4-4d400af91ea7?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T22:03:20.1705468+00:00\",\r\n \"\ - endTime\": \"2020-05-18T22:04:24.6552857+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"219d826a-7181-4ed8-a693-ade23858bd45\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T09:54:48.8766868+00:00\",\r\n \"\ + endTime\": \"2020-09-16T09:55:09.4567732+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"d5823942-1fcc-47f6-bad4-4d400af91ea7\"\r\n}" headers: cache-control: - no-cache @@ -1602,7 +1583,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 22:04:50 GMT + - Wed, 16 Sep 2020 09:55:19 GMT expires: - '-1' pragma: @@ -1619,7 +1600,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14988,Microsoft.Compute/GetOperation30Min;29891 + - Microsoft.Compute/GetOperation3Min;14994,Microsoft.Compute/GetOperation30Min;29906 status: code: 200 message: OK @@ -1633,9 +1614,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/219d826a-7181-4ed8-a693-ade23858bd45?monitor=true&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d5823942-1fcc-47f6-bad4-4d400af91ea7?monitor=true&api-version=2020-06-01 response: body: string: '' @@ -1645,7 +1626,7 @@ interactions: content-length: - '0' date: - - Mon, 18 May 2020 22:04:50 GMT + - Wed, 16 Sep 2020 09:55:20 GMT expires: - '-1' pragma: @@ -1658,7 +1639,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14987,Microsoft.Compute/GetOperation30Min;29890 + - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29905 status: code: 200 message: OK @@ -1674,25 +1655,25 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualmachines/0/start?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualmachines/1/start?api-version=2020-06-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4e1405d9-5f97-4954-877e-7bc594e451e8?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/a5d6b51b-f95e-4216-beff-4cb9839cdf0d?api-version=2020-06-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 18 May 2020 22:04:50 GMT + - Wed, 16 Sep 2020 09:55:20 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4e1405d9-5f97-4954-877e-7bc594e451e8?monitor=true&api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/a5d6b51b-f95e-4216-beff-4cb9839cdf0d?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -1703,7 +1684,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/VMScaleSetActions3Min;236,Microsoft.Compute/VMScaleSetActions30Min;1162,Microsoft.Compute/VMScaleSetVMActions3Min;198,Microsoft.Compute/VMScaleSetVMActions30Min;998,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;2900,Microsoft.Compute/VmssQueuedVMOperations;4799 + - Microsoft.Compute/VMScaleSetActions3Min;237,Microsoft.Compute/VMScaleSetActions30Min;1194,Microsoft.Compute/VMScaleSetVMActions3Min;198,Microsoft.Compute/VMScaleSetVMActions30Min;998,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;1197,Microsoft.Compute/VmssQueuedVMOperations;4799 x-ms-ratelimit-remaining-subscription-writes: - '1197' x-ms-request-charge: @@ -1721,14 +1702,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4e1405d9-5f97-4954-877e-7bc594e451e8?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/a5d6b51b-f95e-4216-beff-4cb9839cdf0d?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T22:04:51.4523232+00:00\",\r\n \"\ - endTime\": \"2020-05-18T22:04:53.0773511+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"4e1405d9-5f97-4954-877e-7bc594e451e8\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T09:55:20.8634197+00:00\",\r\n \"\ + endTime\": \"2020-09-16T09:55:23.6915545+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"a5d6b51b-f95e-4216-beff-4cb9839cdf0d\"\r\n}" headers: cache-control: - no-cache @@ -1737,7 +1718,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 22:05:21 GMT + - Wed, 16 Sep 2020 09:55:51 GMT expires: - '-1' pragma: @@ -1754,7 +1735,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29905 + - Microsoft.Compute/GetOperation3Min;14990,Microsoft.Compute/GetOperation30Min;29902 status: code: 200 message: OK @@ -1768,9 +1749,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4e1405d9-5f97-4954-877e-7bc594e451e8?monitor=true&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/a5d6b51b-f95e-4216-beff-4cb9839cdf0d?monitor=true&api-version=2020-06-01 response: body: string: '' @@ -1780,7 +1761,7 @@ interactions: content-length: - '0' date: - - Mon, 18 May 2020 22:05:21 GMT + - Wed, 16 Sep 2020 09:55:51 GMT expires: - '-1' pragma: @@ -1793,7 +1774,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29904 + - Microsoft.Compute/GetOperation3Min;14989,Microsoft.Compute/GetOperation30Min;29901 status: code: 200 message: OK @@ -1801,7 +1782,7 @@ interactions: body: '{"commandId": "RunPowerShellScript"}' headers: Accept: - - application/json + - application/json, text/json Accept-Encoding: - gzip, deflate Connection: @@ -1811,25 +1792,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualmachines/0/runCommand?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualmachines/1/runCommand?api-version=2020-06-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/cc212029-9259-43a9-824b-ce7d725e4db3?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1e2ccab0-8f65-46f9-9b29-02d783b48a5e?api-version=2020-06-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 18 May 2020 22:05:22 GMT + - Wed, 16 Sep 2020 09:55:52 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/cc212029-9259-43a9-824b-ce7d725e4db3?monitor=true&api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1e2ccab0-8f65-46f9-9b29-02d783b48a5e?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -1840,7 +1821,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/VMScaleSetActions3Min;236,Microsoft.Compute/VMScaleSetActions30Min;1163,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;2897,Microsoft.Compute/VmssQueuedVMOperations;4799 + - Microsoft.Compute/VMScaleSetActions3Min;236,Microsoft.Compute/VMScaleSetActions30Min;1193,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;1196,Microsoft.Compute/VmssQueuedVMOperations;4799 x-ms-ratelimit-remaining-subscription-writes: - '1196' x-ms-request-charge: @@ -1858,13 +1839,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/cc212029-9259-43a9-824b-ce7d725e4db3?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1e2ccab0-8f65-46f9-9b29-02d783b48a5e?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T22:05:22.3274945+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"cc212029-9259-43a9-824b-ce7d725e4db3\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:55:52.2700816+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"1e2ccab0-8f65-46f9-9b29-02d783b48a5e\"\ \r\n}" headers: cache-control: @@ -1874,7 +1855,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 22:05:52 GMT + - Wed, 16 Sep 2020 09:56:22 GMT expires: - '-1' pragma: @@ -1891,7 +1872,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29902 + - Microsoft.Compute/GetOperation3Min;14987,Microsoft.Compute/GetOperation30Min;29899 status: code: 200 message: OK @@ -1905,13 +1886,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/cc212029-9259-43a9-824b-ce7d725e4db3?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1e2ccab0-8f65-46f9-9b29-02d783b48a5e?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T22:05:22.3274945+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"cc212029-9259-43a9-824b-ce7d725e4db3\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:55:52.2700816+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"1e2ccab0-8f65-46f9-9b29-02d783b48a5e\"\ \r\n}" headers: cache-control: @@ -1921,7 +1902,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 22:06:22 GMT + - Wed, 16 Sep 2020 09:56:52 GMT expires: - '-1' pragma: @@ -1938,7 +1919,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29899 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29896 status: code: 200 message: OK @@ -1952,13 +1933,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/cc212029-9259-43a9-824b-ce7d725e4db3?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1e2ccab0-8f65-46f9-9b29-02d783b48a5e?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T22:05:22.3274945+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"cc212029-9259-43a9-824b-ce7d725e4db3\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:55:52.2700816+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"1e2ccab0-8f65-46f9-9b29-02d783b48a5e\"\ \r\n}" headers: cache-control: @@ -1968,7 +1949,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 22:06:53 GMT + - Wed, 16 Sep 2020 09:57:23 GMT expires: - '-1' pragma: @@ -1985,7 +1966,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29895 + - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29893 status: code: 200 message: OK @@ -1999,13 +1980,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/cc212029-9259-43a9-824b-ce7d725e4db3?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1e2ccab0-8f65-46f9-9b29-02d783b48a5e?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T22:05:22.3274945+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"cc212029-9259-43a9-824b-ce7d725e4db3\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:55:52.2700816+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"1e2ccab0-8f65-46f9-9b29-02d783b48a5e\"\ \r\n}" headers: cache-control: @@ -2015,7 +1996,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 22:07:22 GMT + - Wed, 16 Sep 2020 09:57:53 GMT expires: - '-1' pragma: @@ -2032,7 +2013,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14980,Microsoft.Compute/GetOperation30Min;29891 + - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29890 status: code: 200 message: OK @@ -2046,28 +2027,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/cc212029-9259-43a9-824b-ce7d725e4db3?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1e2ccab0-8f65-46f9-9b29-02d783b48a5e?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T22:05:22.3274945+00:00\",\r\n \"\ - endTime\": \"2020-05-18T22:07:39.234631+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"properties\": {\r\n \"output\": {\"value\":[{\"code\":\"ComponentStatus/StdOut/succeeded\"\ - ,\"level\":\"Info\",\"displayStatus\":\"Provisioning succeeded\",\"message\"\ - :\"This is a sample script with parameters \"},{\"code\":\"ComponentStatus/StdErr/succeeded\"\ - ,\"level\":\"Info\",\"displayStatus\":\"Provisioning succeeded\",\"message\"\ - :\"\"}]}\r\n },\r\n \"name\": \"cc212029-9259-43a9-824b-ce7d725e4db3\"\r\ - \n}" + string: "{\r\n \"startTime\": \"2020-09-16T09:55:52.2700816+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"1e2ccab0-8f65-46f9-9b29-02d783b48a5e\"\ + \r\n}" headers: cache-control: - no-cache content-length: - - '502' + - '134' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 22:07:52 GMT + - Wed, 16 Sep 2020 09:58:23 GMT expires: - '-1' pragma: @@ -2084,7 +2060,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14980,Microsoft.Compute/GetOperation30Min;29888 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29887 status: code: 200 message: OK @@ -2098,23 +2074,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/cc212029-9259-43a9-824b-ce7d725e4db3?monitor=true&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1e2ccab0-8f65-46f9-9b29-02d783b48a5e?api-version=2020-06-01 response: body: - string: '{"value":[{"code":"ComponentStatus/StdOut/succeeded","level":"Info","displayStatus":"Provisioning - succeeded","message":"This is a sample script with parameters "},{"code":"ComponentStatus/StdErr/succeeded","level":"Info","displayStatus":"Provisioning - succeeded","message":""}]}' + string: "{\r\n \"startTime\": \"2020-09-16T09:55:52.2700816+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"1e2ccab0-8f65-46f9-9b29-02d783b48a5e\"\ + \r\n}" headers: cache-control: - no-cache content-length: - - '278' + - '134' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 22:07:53 GMT + - Wed, 16 Sep 2020 09:58:54 GMT expires: - '-1' pragma: @@ -2131,12 +2107,12 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14979,Microsoft.Compute/GetOperation30Min;29887 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29884 status: code: 200 message: OK - request: - body: '{"instanceIds": ["0"]}' + body: null headers: Accept: - '*/*' @@ -2144,30 +2120,31 @@ interactions: - gzip, deflate Connection: - keep-alive - Content-Length: - - '22' - Content-Type: - - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/manualupgrade?api-version=2019-12-01 + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1e2ccab0-8f65-46f9-9b29-02d783b48a5e?api-version=2020-06-01 response: body: - string: '' + string: "{\r\n \"startTime\": \"2020-09-16T09:55:52.2700816+00:00\",\r\n \"\ + endTime\": \"2020-09-16T09:59:13.6150657+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"properties\": {\r\n \"output\": {\"value\":[{\"code\":\"ComponentStatus/StdOut/succeeded\"\ + ,\"level\":\"Info\",\"displayStatus\":\"Provisioning succeeded\",\"message\"\ + :\"This is a sample script with parameters \"},{\"code\":\"ComponentStatus/StdErr/succeeded\"\ + ,\"level\":\"Info\",\"displayStatus\":\"Provisioning succeeded\",\"message\"\ + :\"\"}]}\r\n },\r\n \"name\": \"1e2ccab0-8f65-46f9-9b29-02d783b48a5e\"\r\ + \n}" headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b649f6e0-5b15-4390-9c59-cd9c568bdaae?api-version=2019-12-01 cache-control: - no-cache content-length: - - '0' + - '503' + content-type: + - application/json; charset=utf-8 date: - - Mon, 18 May 2020 22:07:53 GMT + - Wed, 16 Sep 2020 09:59:24 GMT expires: - '-1' - location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b649f6e0-5b15-4390-9c59-cd9c568bdaae?monitor=true&api-version=2019-12-01 pragma: - no-cache server: @@ -2175,17 +2152,17 @@ interactions: - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/VMScaleSetActions3Min;238,Microsoft.Compute/VMScaleSetActions30Min;1162,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;2897,Microsoft.Compute/VmssQueuedVMOperations;4799 - x-ms-ratelimit-remaining-subscription-writes: - - '1195' - x-ms-request-charge: - - '1' + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29881 status: - code: 202 - message: Accepted + code: 200 + message: OK - request: body: null headers: @@ -2196,23 +2173,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b649f6e0-5b15-4390-9c59-cd9c568bdaae?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1e2ccab0-8f65-46f9-9b29-02d783b48a5e?monitor=true&api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T22:07:54.281575+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"b649f6e0-5b15-4390-9c59-cd9c568bdaae\"\ - \r\n}" + string: '{"value":[{"code":"ComponentStatus/StdOut/succeeded","level":"Info","displayStatus":"Provisioning + succeeded","message":"This is a sample script with parameters "},{"code":"ComponentStatus/StdErr/succeeded","level":"Info","displayStatus":"Provisioning + succeeded","message":""}]}' headers: cache-control: - no-cache content-length: - - '133' + - '278' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 22:08:24 GMT + - Wed, 16 Sep 2020 09:59:25 GMT expires: - '-1' pragma: @@ -2229,12 +2206,12 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29885 + - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29880 status: code: 200 message: OK - request: - body: null + body: '{"instanceIds": ["1"]}' headers: Accept: - '*/*' @@ -2242,26 +2219,30 @@ interactions: - gzip, deflate Connection: - keep-alive + Content-Length: + - '22' + Content-Type: + - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b649f6e0-5b15-4390-9c59-cd9c568bdaae?api-version=2019-12-01 + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/manualupgrade?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T22:07:54.281575+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"b649f6e0-5b15-4390-9c59-cd9c568bdaae\"\ - \r\n}" + string: '' headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f1376e96-f4c7-47ec-853c-e5894eb488ca?api-version=2020-06-01 cache-control: - no-cache content-length: - - '133' - content-type: - - application/json; charset=utf-8 + - '0' date: - - Mon, 18 May 2020 22:08:54 GMT + - Wed, 16 Sep 2020 09:59:25 GMT expires: - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f1376e96-f4c7-47ec-853c-e5894eb488ca?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -2269,17 +2250,17 @@ interactions: - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29882 + - Microsoft.Compute/VMScaleSetActions3Min;239,Microsoft.Compute/VMScaleSetActions30Min;1192,Microsoft.Compute/VmssQueuedVMOperations;4800 + x-ms-ratelimit-remaining-subscription-writes: + - '1195' + x-ms-request-charge: + - '0' status: - code: 200 - message: OK + code: 202 + message: Accepted - request: body: null headers: @@ -2290,23 +2271,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b649f6e0-5b15-4390-9c59-cd9c568bdaae?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f1376e96-f4c7-47ec-853c-e5894eb488ca?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T22:07:54.281575+00:00\",\r\n \"\ - endTime\": \"2020-05-18T22:09:18.0320577+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"b649f6e0-5b15-4390-9c59-cd9c568bdaae\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T09:59:26.7089153+00:00\",\r\n \"\ + endTime\": \"2020-09-16T09:59:26.8495308+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"f1376e96-f4c7-47ec-853c-e5894eb488ca\"\r\n}" headers: cache-control: - no-cache content-length: - - '183' + - '184' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 22:09:24 GMT + - Wed, 16 Sep 2020 09:59:57 GMT expires: - '-1' pragma: @@ -2323,7 +2304,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29879 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29878 status: code: 200 message: OK @@ -2337,9 +2318,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b649f6e0-5b15-4390-9c59-cd9c568bdaae?monitor=true&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f1376e96-f4c7-47ec-853c-e5894eb488ca?monitor=true&api-version=2020-06-01 response: body: string: '' @@ -2349,7 +2330,7 @@ interactions: content-length: - '0' date: - - Mon, 18 May 2020 22:09:24 GMT + - Wed, 16 Sep 2020 09:59:57 GMT expires: - '-1' pragma: @@ -2362,7 +2343,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14980,Microsoft.Compute/GetOperation30Min;29878 + - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29877 status: code: 200 message: OK @@ -2378,25 +2359,25 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualmachines/0/deallocate?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualmachines/1/deallocate?api-version=2020-06-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b6c28b49-2608-4e96-b6c9-bbdcbc88bc74?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c70cd2ef-84c2-4553-9c21-2a3ab53104b8?api-version=2020-06-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 18 May 2020 22:09:25 GMT + - Wed, 16 Sep 2020 09:59:57 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b6c28b49-2608-4e96-b6c9-bbdcbc88bc74?monitor=true&api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c70cd2ef-84c2-4553-9c21-2a3ab53104b8?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -2407,7 +2388,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/DeleteVMScaleSetVM3Min;239,Microsoft.Compute/DeleteVMScaleSetVM30Min;1198,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;2898,Microsoft.Compute/VmssQueuedVMOperations;4799 + - Microsoft.Compute/DeleteVMScaleSetVM3Min;239,Microsoft.Compute/DeleteVMScaleSetVM30Min;1198,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;1197,Microsoft.Compute/VmssQueuedVMOperations;4799 x-ms-ratelimit-remaining-subscription-writes: - '1194' x-ms-request-charge: @@ -2425,13 +2406,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b6c28b49-2608-4e96-b6c9-bbdcbc88bc74?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c70cd2ef-84c2-4553-9c21-2a3ab53104b8?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T22:09:25.7039843+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"b6c28b49-2608-4e96-b6c9-bbdcbc88bc74\"\ + string: "{\r\n \"startTime\": \"2020-09-16T09:59:57.8809747+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"c70cd2ef-84c2-4553-9c21-2a3ab53104b8\"\ \r\n}" headers: cache-control: @@ -2441,7 +2422,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 22:09:55 GMT + - Wed, 16 Sep 2020 10:00:28 GMT expires: - '-1' pragma: @@ -2458,7 +2439,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29876 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29890 status: code: 200 message: OK @@ -2472,14 +2453,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b6c28b49-2608-4e96-b6c9-bbdcbc88bc74?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c70cd2ef-84c2-4553-9c21-2a3ab53104b8?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T22:09:25.7039843+00:00\",\r\n \"\ - endTime\": \"2020-05-18T22:10:10.5636047+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"b6c28b49-2608-4e96-b6c9-bbdcbc88bc74\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T09:59:57.8809747+00:00\",\r\n \"\ + endTime\": \"2020-09-16T10:00:32.7874275+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"c70cd2ef-84c2-4553-9c21-2a3ab53104b8\"\r\n}" headers: cache-control: - no-cache @@ -2488,7 +2469,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 22:10:25 GMT + - Wed, 16 Sep 2020 10:00:58 GMT expires: - '-1' pragma: @@ -2505,7 +2486,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29908 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29887 status: code: 200 message: OK @@ -2519,9 +2500,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b6c28b49-2608-4e96-b6c9-bbdcbc88bc74?monitor=true&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c70cd2ef-84c2-4553-9c21-2a3ab53104b8?monitor=true&api-version=2020-06-01 response: body: string: '' @@ -2531,7 +2512,7 @@ interactions: content-length: - '0' date: - - Mon, 18 May 2020 22:10:26 GMT + - Wed, 16 Sep 2020 10:00:58 GMT expires: - '-1' pragma: @@ -2544,12 +2525,12 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29907 + - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29886 status: code: 200 message: OK - request: - body: '{"instanceIds": ["0"]}' + body: '{"instanceIds": ["1"]}' headers: Accept: - '*/*' @@ -2562,25 +2543,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/delete?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/delete?api-version=2020-06-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b894e819-5256-4c20-b7c3-5030d98a58cd?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/df01cbfc-43de-43ca-bdd3-a633b0ac982c?api-version=2020-06-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 18 May 2020 22:10:26 GMT + - Wed, 16 Sep 2020 10:00:59 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b894e819-5256-4c20-b7c3-5030d98a58cd?monitor=true&api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/df01cbfc-43de-43ca-bdd3-a633b0ac982c?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -2591,7 +2572,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/VMScaleSetActions3Min;238,Microsoft.Compute/VMScaleSetActions30Min;1183,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;2898,Microsoft.Compute/VmssQueuedVMOperations;4799 + - Microsoft.Compute/VMScaleSetActions3Min;238,Microsoft.Compute/VMScaleSetActions30Min;1192,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;1198,Microsoft.Compute/VmssQueuedVMOperations;4799 x-ms-ratelimit-remaining-subscription-writes: - '1193' x-ms-request-charge: @@ -2609,23 +2590,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b894e819-5256-4c20-b7c3-5030d98a58cd?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/df01cbfc-43de-43ca-bdd3-a633b0ac982c?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T22:10:26.8294+00:00\",\r\n \"endTime\"\ - : \"2020-05-18T22:10:27.6574937+00:00\",\r\n \"status\": \"Succeeded\",\r\ - \n \"name\": \"b894e819-5256-4c20-b7c3-5030d98a58cd\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T10:00:59.6157647+00:00\",\r\n \"\ + endTime\": \"2020-09-16T10:01:00.5220212+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"df01cbfc-43de-43ca-bdd3-a633b0ac982c\"\r\n}" headers: cache-control: - no-cache content-length: - - '181' + - '184' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 22:10:56 GMT + - Wed, 16 Sep 2020 10:01:29 GMT expires: - '-1' pragma: @@ -2642,7 +2623,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29905 + - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29884 status: code: 200 message: OK @@ -2656,9 +2637,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b894e819-5256-4c20-b7c3-5030d98a58cd?monitor=true&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/df01cbfc-43de-43ca-bdd3-a633b0ac982c?monitor=true&api-version=2020-06-01 response: body: string: '' @@ -2668,7 +2649,7 @@ interactions: content-length: - '0' date: - - Mon, 18 May 2020 22:10:56 GMT + - Wed, 16 Sep 2020 10:01:29 GMT expires: - '-1' pragma: @@ -2681,7 +2662,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29904 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29883 status: code: 200 message: OK @@ -2697,25 +2678,25 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualmachines/0?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualmachines/1?api-version=2020-06-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/899aa6b6-5c64-4d2a-b689-4421b4eb0d82?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/498bee93-08d1-4c50-8ed4-42d701d8e528?api-version=2020-06-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 18 May 2020 22:10:57 GMT + - Wed, 16 Sep 2020 10:01:30 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/899aa6b6-5c64-4d2a-b689-4421b4eb0d82?monitor=true&api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/498bee93-08d1-4c50-8ed4-42d701d8e528?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -2728,7 +2709,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/DeleteVMScaleSetVM3Min;238,Microsoft.Compute/DeleteVMScaleSetVM30Min;1197,Microsoft.Compute/VmssQueuedVMOperations;4800 x-ms-ratelimit-remaining-subscription-deletes: - - '14999' + - '14998' x-ms-request-charge: - '0' status: @@ -2744,23 +2725,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/899aa6b6-5c64-4d2a-b689-4421b4eb0d82?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/498bee93-08d1-4c50-8ed4-42d701d8e528?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T22:10:57.704547+00:00\",\r\n \"\ - endTime\": \"2020-05-18T22:10:57.7983102+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"899aa6b6-5c64-4d2a-b689-4421b4eb0d82\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T10:01:30.7722586+00:00\",\r\n \"\ + endTime\": \"2020-09-16T10:01:30.8347298+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"498bee93-08d1-4c50-8ed4-42d701d8e528\"\r\n}" headers: cache-control: - no-cache content-length: - - '183' + - '184' content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 22:11:27 GMT + - Wed, 16 Sep 2020 10:02:01 GMT expires: - '-1' pragma: @@ -2777,7 +2758,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29902 + - Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29881 status: code: 200 message: OK @@ -2793,9 +2774,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d?api-version=2020-06-01 response: body: string: '' @@ -2803,17 +2784,17 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4105f5b7-4ecf-4000-8e11-ac728a62e29c?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1b6b38db-e76b-407f-97ec-06309e64e24f?api-version=2020-06-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 18 May 2020 22:11:28 GMT + - Wed, 16 Sep 2020 10:02:01 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4105f5b7-4ecf-4000-8e11-ac728a62e29c?monitor=true&api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1b6b38db-e76b-407f-97ec-06309e64e24f?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -2824,9 +2805,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/DeleteVMScaleSet3Min;79,Microsoft.Compute/DeleteVMScaleSet30Min;397,Microsoft.Compute/VmssQueuedVMOperations;4800 + - Microsoft.Compute/DeleteVMScaleSet3Min;79,Microsoft.Compute/DeleteVMScaleSet30Min;398,Microsoft.Compute/VmssQueuedVMOperations;4800 x-ms-ratelimit-remaining-subscription-deletes: - - '14998' + - '14997' x-ms-request-charge: - '0' status: @@ -2842,14 +2823,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4105f5b7-4ecf-4000-8e11-ac728a62e29c?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1b6b38db-e76b-407f-97ec-06309e64e24f?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-18T22:11:28.8609879+00:00\",\r\n \"\ - endTime\": \"2020-05-18T22:11:28.9703656+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"4105f5b7-4ecf-4000-8e11-ac728a62e29c\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T10:02:01.7411812+00:00\",\r\n \"\ + endTime\": \"2020-09-16T10:02:01.8505792+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"1b6b38db-e76b-407f-97ec-06309e64e24f\"\r\n}" headers: cache-control: - no-cache @@ -2858,7 +2839,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 18 May 2020 22:11:38 GMT + - Wed, 16 Sep 2020 10:02:12 GMT expires: - '-1' pragma: @@ -2875,7 +2856,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29900 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29879 status: code: 200 message: OK diff --git a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vmss.test_compute_vmss_vm_2.yaml b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vmss.test_compute_vmss_vm_2.yaml index 23236b29e567..13f639945ea9 100644 --- a/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vmss.test_compute_vmss_vm_2.yaml +++ b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_vmss.test_compute_vmss_vm_2.yaml @@ -12,21 +12,18 @@ interactions: Content-Length: - '92' Content-Type: - - application/json; charset=utf-8 + - application/json User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexb172129e?api-version=2019-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexb172129e?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"networknamexb172129e\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexb172129e\"\ - ,\r\n \"etag\": \"W/\\\"173da066-61c9-4f7e-88ae-aefe2f01e32f\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"16fe4a96-1b48-472c-aff3-d981e8f1013f\\\"\",\r\n \ \ \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \ - \ \"resourceGuid\": \"bb682289-f1d7-43cf-a4bc-cfcab986302a\",\r\n \"\ + \ \"resourceGuid\": \"16b2edd6-8d96-46d6-bf59-fee07bcb444a\",\r\n \"\ addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\ \r\n ]\r\n },\r\n \"subnets\": [],\r\n \"virtualNetworkPeerings\"\ : [],\r\n \"enableDdosProtection\": false,\r\n \"enableVmProtection\"\ @@ -35,15 +32,15 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/51641a12-d376-4bfd-9d5c-2c444a6b66a0?api-version=2019-09-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/8afd1d50-3de3-4585-b20a-fa2eab903fd4?api-version=2020-06-01 cache-control: - no-cache content-length: - - '705' + - '727' content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:07:13 GMT + - Wed, 16 Sep 2020 10:02:30 GMT expires: - '-1' pragma: @@ -56,7 +53,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 32193fcd-bb74-45f5-bbd9-51626516ee98 + - 77429595-285e-424f-9a7c-247b40779dc2 x-ms-ratelimit-remaining-subscription-writes: - '1198' status: @@ -66,16 +63,15 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/51641a12-d376-4bfd-9d5c-2c444a6b66a0?api-version=2019-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/8afd1d50-3de3-4585-b20a-fa2eab903fd4?api-version=2020-06-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -87,7 +83,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:07:18 GMT + - Wed, 16 Sep 2020 10:02:34 GMT expires: - '-1' pragma: @@ -104,7 +100,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 3c0f88ce-a267-46f5-a35b-5e6f49a08ac8 + - 09aea2e6-a23c-400d-8b9c-ee60e8718b3d status: code: 200 message: OK @@ -112,23 +108,22 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexb172129e?api-version=2019-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexb172129e?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"networknamexb172129e\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexb172129e\"\ - ,\r\n \"etag\": \"W/\\\"6b97dd39-4e69-4698-ad6d-0e4ed9180f56\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"b9ed397a-ad80-4337-816b-bf505399edb2\\\"\",\r\n \ \ \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n\ - \ \"resourceGuid\": \"bb682289-f1d7-43cf-a4bc-cfcab986302a\",\r\n \"\ + \ \"resourceGuid\": \"16b2edd6-8d96-46d6-bf59-fee07bcb444a\",\r\n \"\ addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\ \r\n ]\r\n },\r\n \"subnets\": [],\r\n \"virtualNetworkPeerings\"\ : [],\r\n \"enableDdosProtection\": false,\r\n \"enableVmProtection\"\ @@ -137,13 +132,13 @@ interactions: cache-control: - no-cache content-length: - - '706' + - '728' content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:07:18 GMT + - Wed, 16 Sep 2020 10:02:35 GMT etag: - - W/"6b97dd39-4e69-4698-ad6d-0e4ed9180f56" + - W/"b9ed397a-ad80-4337-816b-bf505399edb2" expires: - '-1' pragma: @@ -160,7 +155,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 84383a24-2d9e-4b66-80bf-35e3285d8764 + - f5fe2712-b4f3-4f35-a978-13a21a11eaef status: code: 200 message: OK @@ -176,33 +171,30 @@ interactions: Content-Length: - '48' Content-Type: - - application/json; charset=utf-8 + - application/json User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexb172129e/subnets/subnetnamexb172129e?api-version=2019-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexb172129e/subnets/subnetnamexb172129e?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"subnetnamexb172129e\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexb172129e/subnets/subnetnamexb172129e\"\ - ,\r\n \"etag\": \"W/\\\"13d38c81-21ac-4c64-8363-ea4826656b65\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"acccd7e4-7174-4a50-a17c-9612ab300715\\\"\",\r\n \ \ \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"\ addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\"\ : \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\ \n },\r\n \"type\": \"Microsoft.Network/virtualNetworks/subnets\"\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/7f55abd4-3aee-413b-a66e-7d84207f5b98?api-version=2019-09-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/14173817-eef6-49f8-af5e-5bb9007b48ac?api-version=2020-06-01 cache-control: - no-cache content-length: - - '602' + - '624' content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:07:19 GMT + - Wed, 16 Sep 2020 10:02:35 GMT expires: - '-1' pragma: @@ -215,7 +207,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 58dae68d-3988-4be2-992c-9cdb8a9445c1 + - c1c66278-e7cf-4f54-96dd-7b1e6142ff05 x-ms-ratelimit-remaining-subscription-writes: - '1197' status: @@ -225,16 +217,15 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/7f55abd4-3aee-413b-a66e-7d84207f5b98?api-version=2019-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/14173817-eef6-49f8-af5e-5bb9007b48ac?api-version=2020-06-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -246,7 +237,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:07:23 GMT + - Wed, 16 Sep 2020 10:02:39 GMT expires: - '-1' pragma: @@ -263,7 +254,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 887c64cd-6ad6-4d97-af3a-49ada674e887 + - 8cac1a43-645d-4b0c-b703-b87dd32a8e2e status: code: 200 message: OK @@ -271,20 +262,19 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python + - azsdk-python-azure-mgmt-network/16.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexb172129e/subnets/subnetnamexb172129e?api-version=2019-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexb172129e/subnets/subnetnamexb172129e?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"subnetnamexb172129e\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexb172129e/subnets/subnetnamexb172129e\"\ - ,\r\n \"etag\": \"W/\\\"75b3016f-7f30-4532-9848-b40132d0869c\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"546b87ff-c36d-432c-b511-2e1e4f394007\\\"\",\r\n \ \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"\ addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\"\ : \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\ @@ -293,13 +283,13 @@ interactions: cache-control: - no-cache content-length: - - '603' + - '625' content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:07:24 GMT + - Wed, 16 Sep 2020 10:02:39 GMT etag: - - W/"75b3016f-7f30-4532-9848-b40132d0869c" + - W/"546b87ff-c36d-432c-b511-2e1e4f394007" expires: - '-1' pragma: @@ -316,22 +306,22 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - c19238f2-8292-4c84-9c7e-f65212083710 + - 18e05cbf-1b4e-4ae4-a940-6e699e5d530b status: code: 200 message: OK - request: - body: 'b''{"location": "eastus", "sku": {"name": "Standard_D1_v2", "tier": "Standard", - "capacity": 1}, "properties": {"upgradePolicy": {"mode": "Manual"}, "virtualMachineProfile": - {"osProfile": {"computerNamePrefix": "testPC", "adminUsername": "testuser", - "adminPassword": "Aa!1()-xyz"}, "storageProfile": {"imageReference": {"publisher": - "MicrosoftWindowsServer", "offer": "WindowsServer", "sku": "2016-Datacenter", + body: 'b''b\''{"location": "eastus", "sku": {"name": "Standard_D1_v2", "tier": + "Standard", "capacity": 1}, "properties": {"upgradePolicy": {"mode": "Manual"}, + "virtualMachineProfile": {"osProfile": {"computerNamePrefix": "testPC", "adminUsername": + "testuser", "adminPassword": "Aa!1()-xyz"}, "storageProfile": {"imageReference": + {"publisher": "MicrosoftWindowsServer", "offer": "WindowsServer", "sku": "2016-Datacenter", "version": "latest"}, "osDisk": {"caching": "ReadWrite", "createOption": "FromImage", "diskSizeGB": 512, "managedDisk": {"storageAccountType": "Standard_LRS"}}}, "networkProfile": {"networkInterfaceConfigurations": [{"name": "testPC", "properties": {"primary": true, "ipConfigurations": [{"name": "testPC", "properties": {"subnet": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexb172129e/subnets/subnetnamexb172129e"}}}]}}]}}, - "overprovision": true}}''' + "overprovision": true}}\''''' headers: Accept: - application/json @@ -340,13 +330,13 @@ interactions: Connection: - keep-alive Content-Length: - - '995' + - '1017' Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb172129e?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb172129e?api-version=2020-06-01 response: body: string: "{\r\n \"name\": \"virtualmachinescalesetb172129e\",\r\n \"id\": \"\ @@ -381,20 +371,20 @@ interactions: : {}\r\n }\r\n }\r\n ]\r\n }\r\n },\r\n\ \ \"provisioningState\": \"Creating\",\r\n \"overprovision\": true,\r\ \n \"doNotRunExtensionsOnOverprovisionedVMs\": false,\r\n \"uniqueId\"\ - : \"840ead36-d050-4962-89ed-d97e63ea19ef\"\r\n }\r\n}" + : \"4601911f-7583-4ad5-922d-835148dd3d8f\"\r\n }\r\n}" headers: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/06ffe03b-6a2d-444e-97df-05a2ab2797dd?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3a8d4ca7-79c0-4873-9d00-e80f4e229924?api-version=2020-06-01 cache-control: - no-cache content-length: - - '2532' + - '2576' content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:07:32 GMT + - Wed, 16 Sep 2020 10:02:49 GMT expires: - '-1' pragma: @@ -407,7 +397,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/CreateVMScaleSet3Min;59,Microsoft.Compute/CreateVMScaleSet30Min;298,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;1198,Microsoft.Compute/VmssQueuedVMOperations;4798 + - Microsoft.Compute/CreateVMScaleSet3Min;59,Microsoft.Compute/CreateVMScaleSet30Min;298,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;1196,Microsoft.Compute/VmssQueuedVMOperations;4798 x-ms-ratelimit-remaining-subscription-writes: - '1198' x-ms-request-charge: @@ -425,13 +415,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/06ffe03b-6a2d-444e-97df-05a2ab2797dd?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3a8d4ca7-79c0-4873-9d00-e80f4e229924?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:07:30.6502435+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"06ffe03b-6a2d-444e-97df-05a2ab2797dd\"\ + string: "{\r\n \"startTime\": \"2020-09-16T10:02:48.0539863+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"3a8d4ca7-79c0-4873-9d00-e80f4e229924\"\ \r\n}" headers: cache-control: @@ -441,7 +431,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:07:42 GMT + - Wed, 16 Sep 2020 10:03:00 GMT expires: - '-1' pragma: @@ -458,7 +448,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14946,Microsoft.Compute/GetOperation30Min;29919 + - Microsoft.Compute/GetOperation3Min;14989,Microsoft.Compute/GetOperation30Min;29878 status: code: 200 message: OK @@ -472,13 +462,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/06ffe03b-6a2d-444e-97df-05a2ab2797dd?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3a8d4ca7-79c0-4873-9d00-e80f4e229924?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:07:30.6502435+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"06ffe03b-6a2d-444e-97df-05a2ab2797dd\"\ + string: "{\r\n \"startTime\": \"2020-09-16T10:02:48.0539863+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"3a8d4ca7-79c0-4873-9d00-e80f4e229924\"\ \r\n}" headers: cache-control: @@ -488,7 +478,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:09:20 GMT + - Wed, 16 Sep 2020 10:04:37 GMT expires: - '-1' pragma: @@ -505,7 +495,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14916,Microsoft.Compute/GetOperation30Min;29874 + - Microsoft.Compute/GetOperation3Min;14995,Microsoft.Compute/GetOperation30Min;29877 status: code: 200 message: OK @@ -519,13 +509,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/06ffe03b-6a2d-444e-97df-05a2ab2797dd?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3a8d4ca7-79c0-4873-9d00-e80f4e229924?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:07:30.6502435+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"06ffe03b-6a2d-444e-97df-05a2ab2797dd\"\ + string: "{\r\n \"startTime\": \"2020-09-16T10:02:48.0539863+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"3a8d4ca7-79c0-4873-9d00-e80f4e229924\"\ \r\n}" headers: cache-control: @@ -535,7 +525,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:09:50 GMT + - Wed, 16 Sep 2020 10:05:08 GMT expires: - '-1' pragma: @@ -552,7 +542,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14913,Microsoft.Compute/GetOperation30Min;29856 + - Microsoft.Compute/GetOperation3Min;14996,Microsoft.Compute/GetOperation30Min;29904 status: code: 200 message: OK @@ -566,13 +556,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/06ffe03b-6a2d-444e-97df-05a2ab2797dd?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3a8d4ca7-79c0-4873-9d00-e80f4e229924?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:07:30.6502435+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"06ffe03b-6a2d-444e-97df-05a2ab2797dd\"\ + string: "{\r\n \"startTime\": \"2020-09-16T10:02:48.0539863+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"3a8d4ca7-79c0-4873-9d00-e80f4e229924\"\ \r\n}" headers: cache-control: @@ -582,7 +572,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:10:21 GMT + - Wed, 16 Sep 2020 10:05:38 GMT expires: - '-1' pragma: @@ -599,7 +589,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14911,Microsoft.Compute/GetOperation30Min;29840 + - Microsoft.Compute/GetOperation3Min;14995,Microsoft.Compute/GetOperation30Min;29903 status: code: 200 message: OK @@ -613,13 +603,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/06ffe03b-6a2d-444e-97df-05a2ab2797dd?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3a8d4ca7-79c0-4873-9d00-e80f4e229924?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:07:30.6502435+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"06ffe03b-6a2d-444e-97df-05a2ab2797dd\"\ + string: "{\r\n \"startTime\": \"2020-09-16T10:02:48.0539863+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"3a8d4ca7-79c0-4873-9d00-e80f4e229924\"\ \r\n}" headers: cache-control: @@ -629,7 +619,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:10:52 GMT + - Wed, 16 Sep 2020 10:06:08 GMT expires: - '-1' pragma: @@ -646,7 +636,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14910,Microsoft.Compute/GetOperation30Min;29820 + - Microsoft.Compute/GetOperation3Min;14995,Microsoft.Compute/GetOperation30Min;29902 status: code: 200 message: OK @@ -660,13 +650,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/06ffe03b-6a2d-444e-97df-05a2ab2797dd?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3a8d4ca7-79c0-4873-9d00-e80f4e229924?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:07:30.6502435+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"06ffe03b-6a2d-444e-97df-05a2ab2797dd\"\ + string: "{\r\n \"startTime\": \"2020-09-16T10:02:48.0539863+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"3a8d4ca7-79c0-4873-9d00-e80f4e229924\"\ \r\n}" headers: cache-control: @@ -676,7 +666,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:11:22 GMT + - Wed, 16 Sep 2020 10:06:38 GMT expires: - '-1' pragma: @@ -693,7 +683,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14920,Microsoft.Compute/GetOperation30Min;29818 + - Microsoft.Compute/GetOperation3Min;14994,Microsoft.Compute/GetOperation30Min;29901 status: code: 200 message: OK @@ -707,13 +697,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/06ffe03b-6a2d-444e-97df-05a2ab2797dd?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3a8d4ca7-79c0-4873-9d00-e80f4e229924?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:07:30.6502435+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"06ffe03b-6a2d-444e-97df-05a2ab2797dd\"\ + string: "{\r\n \"startTime\": \"2020-09-16T10:02:48.0539863+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"3a8d4ca7-79c0-4873-9d00-e80f4e229924\"\ \r\n}" headers: cache-control: @@ -723,7 +713,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:11:53 GMT + - Wed, 16 Sep 2020 10:07:09 GMT expires: - '-1' pragma: @@ -740,7 +730,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14932,Microsoft.Compute/GetOperation30Min;29816 + - Microsoft.Compute/GetOperation3Min;14992,Microsoft.Compute/GetOperation30Min;29899 status: code: 200 message: OK @@ -754,23 +744,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/06ffe03b-6a2d-444e-97df-05a2ab2797dd?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3a8d4ca7-79c0-4873-9d00-e80f4e229924?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:07:30.6502435+00:00\",\r\n \"\ - endTime\": \"2020-06-01T09:12:20.0580665+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"06ffe03b-6a2d-444e-97df-05a2ab2797dd\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T10:02:48.0539863+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"3a8d4ca7-79c0-4873-9d00-e80f4e229924\"\ + \r\n}" headers: cache-control: - no-cache content-length: - - '184' + - '134' content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:12:24 GMT + - Wed, 16 Sep 2020 10:07:40 GMT expires: - '-1' pragma: @@ -787,7 +777,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14944,Microsoft.Compute/GetOperation30Min;29814 + - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29898 status: code: 200 message: OK @@ -801,53 +791,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb172129e?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3a8d4ca7-79c0-4873-9d00-e80f4e229924?api-version=2020-06-01 response: body: - string: "{\r\n \"name\": \"virtualmachinescalesetb172129e\",\r\n \"id\": \"\ - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb172129e\"\ - ,\r\n \"type\": \"Microsoft.Compute/virtualMachineScaleSets\",\r\n \"location\"\ - : \"eastus\",\r\n \"sku\": {\r\n \"name\": \"Standard_D1_v2\",\r\n \ - \ \"tier\": \"Standard\",\r\n \"capacity\": 1\r\n },\r\n \"properties\"\ - : {\r\n \"singlePlacementGroup\": true,\r\n \"upgradePolicy\": {\r\n\ - \ \"mode\": \"Manual\"\r\n },\r\n \"virtualMachineProfile\": {\r\ - \n \"osProfile\": {\r\n \"computerNamePrefix\": \"testPC\",\r\n\ - \ \"adminUsername\": \"testuser\",\r\n \"windowsConfiguration\"\ - : {\r\n \"provisionVMAgent\": true,\r\n \"enableAutomaticUpdates\"\ - : true\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\"\ - : true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \ - \ \"storageProfile\": {\r\n \"osDisk\": {\r\n \"createOption\"\ - : \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n \"\ - managedDisk\": {\r\n \"storageAccountType\": \"Standard_LRS\"\r\ - \n },\r\n \"diskSizeGB\": 512\r\n },\r\n \"\ - imageReference\": {\r\n \"publisher\": \"MicrosoftWindowsServer\"\ - ,\r\n \"offer\": \"WindowsServer\",\r\n \"sku\": \"2016-Datacenter\"\ - ,\r\n \"version\": \"latest\"\r\n }\r\n },\r\n \"\ - networkProfile\": {\"networkInterfaceConfigurations\":[{\"name\":\"testPC\"\ - ,\"properties\":{\"primary\":true,\"enableAcceleratedNetworking\":false,\"\ - dnsSettings\":{\"dnsServers\":[]},\"enableIPForwarding\":false,\"ipConfigurations\"\ - :[{\"name\":\"testPC\",\"properties\":{\"subnet\":{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexb172129e/subnets/subnetnamexb172129e\"\ - },\"privateIPAddressVersion\":\"IPv4\"}}]}}]},\r\n \"extensionProfile\"\ - : {\r\n \"extensions\": [\r\n {\r\n \"name\": \"\ - Microsoft.Azure.Geneva.GenevaMonitoring\",\r\n \"properties\":\ - \ {\r\n \"autoUpgradeMinorVersion\": true,\r\n \"\ - publisher\": \"Microsoft.Azure.Geneva\",\r\n \"type\": \"GenevaMonitoring\"\ - ,\r\n \"typeHandlerVersion\": \"2.0\",\r\n \"settings\"\ - : {}\r\n }\r\n }\r\n ]\r\n }\r\n },\r\n\ - \ \"provisioningState\": \"Succeeded\",\r\n \"overprovision\": true,\r\ - \n \"doNotRunExtensionsOnOverprovisionedVMs\": false,\r\n \"uniqueId\"\ - : \"840ead36-d050-4962-89ed-d97e63ea19ef\"\r\n }\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T10:02:48.0539863+00:00\",\r\n \"\ + endTime\": \"2020-09-16T10:08:07.1814915+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"3a8d4ca7-79c0-4873-9d00-e80f4e229924\"\r\n}" headers: cache-control: - no-cache content-length: - - '2533' + - '184' content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:12:24 GMT + - Wed, 16 Sep 2020 10:08:10 GMT expires: - '-1' pragma: @@ -864,7 +824,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetVMScaleSet3Min;393,Microsoft.Compute/GetVMScaleSet30Min;2586 + - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29897 status: code: 200 message: OK @@ -872,58 +832,59 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb172129e/virtualmachines/0/instanceView?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb172129e?api-version=2020-06-01 response: body: - string: "{\r\n \"placementGroupId\": \"9662a037-2685-4d0f-8e52-156a33a19f58\"\ - ,\r\n \"platformUpdateDomain\": 0,\r\n \"platformFaultDomain\": 0,\r\n \ - \ \"computerName\": \"testPC000000\",\r\n \"osName\": \"Windows Server 2016\ - \ Datacenter\",\r\n \"osVersion\": \"Microsoft Windows NT 10.0.14393.0\"\ - ,\r\n \"vmAgent\": {\r\n \"vmAgentVersion\": \"2.7.41491.971\",\r\n \ - \ \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\"\ - ,\r\n \"level\": \"Info\",\r\n \"displayStatus\": \"Ready\"\ - ,\r\n \"message\": \"GuestAgent is running and processing the extensions.\"\ - ,\r\n \"time\": \"2020-06-01T09:15:22+00:00\"\r\n }\r\n ],\r\ - \n \"extensionHandlers\": [\r\n {\r\n \"type\": \"Microsoft.Azure.Geneva.GenevaMonitoring\"\ - ,\r\n \"typeHandlerVersion\": \"2.17.0.2\",\r\n \"status\":\ - \ {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n \"\ - level\": \"Info\",\r\n \"displayStatus\": \"Ready\",\r\n \ - \ \"message\": \"ExtensionOperation:enable. Status:Success\"\r\n }\r\ - \n }\r\n ]\r\n },\r\n \"disks\": [\r\n {\r\n \"name\": \"\ - virtualmachinescalesvirtualmachinescaleseOS__1_2ad4689e79dc4e1981599aefaf75d3fb\"\ - ,\r\n \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\"\ - ,\r\n \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning\ - \ succeeded\",\r\n \"time\": \"2020-06-01T09:12:20.6986522+00:00\"\ - \r\n }\r\n ]\r\n }\r\n ],\r\n \"extensions\": [\r\n {\r\ - \n \"name\": \"Microsoft.Azure.Geneva.GenevaMonitoring\",\r\n \"\ - type\": \"Microsoft.Azure.Geneva.GenevaMonitoring\",\r\n \"typeHandlerVersion\"\ - : \"2.17.0.2\",\r\n \"statuses\": [\r\n {\r\n \"code\"\ - : \"ProvisioningState/succeeded\",\r\n \"level\": \"Info\",\r\n \ - \ \"displayStatus\": \"Provisioning succeeded\",\r\n \"message\"\ - : \"ExtensionOperation:enable. Status:Success\",\r\n \"time\": \"\ - 2020-06-01T09:15:15+00:00\"\r\n }\r\n ]\r\n }\r\n ],\r\n \ - \ \"hyperVGeneration\": \"V1\",\r\n \"statuses\": [\r\n {\r\n \"\ - code\": \"ProvisioningState/updating\",\r\n \"level\": \"Info\",\r\n\ - \ \"displayStatus\": \"Updating\"\r\n },\r\n {\r\n \"code\"\ - : \"PowerState/running\",\r\n \"level\": \"Info\",\r\n \"displayStatus\"\ - : \"VM running\"\r\n }\r\n ]\r\n}" + string: "{\r\n \"name\": \"virtualmachinescalesetb172129e\",\r\n \"id\": \"\ + /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb172129e\"\ + ,\r\n \"type\": \"Microsoft.Compute/virtualMachineScaleSets\",\r\n \"location\"\ + : \"eastus\",\r\n \"sku\": {\r\n \"name\": \"Standard_D1_v2\",\r\n \ + \ \"tier\": \"Standard\",\r\n \"capacity\": 1\r\n },\r\n \"properties\"\ + : {\r\n \"singlePlacementGroup\": true,\r\n \"upgradePolicy\": {\r\n\ + \ \"mode\": \"Manual\"\r\n },\r\n \"virtualMachineProfile\": {\r\ + \n \"osProfile\": {\r\n \"computerNamePrefix\": \"testPC\",\r\n\ + \ \"adminUsername\": \"testuser\",\r\n \"windowsConfiguration\"\ + : {\r\n \"provisionVMAgent\": true,\r\n \"enableAutomaticUpdates\"\ + : true\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\"\ + : true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \ + \ \"storageProfile\": {\r\n \"osDisk\": {\r\n \"createOption\"\ + : \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n \"\ + managedDisk\": {\r\n \"storageAccountType\": \"Standard_LRS\"\r\ + \n },\r\n \"diskSizeGB\": 512\r\n },\r\n \"\ + imageReference\": {\r\n \"publisher\": \"MicrosoftWindowsServer\"\ + ,\r\n \"offer\": \"WindowsServer\",\r\n \"sku\": \"2016-Datacenter\"\ + ,\r\n \"version\": \"latest\"\r\n }\r\n },\r\n \"\ + networkProfile\": {\"networkInterfaceConfigurations\":[{\"name\":\"testPC\"\ + ,\"properties\":{\"primary\":true,\"enableAcceleratedNetworking\":false,\"\ + dnsSettings\":{\"dnsServers\":[]},\"enableIPForwarding\":false,\"ipConfigurations\"\ + :[{\"name\":\"testPC\",\"properties\":{\"subnet\":{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexb172129e/subnets/subnetnamexb172129e\"\ + },\"privateIPAddressVersion\":\"IPv4\"}}]}}]},\r\n \"extensionProfile\"\ + : {\r\n \"extensions\": [\r\n {\r\n \"name\": \"\ + Microsoft.Azure.Geneva.GenevaMonitoring\",\r\n \"properties\":\ + \ {\r\n \"autoUpgradeMinorVersion\": true,\r\n \"\ + publisher\": \"Microsoft.Azure.Geneva\",\r\n \"type\": \"GenevaMonitoring\"\ + ,\r\n \"typeHandlerVersion\": \"2.0\",\r\n \"settings\"\ + : {}\r\n }\r\n }\r\n ]\r\n }\r\n },\r\n\ + \ \"provisioningState\": \"Succeeded\",\r\n \"overprovision\": true,\r\ + \n \"doNotRunExtensionsOnOverprovisionedVMs\": false,\r\n \"uniqueId\"\ + : \"4601911f-7583-4ad5-922d-835148dd3d8f\"\r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '2114' + - '2577' content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:15:25 GMT + - Wed, 16 Sep 2020 10:08:10 GMT expires: - '-1' pragma: @@ -940,9 +901,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetVMScaleSetVM3Min;999,Microsoft.Compute/GetVMScaleSetVM30Min;4998,Microsoft.Compute/VMScaleSetVMViews3Min;4997 - x-ms-request-charge: - - '1' + - Microsoft.Compute/GetVMScaleSet3Min;399,Microsoft.Compute/GetVMScaleSet30Min;2573 status: code: 200 message: OK @@ -950,78 +909,28 @@ interactions: body: null headers: Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb172129e/virtualmachines/0/redeploy?api-version=2019-12-01 - response: - body: - string: '' - headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4e4ea615-f0cd-4768-b782-a511ae6d2b87?api-version=2019-12-01 - cache-control: - - no-cache - content-length: - - '0' - date: - - Mon, 01 Jun 2020 09:15:25 GMT - expires: - - '-1' - location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4e4ea615-f0cd-4768-b782-a511ae6d2b87?monitor=true&api-version=2019-12-01 - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/VMScaleSetActions3Min;239,Microsoft.Compute/VMScaleSetActions30Min;1197,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;1199,Microsoft.Compute/VmssQueuedVMOperations;4799 - x-ms-ratelimit-remaining-subscription-writes: - - '1191' - x-ms-request-charge: - - '1' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4e4ea615-f0cd-4768-b782-a511ae6d2b87?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb172129e/virtualmachines/0/instanceView?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:15:25.8398442+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"4e4ea615-f0cd-4768-b782-a511ae6d2b87\"\ - \r\n}" + string: "{\r\n \"error\": {\r\n \"code\": \"NotFound\",\r\n \"message\"\ + : \"The entity was not found in this Azure location.\"\r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '134' + - '115' content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:15:56 GMT + - Wed, 16 Sep 2020 10:11:11 GMT expires: - '-1' pragma: @@ -1031,44 +940,72 @@ interactions: - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14996,Microsoft.Compute/GetOperation30Min;29817 + - Microsoft.Compute/GetVMScaleSetVM3Min;999,Microsoft.Compute/GetVMScaleSetVM30Min;4993,Microsoft.Compute/VMScaleSetVMViews3Min;4999 + x-ms-request-charge: + - '1' status: - code: 200 - message: OK + code: 404 + message: Not Found - request: body: null headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4e4ea615-f0cd-4768-b782-a511ae6d2b87?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb172129e/virtualmachines/1/instanceView?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:15:25.8398442+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"4e4ea615-f0cd-4768-b782-a511ae6d2b87\"\ - \r\n}" + string: "{\r\n \"placementGroupId\": \"329a9e8e-805b-4e93-88b5-caf9449bf90f\"\ + ,\r\n \"platformUpdateDomain\": 1,\r\n \"platformFaultDomain\": 1,\r\n \ + \ \"computerName\": \"testPC000001\",\r\n \"osName\": \"Windows Server 2016\ + \ Datacenter\",\r\n \"osVersion\": \"Microsoft Windows NT 10.0.14393.0\"\ + ,\r\n \"vmAgent\": {\r\n \"vmAgentVersion\": \"2.7.41491.993\",\r\n \ + \ \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\"\ + ,\r\n \"level\": \"Info\",\r\n \"displayStatus\": \"Ready\"\ + ,\r\n \"message\": \"GuestAgent is running and processing the extensions.\"\ + ,\r\n \"time\": \"2020-09-16T10:11:06+00:00\"\r\n }\r\n ],\r\ + \n \"extensionHandlers\": [\r\n {\r\n \"type\": \"Microsoft.Azure.Geneva.GenevaMonitoring\"\ + ,\r\n \"typeHandlerVersion\": \"2.19.0.1\",\r\n \"status\":\ + \ {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n \"\ + level\": \"Info\",\r\n \"displayStatus\": \"Ready\",\r\n \ + \ \"message\": \"ExtensionOperation:enable. Status:Success\"\r\n }\r\ + \n }\r\n ]\r\n },\r\n \"disks\": [\r\n {\r\n \"name\": \"\ + virtualmachinescalesvirtualmachinescaleseOS__1_f550d9440299400da79099017ea86fdc\"\ + ,\r\n \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\"\ + ,\r\n \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning\ + \ succeeded\",\r\n \"time\": \"2020-09-16T10:02:59.913464+00:00\"\ + \r\n }\r\n ]\r\n }\r\n ],\r\n \"extensions\": [\r\n {\r\ + \n \"name\": \"Microsoft.Azure.Geneva.GenevaMonitoring\",\r\n \"\ + type\": \"Microsoft.Azure.Geneva.GenevaMonitoring\",\r\n \"typeHandlerVersion\"\ + : \"2.19.0.1\",\r\n \"statuses\": [\r\n {\r\n \"code\"\ + : \"ProvisioningState/succeeded\",\r\n \"level\": \"Info\",\r\n \ + \ \"displayStatus\": \"Provisioning succeeded\",\r\n \"message\"\ + : \"ExtensionOperation:enable. Status:Success\",\r\n \"time\": \"\ + 2020-09-16T10:11:04+00:00\"\r\n }\r\n ]\r\n }\r\n ],\r\n \ + \ \"hyperVGeneration\": \"V1\",\r\n \"statuses\": [\r\n {\r\n \"\ + code\": \"ProvisioningState/succeeded\",\r\n \"level\": \"Info\",\r\n\ + \ \"displayStatus\": \"Provisioning succeeded\",\r\n \"time\": \"\ + 2020-09-16T10:08:07.1190171+00:00\"\r\n },\r\n {\r\n \"code\":\ + \ \"PowerState/running\",\r\n \"level\": \"Info\",\r\n \"displayStatus\"\ + : \"VM running\"\r\n }\r\n ]\r\n}" headers: cache-control: - no-cache content-length: - - '134' + - '2180' content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:16:26 GMT + - Wed, 16 Sep 2020 10:11:12 GMT expires: - '-1' pragma: @@ -1085,7 +1022,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14994,Microsoft.Compute/GetOperation30Min;29814 + - Microsoft.Compute/GetVMScaleSetVM3Min;998,Microsoft.Compute/GetVMScaleSetVM30Min;4992,Microsoft.Compute/VMScaleSetVMViews3Min;4998 + x-ms-request-charge: + - '1' status: code: 200 message: OK @@ -1098,26 +1037,28 @@ interactions: - gzip, deflate Connection: - keep-alive + Content-Length: + - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4e4ea615-f0cd-4768-b782-a511ae6d2b87?api-version=2019-12-01 + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb172129e/virtualmachines/1/redeploy?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:15:25.8398442+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"4e4ea615-f0cd-4768-b782-a511ae6d2b87\"\ - \r\n}" + string: '' headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2c83d105-2a2f-4702-b732-8f25b4311c1f?api-version=2020-06-01 cache-control: - no-cache content-length: - - '134' - content-type: - - application/json; charset=utf-8 + - '0' date: - - Mon, 01 Jun 2020 09:16:56 GMT + - Wed, 16 Sep 2020 10:11:12 GMT expires: - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2c83d105-2a2f-4702-b732-8f25b4311c1f?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -1125,17 +1066,17 @@ interactions: - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14992,Microsoft.Compute/GetOperation30Min;29811 + - Microsoft.Compute/VMScaleSetActions3Min;239,Microsoft.Compute/VMScaleSetActions30Min;1193,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;1199,Microsoft.Compute/VmssQueuedVMOperations;4799 + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + x-ms-request-charge: + - '1' status: - code: 200 - message: OK + code: 202 + message: Accepted - request: body: null headers: @@ -1146,23 +1087,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4e4ea615-f0cd-4768-b782-a511ae6d2b87?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2c83d105-2a2f-4702-b732-8f25b4311c1f?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:15:25.8398442+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"4e4ea615-f0cd-4768-b782-a511ae6d2b87\"\ + string: "{\r\n \"startTime\": \"2020-09-16T10:11:12.948353+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"2c83d105-2a2f-4702-b732-8f25b4311c1f\"\ \r\n}" headers: cache-control: - no-cache content-length: - - '134' + - '133' content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:17:26 GMT + - Wed, 16 Sep 2020 10:11:42 GMT expires: - '-1' pragma: @@ -1179,7 +1120,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14989,Microsoft.Compute/GetOperation30Min;29808 + - Microsoft.Compute/GetOperation3Min;14998,Microsoft.Compute/GetOperation30Min;29926 status: code: 200 message: OK @@ -1193,23 +1134,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4e4ea615-f0cd-4768-b782-a511ae6d2b87?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2c83d105-2a2f-4702-b732-8f25b4311c1f?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:15:25.8398442+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"4e4ea615-f0cd-4768-b782-a511ae6d2b87\"\ + string: "{\r\n \"startTime\": \"2020-09-16T10:11:12.948353+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"2c83d105-2a2f-4702-b732-8f25b4311c1f\"\ \r\n}" headers: cache-control: - no-cache content-length: - - '134' + - '133' content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:17:57 GMT + - Wed, 16 Sep 2020 10:12:12 GMT expires: - '-1' pragma: @@ -1226,7 +1167,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29805 + - Microsoft.Compute/GetOperation3Min;14995,Microsoft.Compute/GetOperation30Min;29923 status: code: 200 message: OK @@ -1240,23 +1181,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4e4ea615-f0cd-4768-b782-a511ae6d2b87?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2c83d105-2a2f-4702-b732-8f25b4311c1f?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:15:25.8398442+00:00\",\r\n \"\ - endTime\": \"2020-06-01T09:18:20.5741708+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"4e4ea615-f0cd-4768-b782-a511ae6d2b87\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T10:11:12.948353+00:00\",\r\n \"\ + endTime\": \"2020-09-16T10:12:28.5582494+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"2c83d105-2a2f-4702-b732-8f25b4311c1f\"\r\n}" headers: cache-control: - no-cache content-length: - - '184' + - '183' content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:18:27 GMT + - Wed, 16 Sep 2020 10:12:44 GMT expires: - '-1' pragma: @@ -1273,7 +1214,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29802 + - Microsoft.Compute/GetOperation3Min;14992,Microsoft.Compute/GetOperation30Min;29920 status: code: 200 message: OK @@ -1287,9 +1228,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4e4ea615-f0cd-4768-b782-a511ae6d2b87?monitor=true&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2c83d105-2a2f-4702-b732-8f25b4311c1f?monitor=true&api-version=2020-06-01 response: body: string: '' @@ -1299,7 +1240,7 @@ interactions: content-length: - '0' date: - - Mon, 01 Jun 2020 09:18:27 GMT + - Wed, 16 Sep 2020 10:12:44 GMT expires: - '-1' pragma: @@ -1312,7 +1253,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29801 + - Microsoft.Compute/GetOperation3Min;14991,Microsoft.Compute/GetOperation30Min;29919 status: code: 200 message: OK @@ -1330,25 +1271,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb172129e/virtualmachines/0/reimage?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb172129e/virtualmachines/1/reimage?api-version=2020-06-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3d9167e9-80e1-47fa-aefa-fb095e7c658d?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7ebd8b07-1183-4b8a-b348-be7c9539b754?api-version=2020-06-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 01 Jun 2020 09:18:29 GMT + - Wed, 16 Sep 2020 10:12:44 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3d9167e9-80e1-47fa-aefa-fb095e7c658d?monitor=true&api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7ebd8b07-1183-4b8a-b348-be7c9539b754?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -1359,9 +1300,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/VMScaleSetActions3Min;238,Microsoft.Compute/VMScaleSetActions30Min;1195,Microsoft.Compute/VMScaleSetVMActions3Min;199,Microsoft.Compute/VMScaleSetVMActions30Min;999,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;1198,Microsoft.Compute/VmssQueuedVMOperations;4799 + - Microsoft.Compute/VMScaleSetActions3Min;238,Microsoft.Compute/VMScaleSetActions30Min;1192,Microsoft.Compute/VMScaleSetVMActions3Min;199,Microsoft.Compute/VMScaleSetVMActions30Min;997,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;1198,Microsoft.Compute/VmssQueuedVMOperations;4799 x-ms-ratelimit-remaining-subscription-writes: - - '1190' + - '1196' x-ms-request-charge: - '1' status: @@ -1377,13 +1318,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3d9167e9-80e1-47fa-aefa-fb095e7c658d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7ebd8b07-1183-4b8a-b348-be7c9539b754?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:18:29.4023509+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3d9167e9-80e1-47fa-aefa-fb095e7c658d\"\ + string: "{\r\n \"startTime\": \"2020-09-16T10:12:44.8396681+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"7ebd8b07-1183-4b8a-b348-be7c9539b754\"\ \r\n}" headers: cache-control: @@ -1393,7 +1334,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:18:59 GMT + - Wed, 16 Sep 2020 10:13:15 GMT expires: - '-1' pragma: @@ -1410,7 +1351,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29799 + - Microsoft.Compute/GetOperation3Min;14989,Microsoft.Compute/GetOperation30Min;29917 status: code: 200 message: OK @@ -1424,13 +1365,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3d9167e9-80e1-47fa-aefa-fb095e7c658d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7ebd8b07-1183-4b8a-b348-be7c9539b754?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:18:29.4023509+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3d9167e9-80e1-47fa-aefa-fb095e7c658d\"\ + string: "{\r\n \"startTime\": \"2020-09-16T10:12:44.8396681+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"7ebd8b07-1183-4b8a-b348-be7c9539b754\"\ \r\n}" headers: cache-control: @@ -1440,7 +1381,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:19:30 GMT + - Wed, 16 Sep 2020 10:13:45 GMT expires: - '-1' pragma: @@ -1457,7 +1398,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29796 + - Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29914 status: code: 200 message: OK @@ -1471,13 +1412,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3d9167e9-80e1-47fa-aefa-fb095e7c658d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7ebd8b07-1183-4b8a-b348-be7c9539b754?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:18:29.4023509+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3d9167e9-80e1-47fa-aefa-fb095e7c658d\"\ + string: "{\r\n \"startTime\": \"2020-09-16T10:12:44.8396681+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"7ebd8b07-1183-4b8a-b348-be7c9539b754\"\ \r\n}" headers: cache-control: @@ -1487,7 +1428,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:20:01 GMT + - Wed, 16 Sep 2020 10:14:15 GMT expires: - '-1' pragma: @@ -1504,7 +1445,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29800 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29911 status: code: 200 message: OK @@ -1518,13 +1459,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3d9167e9-80e1-47fa-aefa-fb095e7c658d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7ebd8b07-1183-4b8a-b348-be7c9539b754?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:18:29.4023509+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3d9167e9-80e1-47fa-aefa-fb095e7c658d\"\ + string: "{\r\n \"startTime\": \"2020-09-16T10:12:44.8396681+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"7ebd8b07-1183-4b8a-b348-be7c9539b754\"\ \r\n}" headers: cache-control: @@ -1534,7 +1475,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:20:31 GMT + - Wed, 16 Sep 2020 10:14:46 GMT expires: - '-1' pragma: @@ -1551,7 +1492,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29798 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29908 status: code: 200 message: OK @@ -1565,13 +1506,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3d9167e9-80e1-47fa-aefa-fb095e7c658d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7ebd8b07-1183-4b8a-b348-be7c9539b754?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:18:29.4023509+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3d9167e9-80e1-47fa-aefa-fb095e7c658d\"\ + string: "{\r\n \"startTime\": \"2020-09-16T10:12:44.8396681+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"7ebd8b07-1183-4b8a-b348-be7c9539b754\"\ \r\n}" headers: cache-control: @@ -1581,7 +1522,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:21:01 GMT + - Wed, 16 Sep 2020 10:15:16 GMT expires: - '-1' pragma: @@ -1598,7 +1539,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14987,Microsoft.Compute/GetOperation30Min;29795 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29914 status: code: 200 message: OK @@ -1612,13 +1553,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3d9167e9-80e1-47fa-aefa-fb095e7c658d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7ebd8b07-1183-4b8a-b348-be7c9539b754?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:18:29.4023509+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3d9167e9-80e1-47fa-aefa-fb095e7c658d\"\ + string: "{\r\n \"startTime\": \"2020-09-16T10:12:44.8396681+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"7ebd8b07-1183-4b8a-b348-be7c9539b754\"\ \r\n}" headers: cache-control: @@ -1628,7 +1569,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:21:32 GMT + - Wed, 16 Sep 2020 10:15:46 GMT expires: - '-1' pragma: @@ -1645,7 +1586,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29792 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29911 status: code: 200 message: OK @@ -1659,13 +1600,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3d9167e9-80e1-47fa-aefa-fb095e7c658d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7ebd8b07-1183-4b8a-b348-be7c9539b754?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:18:29.4023509+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3d9167e9-80e1-47fa-aefa-fb095e7c658d\"\ + string: "{\r\n \"startTime\": \"2020-09-16T10:12:44.8396681+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"7ebd8b07-1183-4b8a-b348-be7c9539b754\"\ \r\n}" headers: cache-control: @@ -1675,7 +1616,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:22:03 GMT + - Wed, 16 Sep 2020 10:16:17 GMT expires: - '-1' pragma: @@ -1692,7 +1633,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29789 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29909 status: code: 200 message: OK @@ -1706,13 +1647,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3d9167e9-80e1-47fa-aefa-fb095e7c658d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7ebd8b07-1183-4b8a-b348-be7c9539b754?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:18:29.4023509+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3d9167e9-80e1-47fa-aefa-fb095e7c658d\"\ + string: "{\r\n \"startTime\": \"2020-09-16T10:12:44.8396681+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"7ebd8b07-1183-4b8a-b348-be7c9539b754\"\ \r\n}" headers: cache-control: @@ -1722,7 +1663,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:22:33 GMT + - Wed, 16 Sep 2020 10:16:47 GMT expires: - '-1' pragma: @@ -1739,7 +1680,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29786 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29906 status: code: 200 message: OK @@ -1753,13 +1694,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3d9167e9-80e1-47fa-aefa-fb095e7c658d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7ebd8b07-1183-4b8a-b348-be7c9539b754?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:18:29.4023509+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"3d9167e9-80e1-47fa-aefa-fb095e7c658d\"\ + string: "{\r\n \"startTime\": \"2020-09-16T10:12:44.8396681+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"7ebd8b07-1183-4b8a-b348-be7c9539b754\"\ \r\n}" headers: cache-control: @@ -1769,7 +1710,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:23:03 GMT + - Wed, 16 Sep 2020 10:17:18 GMT expires: - '-1' pragma: @@ -1786,7 +1727,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29783 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29903 status: code: 200 message: OK @@ -1800,14 +1741,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3d9167e9-80e1-47fa-aefa-fb095e7c658d?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7ebd8b07-1183-4b8a-b348-be7c9539b754?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:18:29.4023509+00:00\",\r\n \"\ - endTime\": \"2020-06-01T09:23:22.1062381+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"3d9167e9-80e1-47fa-aefa-fb095e7c658d\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T10:12:44.8396681+00:00\",\r\n \"\ + endTime\": \"2020-09-16T10:17:48.0761505+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"7ebd8b07-1183-4b8a-b348-be7c9539b754\"\r\n}" headers: cache-control: - no-cache @@ -1816,7 +1757,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:23:34 GMT + - Wed, 16 Sep 2020 10:17:48 GMT expires: - '-1' pragma: @@ -1833,7 +1774,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29781 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29900 status: code: 200 message: OK @@ -1847,9 +1788,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/3d9167e9-80e1-47fa-aefa-fb095e7c658d?monitor=true&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7ebd8b07-1183-4b8a-b348-be7c9539b754?monitor=true&api-version=2020-06-01 response: body: string: '' @@ -1859,7 +1800,7 @@ interactions: content-length: - '0' date: - - Mon, 01 Jun 2020 09:23:34 GMT + - Wed, 16 Sep 2020 10:17:48 GMT expires: - '-1' pragma: @@ -1872,7 +1813,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29780 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29899 status: code: 200 message: OK @@ -1888,25 +1829,25 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb172129e/virtualmachines/0/reimageall?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb172129e/virtualmachines/1/reimageall?api-version=2020-06-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/ec84f944-79dd-4c67-b56a-350c0e3d873e?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d3527cd2-6337-4501-9c96-173dae6e6e56?api-version=2020-06-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 01 Jun 2020 09:23:35 GMT + - Wed, 16 Sep 2020 10:17:49 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/ec84f944-79dd-4c67-b56a-350c0e3d873e?monitor=true&api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d3527cd2-6337-4501-9c96-173dae6e6e56?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -1917,9 +1858,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/VMScaleSetActions3Min;239,Microsoft.Compute/VMScaleSetActions30Min;1194,Microsoft.Compute/VMScaleSetVMActions3Min;199,Microsoft.Compute/VMScaleSetVMActions30Min;998,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;1199,Microsoft.Compute/VmssQueuedVMOperations;4799 + - Microsoft.Compute/VMScaleSetActions3Min;239,Microsoft.Compute/VMScaleSetActions30Min;1191,Microsoft.Compute/VMScaleSetVMActions3Min;199,Microsoft.Compute/VMScaleSetVMActions30Min;996,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;1199,Microsoft.Compute/VmssQueuedVMOperations;4799 x-ms-ratelimit-remaining-subscription-writes: - - '1189' + - '1195' x-ms-request-charge: - '1' status: @@ -1935,13 +1876,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/ec84f944-79dd-4c67-b56a-350c0e3d873e?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d3527cd2-6337-4501-9c96-173dae6e6e56?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:23:35.2156675+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"ec84f944-79dd-4c67-b56a-350c0e3d873e\"\ + string: "{\r\n \"startTime\": \"2020-09-16T10:17:49.3886047+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"d3527cd2-6337-4501-9c96-173dae6e6e56\"\ \r\n}" headers: cache-control: @@ -1951,7 +1892,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:24:05 GMT + - Wed, 16 Sep 2020 10:18:19 GMT expires: - '-1' pragma: @@ -1968,7 +1909,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29777 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29896 status: code: 200 message: OK @@ -1982,13 +1923,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/ec84f944-79dd-4c67-b56a-350c0e3d873e?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d3527cd2-6337-4501-9c96-173dae6e6e56?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:23:35.2156675+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"ec84f944-79dd-4c67-b56a-350c0e3d873e\"\ + string: "{\r\n \"startTime\": \"2020-09-16T10:17:49.3886047+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"d3527cd2-6337-4501-9c96-173dae6e6e56\"\ \r\n}" headers: cache-control: @@ -1998,7 +1939,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:24:35 GMT + - Wed, 16 Sep 2020 10:18:50 GMT expires: - '-1' pragma: @@ -2015,7 +1956,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29774 + - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29893 status: code: 200 message: OK @@ -2029,13 +1970,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/ec84f944-79dd-4c67-b56a-350c0e3d873e?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d3527cd2-6337-4501-9c96-173dae6e6e56?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:23:35.2156675+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"ec84f944-79dd-4c67-b56a-350c0e3d873e\"\ + string: "{\r\n \"startTime\": \"2020-09-16T10:17:49.3886047+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"d3527cd2-6337-4501-9c96-173dae6e6e56\"\ \r\n}" headers: cache-control: @@ -2045,7 +1986,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:25:05 GMT + - Wed, 16 Sep 2020 10:19:20 GMT expires: - '-1' pragma: @@ -2062,7 +2003,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29780 + - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29890 status: code: 200 message: OK @@ -2076,13 +2017,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/ec84f944-79dd-4c67-b56a-350c0e3d873e?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d3527cd2-6337-4501-9c96-173dae6e6e56?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:23:35.2156675+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"ec84f944-79dd-4c67-b56a-350c0e3d873e\"\ + string: "{\r\n \"startTime\": \"2020-09-16T10:17:49.3886047+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"d3527cd2-6337-4501-9c96-173dae6e6e56\"\ \r\n}" headers: cache-control: @@ -2092,7 +2033,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:25:36 GMT + - Wed, 16 Sep 2020 10:19:50 GMT expires: - '-1' pragma: @@ -2109,7 +2050,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29777 + - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29887 status: code: 200 message: OK @@ -2123,13 +2064,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/ec84f944-79dd-4c67-b56a-350c0e3d873e?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d3527cd2-6337-4501-9c96-173dae6e6e56?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:23:35.2156675+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"ec84f944-79dd-4c67-b56a-350c0e3d873e\"\ + string: "{\r\n \"startTime\": \"2020-09-16T10:17:49.3886047+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"d3527cd2-6337-4501-9c96-173dae6e6e56\"\ \r\n}" headers: cache-control: @@ -2139,7 +2080,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:26:07 GMT + - Wed, 16 Sep 2020 10:20:21 GMT expires: - '-1' pragma: @@ -2156,7 +2097,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29774 + - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29891 status: code: 200 message: OK @@ -2170,13 +2111,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/ec84f944-79dd-4c67-b56a-350c0e3d873e?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d3527cd2-6337-4501-9c96-173dae6e6e56?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:23:35.2156675+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"ec84f944-79dd-4c67-b56a-350c0e3d873e\"\ + string: "{\r\n \"startTime\": \"2020-09-16T10:17:49.3886047+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"d3527cd2-6337-4501-9c96-173dae6e6e56\"\ \r\n}" headers: cache-control: @@ -2186,7 +2127,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:26:37 GMT + - Wed, 16 Sep 2020 10:20:52 GMT expires: - '-1' pragma: @@ -2203,7 +2144,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29771 + - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29888 status: code: 200 message: OK @@ -2217,13 +2158,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/ec84f944-79dd-4c67-b56a-350c0e3d873e?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d3527cd2-6337-4501-9c96-173dae6e6e56?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:23:35.2156675+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"ec84f944-79dd-4c67-b56a-350c0e3d873e\"\ + string: "{\r\n \"startTime\": \"2020-09-16T10:17:49.3886047+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"d3527cd2-6337-4501-9c96-173dae6e6e56\"\ \r\n}" headers: cache-control: @@ -2233,7 +2174,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:27:07 GMT + - Wed, 16 Sep 2020 10:21:22 GMT expires: - '-1' pragma: @@ -2250,7 +2191,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29768 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29886 status: code: 200 message: OK @@ -2264,13 +2205,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/ec84f944-79dd-4c67-b56a-350c0e3d873e?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d3527cd2-6337-4501-9c96-173dae6e6e56?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:23:35.2156675+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"ec84f944-79dd-4c67-b56a-350c0e3d873e\"\ + string: "{\r\n \"startTime\": \"2020-09-16T10:17:49.3886047+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"d3527cd2-6337-4501-9c96-173dae6e6e56\"\ \r\n}" headers: cache-control: @@ -2280,7 +2221,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:27:38 GMT + - Wed, 16 Sep 2020 10:21:52 GMT expires: - '-1' pragma: @@ -2297,7 +2238,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29765 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29883 status: code: 200 message: OK @@ -2311,13 +2252,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/ec84f944-79dd-4c67-b56a-350c0e3d873e?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d3527cd2-6337-4501-9c96-173dae6e6e56?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:23:35.2156675+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"ec84f944-79dd-4c67-b56a-350c0e3d873e\"\ + string: "{\r\n \"startTime\": \"2020-09-16T10:17:49.3886047+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"d3527cd2-6337-4501-9c96-173dae6e6e56\"\ \r\n}" headers: cache-control: @@ -2327,7 +2268,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:28:08 GMT + - Wed, 16 Sep 2020 10:22:23 GMT expires: - '-1' pragma: @@ -2344,7 +2285,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29763 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29880 status: code: 200 message: OK @@ -2358,13 +2299,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/ec84f944-79dd-4c67-b56a-350c0e3d873e?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d3527cd2-6337-4501-9c96-173dae6e6e56?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:23:35.2156675+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"ec84f944-79dd-4c67-b56a-350c0e3d873e\"\ + string: "{\r\n \"startTime\": \"2020-09-16T10:17:49.3886047+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"d3527cd2-6337-4501-9c96-173dae6e6e56\"\ \r\n}" headers: cache-control: @@ -2374,7 +2315,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:28:38 GMT + - Wed, 16 Sep 2020 10:22:54 GMT expires: - '-1' pragma: @@ -2391,7 +2332,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29760 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29877 status: code: 200 message: OK @@ -2405,14 +2346,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/ec84f944-79dd-4c67-b56a-350c0e3d873e?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d3527cd2-6337-4501-9c96-173dae6e6e56?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:23:35.2156675+00:00\",\r\n \"\ - endTime\": \"2020-06-01T09:28:45.6548094+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"ec84f944-79dd-4c67-b56a-350c0e3d873e\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T10:17:49.3886047+00:00\",\r\n \"\ + endTime\": \"2020-09-16T10:23:06.7345732+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"d3527cd2-6337-4501-9c96-173dae6e6e56\"\r\n}" headers: cache-control: - no-cache @@ -2421,7 +2362,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:29:08 GMT + - Wed, 16 Sep 2020 10:23:24 GMT expires: - '-1' pragma: @@ -2438,7 +2379,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29757 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29874 status: code: 200 message: OK @@ -2452,9 +2393,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/ec84f944-79dd-4c67-b56a-350c0e3d873e?monitor=true&api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d3527cd2-6337-4501-9c96-173dae6e6e56?monitor=true&api-version=2020-06-01 response: body: string: '' @@ -2464,7 +2405,7 @@ interactions: content-length: - '0' date: - - Mon, 01 Jun 2020 09:29:09 GMT + - Wed, 16 Sep 2020 10:23:24 GMT expires: - '-1' pragma: @@ -2477,7 +2418,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29756 + - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29873 status: code: 200 message: OK @@ -2493,9 +2434,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb172129e?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb172129e?api-version=2020-06-01 response: body: string: '' @@ -2503,17 +2444,17 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c6ce579d-f6d4-442d-9099-376d984dc70c?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/72e88555-a938-411d-9e65-3c28264ae947?api-version=2020-06-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 01 Jun 2020 09:29:09 GMT + - Wed, 16 Sep 2020 10:23:25 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c6ce579d-f6d4-442d-9099-376d984dc70c?monitor=true&api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/72e88555-a938-411d-9e65-3c28264ae947?monitor=true&api-version=2020-06-01 pragma: - no-cache server: @@ -2526,7 +2467,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/DeleteVMScaleSet3Min;79,Microsoft.Compute/DeleteVMScaleSet30Min;398,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;1199,Microsoft.Compute/VmssQueuedVMOperations;4799 x-ms-ratelimit-remaining-subscription-deletes: - - '14998' + - '14999' x-ms-request-charge: - '1' status: @@ -2542,389 +2483,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c6ce579d-f6d4-442d-9099-376d984dc70c?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-06-01T09:29:10.3736631+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"c6ce579d-f6d4-442d-9099-376d984dc70c\"\ - \r\n}" - headers: - cache-control: - - no-cache - content-length: - - '134' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 01 Jun 2020 09:29:20 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29755 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c6ce579d-f6d4-442d-9099-376d984dc70c?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-06-01T09:29:10.3736631+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"c6ce579d-f6d4-442d-9099-376d984dc70c\"\ - \r\n}" - headers: - cache-control: - - no-cache - content-length: - - '134' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 01 Jun 2020 09:29:32 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29754 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c6ce579d-f6d4-442d-9099-376d984dc70c?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-06-01T09:29:10.3736631+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"c6ce579d-f6d4-442d-9099-376d984dc70c\"\ - \r\n}" - headers: - cache-control: - - no-cache - content-length: - - '134' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 01 Jun 2020 09:30:02 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29757 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c6ce579d-f6d4-442d-9099-376d984dc70c?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-06-01T09:29:10.3736631+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"c6ce579d-f6d4-442d-9099-376d984dc70c\"\ - \r\n}" - headers: - cache-control: - - no-cache - content-length: - - '134' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 01 Jun 2020 09:30:32 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14988,Microsoft.Compute/GetOperation30Min;29756 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c6ce579d-f6d4-442d-9099-376d984dc70c?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-06-01T09:29:10.3736631+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"c6ce579d-f6d4-442d-9099-376d984dc70c\"\ - \r\n}" - headers: - cache-control: - - no-cache - content-length: - - '134' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 01 Jun 2020 09:31:02 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14990,Microsoft.Compute/GetOperation30Min;29755 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c6ce579d-f6d4-442d-9099-376d984dc70c?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-06-01T09:29:10.3736631+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"c6ce579d-f6d4-442d-9099-376d984dc70c\"\ - \r\n}" - headers: - cache-control: - - no-cache - content-length: - - '134' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 01 Jun 2020 09:31:33 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14991,Microsoft.Compute/GetOperation30Min;29753 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c6ce579d-f6d4-442d-9099-376d984dc70c?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-06-01T09:29:10.3736631+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"c6ce579d-f6d4-442d-9099-376d984dc70c\"\ - \r\n}" - headers: - cache-control: - - no-cache - content-length: - - '134' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 01 Jun 2020 09:32:03 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29752 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c6ce579d-f6d4-442d-9099-376d984dc70c?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-06-01T09:29:10.3736631+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"c6ce579d-f6d4-442d-9099-376d984dc70c\"\ - \r\n}" - headers: - cache-control: - - no-cache - content-length: - - '134' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 01 Jun 2020 09:32:33 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29751 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c6ce579d-f6d4-442d-9099-376d984dc70c?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/72e88555-a938-411d-9e65-3c28264ae947?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:29:10.3736631+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"c6ce579d-f6d4-442d-9099-376d984dc70c\"\ + string: "{\r\n \"startTime\": \"2020-09-16T10:23:25.4691378+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"72e88555-a938-411d-9e65-3c28264ae947\"\ \r\n}" headers: cache-control: @@ -2934,7 +2499,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:33:03 GMT + - Wed, 16 Sep 2020 10:23:35 GMT expires: - '-1' pragma: @@ -2951,7 +2516,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29750 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29872 status: code: 200 message: OK @@ -2965,13 +2530,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c6ce579d-f6d4-442d-9099-376d984dc70c?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/72e88555-a938-411d-9e65-3c28264ae947?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:29:10.3736631+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"c6ce579d-f6d4-442d-9099-376d984dc70c\"\ + string: "{\r\n \"startTime\": \"2020-09-16T10:23:25.4691378+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"72e88555-a938-411d-9e65-3c28264ae947\"\ \r\n}" headers: cache-control: @@ -2981,7 +2546,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:33:35 GMT + - Wed, 16 Sep 2020 10:23:46 GMT expires: - '-1' pragma: @@ -2998,7 +2563,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14992,Microsoft.Compute/GetOperation30Min;29748 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29871 status: code: 200 message: OK @@ -3012,14 +2577,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c6ce579d-f6d4-442d-9099-376d984dc70c?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/72e88555-a938-411d-9e65-3c28264ae947?api-version=2020-06-01 response: body: - string: "{\r\n \"startTime\": \"2020-06-01T09:29:10.3736631+00:00\",\r\n \"\ - endTime\": \"2020-06-01T09:33:48.4370833+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"c6ce579d-f6d4-442d-9099-376d984dc70c\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T10:23:25.4691378+00:00\",\r\n \"\ + endTime\": \"2020-09-16T10:23:57.7349876+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"72e88555-a938-411d-9e65-3c28264ae947\"\r\n}" headers: cache-control: - no-cache @@ -3028,7 +2593,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Jun 2020 09:34:05 GMT + - Wed, 16 Sep 2020 10:24:17 GMT expires: - '-1' pragma: @@ -3045,7 +2610,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14992,Microsoft.Compute/GetOperation30Min;29746 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29869 status: code: 200 message: OK diff --git a/sdk/compute/azure-mgmt-compute/tests/test_mgmt_compute_base_async.py b/sdk/compute/azure-mgmt-compute/tests/test_mgmt_compute_base_async.py index d7062803dbd8..b14d990ecf69 100644 --- a/sdk/compute/azure-mgmt-compute/tests/test_mgmt_compute_base_async.py +++ b/sdk/compute/azure-mgmt-compute/tests/test_mgmt_compute_base_async.py @@ -31,7 +31,7 @@ def setUp(self): def create_virtual_network(self, group_name, location, network_name, subnet_name): - azure_operation_poller = self.network_client.virtual_networks.create_or_update( + azure_operation_poller = self.network_client.virtual_networks.begin_create_or_update( group_name, network_name, { @@ -43,7 +43,7 @@ def create_virtual_network(self, group_name, location, network_name, subnet_name ) result_create = azure_operation_poller.result() - async_subnet_creation = self.network_client.subnets.create_or_update( + async_subnet_creation = self.network_client.subnets.begin_create_or_update( group_name, network_name, subnet_name, @@ -55,7 +55,7 @@ def create_virtual_network(self, group_name, location, network_name, subnet_name def create_network_interface(self, group_name, location, nic_name, subnet): - async_nic_creation = self.network_client.network_interfaces.create_or_update( + async_nic_creation = self.network_client.network_interfaces.begin_create_or_update( group_name, nic_name, { diff --git a/sdk/compute/azure-mgmt-compute/tests/test_mgmt_compute_vm.py b/sdk/compute/azure-mgmt-compute/tests/test_mgmt_compute_vm.py index 693d187b93e2..5b86dadc7c56 100644 --- a/sdk/compute/azure-mgmt-compute/tests/test_mgmt_compute_vm.py +++ b/sdk/compute/azure-mgmt-compute/tests/test_mgmt_compute_vm.py @@ -38,7 +38,7 @@ def setUp(self): def create_virtual_network(self, group_name, location, network_name, subnet_name): - azure_operation_poller = self.network_client.virtual_networks.create_or_update( + azure_operation_poller = self.network_client.virtual_networks.begin_create_or_update( group_name, network_name, { @@ -50,7 +50,7 @@ def create_virtual_network(self, group_name, location, network_name, subnet_name ) result_create = azure_operation_poller.result() - async_subnet_creation = self.network_client.subnets.create_or_update( + async_subnet_creation = self.network_client.subnets.begin_create_or_update( group_name, network_name, subnet_name, @@ -62,7 +62,7 @@ def create_virtual_network(self, group_name, location, network_name, subnet_name def create_network_interface(self, group_name, location, nic_name, subnet): - async_nic_creation = self.network_client.network_interfaces.create_or_update( + async_nic_creation = self.network_client.network_interfaces.begin_create_or_update( group_name, nic_name, { diff --git a/sdk/compute/azure-mgmt-compute/tests/test_mgmt_compute_vmss.py b/sdk/compute/azure-mgmt-compute/tests/test_mgmt_compute_vmss.py index f13eba6fde85..07caaf68d06e 100644 --- a/sdk/compute/azure-mgmt-compute/tests/test_mgmt_compute_vmss.py +++ b/sdk/compute/azure-mgmt-compute/tests/test_mgmt_compute_vmss.py @@ -38,7 +38,7 @@ def setUp(self): def create_virtual_network(self, group_name, location, network_name, subnet_name): - azure_operation_poller = self.network_client.virtual_networks.create_or_update( + azure_operation_poller = self.network_client.virtual_networks.begin_create_or_update( group_name, network_name, { @@ -50,7 +50,7 @@ def create_virtual_network(self, group_name, location, network_name, subnet_name ) result_create = azure_operation_poller.result() - async_subnet_creation = self.network_client.subnets.create_or_update( + async_subnet_creation = self.network_client.subnets.begin_create_or_update( group_name, network_name, subnet_name, @@ -71,7 +71,7 @@ def create_public_ip_address(self, group_name, location, public_ip_address_name) "name": "Standard" } } - result = self.network_client.public_ip_addresses.create_or_update(group_name, public_ip_address_name, BODY) + result = self.network_client.public_ip_addresses.begin_create_or_update(group_name, public_ip_address_name, BODY) result = result.result() def create_load_balance_probe(self, group_name, location): @@ -156,7 +156,7 @@ def create_load_balance_probe(self, group_name, location): } ] } - result = self.network_client.load_balancers.create_or_update(resource_group_name=RESOURCE_GROUP, load_balancer_name=LOAD_BALANCER_NAME, parameters=BODY) + result = self.network_client.load_balancers.begin_create_or_update(resource_group_name=RESOURCE_GROUP, load_balancer_name=LOAD_BALANCER_NAME, parameters=BODY) result = result.result() return ( "/subscriptions/" + SUBSCRIPTION_ID + "/resourceGroups/" + RESOURCE_GROUP + "/providers/Microsoft.Network/loadBalancers/" + LOAD_BALANCER_NAME + "/probes/myProbe", @@ -828,8 +828,12 @@ def test_compute(self, resource_group): result = result.result() # Redeploy virtual machine scale set (TODO: need swagger file) - result = self.mgmt_client.virtual_machine_scale_sets.begin_redeploy(resource_group.name, VIRTUAL_MACHINE_SCALE_SET_NAME) - result = result.result() + try: + result = self.mgmt_client.virtual_machine_scale_sets.begin_redeploy(resource_group.name, VIRTUAL_MACHINE_SCALE_SET_NAME) + result = result.result() + except HttpResponseError as e: + if not str(e).startswith("(VMRedeploymentTimedOut)"): + raise e # Deallocate virtual machine scale set (TODO: need swagger file) result = self.mgmt_client.virtual_machine_scale_sets.begin_deallocate(resource_group.name, VIRTUAL_MACHINE_SCALE_SET_NAME)